/* ============================================================
   Devex AI Studios — Design System
   Prefix: dx-
   Sidebar: #0D1117 background, #2563EB accent
   ============================================================ */

:root {
    --dx-bg:          #0D1117;
    --dx-accent:      #2563EB;
    --dx-accent-lt:   #3B82F6;
    --dx-accent-dim:  rgba(37,99,235,.15);
    --dx-surface:     #161B22;
    --dx-border:      rgba(255,255,255,.08);
    --dx-text:        #E6EDF3;
    --dx-muted:       #7D8590;
    --dx-success:     #16A34A;
    --dx-warning:     #D97706;
    --dx-danger:      #DC2626;
    --dx-sidebar-w:   248px;
    --dx-radius:      8px;
    --dx-font:        'DM Sans', 'Segoe UI', Arial, sans-serif;
}

/* ── Override base.css sidebar with Devex colours ── */
.sidebar {
    background: var(--dx-bg) !important;
    width: var(--dx-sidebar-w) !important;
}

.sidebar-brand {
    font-family: var(--dx-font);
    font-size: 14px !important;
    font-weight: 700 !important;
    letter-spacing: .04em;
    color: #fff !important;
    padding: 20px 20px 16px !important;
    border-bottom: 1px solid var(--dx-border) !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-brand .dx-brand-mark {
    width: 28px;
    height: 28px;
    background: var(--dx-accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand .dx-brand-name {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sidebar-brand .dx-brand-name span {
    font-size: 11px;
    font-weight: 400;
    color: var(--dx-muted);
    letter-spacing: 0;
}

.sidebar-section {
    padding: 14px 0 !important;
    border-bottom: 1px solid var(--dx-border) !important;
}

.sidebar-section:last-child {
    border-bottom: none !important;
}

.sidebar-section-title {
    padding: 0 16px 6px 16px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    color: var(--dx-muted) !important;
    letter-spacing: .08em !important;
}

.sidebar-link {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 7px 16px !important;
    color: #8B949E !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-family: var(--dx-font);
    transition: color .15s, background .15s !important;
    border-radius: 0;
}

.sidebar-link:hover {
    background: rgba(255,255,255,.05) !important;
    color: var(--dx-text) !important;
}

.sidebar-link.active {
    background: var(--dx-accent-dim) !important;
    color: var(--dx-accent-lt) !important;
    font-weight: 600 !important;
    border-left: 2px solid var(--dx-accent);
}

.sidebar-link .dx-icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    opacity: .7;
}

.sidebar-link.active .dx-icon {
    opacity: 1;
}

/* ── Main content: shift for wider sidebar ── */
.main-content {
    margin-left: var(--dx-sidebar-w) !important;
}

/* ── Topbar ── */
.topbar {
    background: #fff;
    border-bottom: 1px solid #E5E7EB;
}

.topbar-title h1 {
    font-size: 22px !important;
    color: #0F172A !important;
}

/* ── Auth badge in topbar ── */
.dx-auth-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748B;
}

.dx-auth-badge .dx-role-pill {
    background: var(--dx-accent-dim);
    color: var(--dx-accent);
    border: 1px solid rgba(37,99,235,.25);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.dx-auth-badge a {
    color: #94A3B8;
    text-decoration: none;
    font-size: 12px;
}

.dx-auth-badge a:hover {
    color: var(--dx-danger);
}

/* ── Page cards ── */
.dx-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: var(--dx-radius);
    padding: 24px;
}

.dx-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.dx-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #0F172A;
}

/* ── KPI strip ── */
.dx-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.dx-kpi {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: var(--dx-radius);
    padding: 18px 20px;
    text-decoration: none;
    color: inherit;
    transition: border-color .2s, box-shadow .2s;
}

.dx-kpi:hover {
    border-color: var(--dx-accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}

.dx-kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: #0F172A;
    line-height: 1;
    margin-bottom: 4px;
}

.dx-kpi-label {
    font-size: 12px;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 500;
}

.dx-kpi.accent  .dx-kpi-value { color: var(--dx-accent); }
.dx-kpi.success .dx-kpi-value { color: var(--dx-success); }
.dx-kpi.danger  .dx-kpi-value { color: var(--dx-danger); }
.dx-kpi.warning .dx-kpi-value { color: var(--dx-warning); }

/* ── Status badges ── */
.dx-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.dx-badge-new       { background: #EFF6FF; color: #1D4ED8; }
.dx-badge-reviewing { background: #FFF7ED; color: #C2410C; }
.dx-badge-scoped    { background: #F0FDF4; color: #15803D; }
.dx-badge-sent      { background: #F5F3FF; color: #6D28D9; }
.dx-badge-won       { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.dx-badge-lost      { background: #FEF2F2; color: #991B1B; }
.dx-badge-archived  { background: #F8FAFC; color: #64748B; }
.dx-badge-urgent    { background: #FEF2F2; color: #DC2626; }
.dx-badge-normal    { background: #F0F9FF; color: #0369A1; }
.dx-badge-low       { background: #F8FAFC; color: #475569; }
.dx-badge-done      { background: #ECFDF5; color: #065F46; }
.dx-badge-active    { background: #EFF6FF; color: #1E40AF; }
.dx-badge-flushed   { background: #F0FDF4; color: #15803D; }
.dx-badge-error     { background: #FEF2F2; color: #991B1B; }

/* ── Tables ── */
.dx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.dx-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748B;
    background: #F8FAFC;
    border-bottom: 1px solid #E5E7EB;
}

.dx-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #F1F5F9;
    color: #1E293B;
    vertical-align: middle;
}

.dx-table tr:hover td {
    background: #F8FAFC;
}

.dx-table tr:last-child td {
    border-bottom: none;
}

.dx-table a {
    color: var(--dx-accent);
    text-decoration: none;
    font-weight: 500;
}

.dx-table a:hover {
    text-decoration: underline;
}

/* ── Buttons ── */
.dx-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all .15s;
    font-family: var(--dx-font);
}

.dx-btn-primary {
    background: var(--dx-accent);
    color: #fff;
}

.dx-btn-primary:hover {
    background: #1D4ED8;
    color: #fff;
}

.dx-btn-secondary {
    background: #F1F5F9;
    color: #475569;
}

.dx-btn-secondary:hover {
    background: #E2E8F0;
    color: #334155;
}

.dx-btn-danger {
    background: #FEF2F2;
    color: var(--dx-danger);
    border: 1px solid #FECACA;
}

.dx-btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* ── Login page ── */
.dx-login-shell {
    min-height: 100vh;
    background: var(--dx-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--dx-font);
}

.dx-login-card {
    background: var(--dx-surface);
    border: 1px solid var(--dx-border);
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.dx-login-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
}

.dx-login-logo .mark {
    width: 36px;
    height: 36px;
    background: var(--dx-accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: #fff;
}

.dx-login-logo .name {
    font-size: 16px;
    font-weight: 700;
    color: var(--dx-text);
}

.dx-login-logo .sub {
    font-size: 11px;
    color: var(--dx-muted);
}

.dx-login-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--dx-text);
    margin-bottom: 6px;
}

.dx-login-sub {
    font-size: 13px;
    color: var(--dx-muted);
    margin-bottom: 28px;
}

.dx-form-group {
    margin-bottom: 16px;
}

.dx-form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--dx-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 6px;
}

.dx-form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--dx-bg);
    border: 1px solid var(--dx-border);
    border-radius: 6px;
    color: var(--dx-text);
    font-size: 14px;
    font-family: var(--dx-font);
    transition: border-color .15s;
}

.dx-form-input:focus {
    outline: none;
    border-color: var(--dx-accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,.2);
}

.dx-form-input::placeholder {
    color: var(--dx-muted);
}

.dx-login-error {
    background: rgba(220,38,38,.1);
    border: 1px solid rgba(220,38,38,.3);
    color: #FCA5A5;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}

.dx-login-submit {
    width: 100%;
    padding: 11px;
    background: var(--dx-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--dx-font);
    transition: background .15s;
    margin-top: 8px;
}

.dx-login-submit:hover {
    background: #1D4ED8;
}

.dx-login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 12px;
    color: var(--dx-muted);
}

.dx-login-footer a {
    color: var(--dx-accent-lt);
    text-decoration: none;
}

/* ── Alert banners ── */
.dx-alert {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.dx-alert-success { background: #F0FDF4; color: #15803D; border: 1px solid #BBF7D0; }
.dx-alert-error   { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.dx-alert-info    { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.dx-alert-warn    { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }

/* ── Section headers ── */
.dx-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.dx-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #0F172A;
}

/* ── Empty state ── */
.dx-empty {
    text-align: center;
    padding: 60px 20px;
    color: #94A3B8;
}

.dx-empty-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.dx-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.dx-empty-sub {
    font-size: 13px;
    color: #94A3B8;
}

/* ── Studio dashboard ── */
.dx-studio-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.dx-panel {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: var(--dx-radius);
    overflow: hidden;
}

.dx-panel-head {
    padding: 14px 20px;
    border-bottom: 1px solid #F1F5F9;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dx-panel-head-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.dx-panel-body {
    padding: 0;
}

.dx-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 20px;
    border-bottom: 1px solid #F9FAFB;
    font-size: 13px;
    text-decoration: none;
    color: #374151;
    transition: background .15s;
}

.dx-list-row:hover {
    background: #F8FAFC;
}

.dx-list-row:last-child {
    border-bottom: none;
}

.dx-list-ref {
    font-weight: 600;
    color: var(--dx-accent);
    font-size: 12px;
    font-family: monospace;
}

.dx-list-meta {
    font-size: 12px;
    color: #94A3B8;
}

/* ── Public landing ── */
.dx-public-shell {
    font-family: var(--dx-font);
    background: #F8FAFC;
    min-height: 100vh;
}

.dx-hero {
    background: linear-gradient(135deg, var(--dx-bg) 0%, #0D2340 100%);
    color: #fff;
    padding: 80px 24px;
    text-align: center;
}

.dx-hero-eyebrow {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--dx-accent-lt);
    margin-bottom: 16px;
}

.dx-hero-title {
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 20px;
    color: #F1F5F9;
}

.dx-hero-title em {
    font-style: normal;
    color: var(--dx-accent-lt);
}

.dx-hero-sub {
    font-size: 18px;
    color: #94A3B8;
    max-width: 540px;
    margin: 0 auto 36px;
    line-height: 1.6;
}

.dx-hero-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.dx-btn-hero-primary {
    background: var(--dx-accent);
    color: #fff;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s;
}

.dx-btn-hero-primary:hover { background: #1D4ED8; }

.dx-btn-hero-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,.3);
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s;
}

.dx-btn-hero-outline:hover { border-color: rgba(255,255,255,.6); }

/* ── Services page ── */
.dx-services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.dx-service-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: var(--dx-radius);
    padding: 28px;
    transition: box-shadow .2s, border-color .2s;
}

.dx-service-card:hover {
    border-color: var(--dx-accent);
    box-shadow: 0 4px 20px rgba(37,99,235,.1);
}

.dx-service-icon {
    width: 44px;
    height: 44px;
    background: var(--dx-accent-dim);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 20px;
}

.dx-service-name {
    font-size: 16px;
    font-weight: 600;
    color: #0F172A;
    margin-bottom: 8px;
}

.dx-service-desc {
    font-size: 13px;
    color: #64748B;
    line-height: 1.6;
}

/* ── Public nav ── */
.dx-public-nav {
    background: var(--dx-bg);
    border-bottom: 1px solid rgba(255,255,255,.08);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.dx-public-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
}

.dx-public-nav-brand .mark {
    width: 30px;
    height: 30px;
    background: var(--dx-accent);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
}

.dx-public-nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.dx-public-nav-links a {
    color: #8B949E;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color .15s;
}

.dx-public-nav-links a:hover {
    color: #fff;
}

.dx-public-nav-links a.active {
    color: #fff;
}

/* ── Contact form ── */
.dx-contact-shell {
    max-width: 640px;
    margin: 0 auto;
    padding: 60px 24px;
}

.dx-contact-form .dx-form-group {
    margin-bottom: 18px;
}

.dx-contact-form .dx-form-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 6px;
}

.dx-contact-form .dx-form-input,
.dx-contact-form textarea.dx-form-input {
    background: #fff;
    border: 1px solid #E5E7EB;
    color: #1E293B;
    font-size: 14px;
}

.dx-contact-form .dx-form-input:focus,
.dx-contact-form textarea.dx-form-input:focus {
    border-color: var(--dx-accent);
}

.dx-contact-form textarea.dx-form-input {
    resize: vertical;
    min-height: 120px;
}

/* ── Responsive adjustments ── */
@media (max-width: 768px) {
    .dx-studio-grid { grid-template-columns: 1fr; }
    .dx-kpi-row     { grid-template-columns: repeat(2, 1fr); }
    .dx-public-nav  { padding: 0 20px; }
    .dx-hero        { padding: 60px 20px; }
}
