/* ══════════════════════════════════════════════════════════════
   GM AI Agent Web — Getmobil Partner Theme
   ══════════════════════════════════════════════════════════════ */

/* ── CSS Variables — Dark (default) ──────────────────────── */
:root,
[data-theme="dark"] {
    --bg-default:     #141416;
    --bg-sidenav:     #1a1a1e;
    --bg-card:        #1e1e22;
    --bg-card-hover:  #232328;
    --bg-input:       #28282e;
    --bg-topbar:      #1a1a1e;

    --primary:        #f97316;
    --primary-hover:  #ea6a0a;
    --info:           #60a5fa;
    --info-hover:     #3b82f6;
    --success:        #4CAF50;
    --warning:        #f59e0b;
    --error:          #ef4444;

    --text-primary:   rgba(255,255,255,0.92);
    --text-secondary: rgba(255,255,255,0.60);
    --text-muted:     rgba(255,255,255,0.36);
    --text-link:      #f97316;

    --border-color:   rgba(255,255,255,0.09);
    --border-light:   rgba(255,255,255,0.06);

    --radius-card:    10px;
    --radius-btn:     7px;
    --radius-badge:   5px;
    --shadow-card:    0 2px 12px rgba(0,0,0,0.45);
    --shadow-hover:   0 6px 24px rgba(0,0,0,0.55);

    --sidebar-width:  260px;
    --topbar-height:  60px;
    --font-family:    'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* ── Base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    font-family: var(--font-family);
    font-size: 15px;
    line-height: 1.55;
    background-color: var(--bg-default);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--text-link);
    text-decoration: none;
}
a:hover { text-decoration: underline; color: var(--primary-hover); }

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 600;
}

/* ── Layout ───────────────────────────────────────────────── */
.page {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
}

main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-default);
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    background: var(--bg-sidenav);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    flex-shrink: 0;
}

/* ── Top Bar ──────────────────────────────────────────────── */
.top-row {
    background-color: var(--bg-topbar);
    border-bottom: 1px solid var(--border-color);
    justify-content: flex-end;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-row ::deep a,
.top-row ::deep .btn-link {
    white-space: nowrap;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.top-row ::deep a:hover { color: var(--text-primary); text-decoration: none; }

/* ── Content ──────────────────────────────────────────────── */
article.content {
    padding: 1.5rem 2rem 2rem;
    flex: 1;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-light) !important;
    border-radius: var(--radius-card) !important;
    box-shadow: var(--shadow-card) !important;
    color: var(--text-primary);
}

.card-header {
    background-color: transparent !important;
    border-bottom: 1px solid var(--border-light) !important;
    padding: 1rem 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
}

.card-footer {
    background-color: transparent !important;
    border-top: 1px solid var(--border-light) !important;
    padding: 0.75rem 1.25rem;
}

.card-body { padding: 1.25rem; }

/* ── Tables ───────────────────────────────────────────────── */
.table {
    color: var(--text-primary) !important;
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255,255,255,0.02);
    --bs-table-hover-bg: rgba(255,255,255,0.04);
    --bs-table-border-color: var(--border-light);
    font-size: 0.9375rem;
}

.table thead th {
    background-color: rgba(255,255,255,0.03) !important;
    color: var(--text-muted) !important;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 0.8rem 1rem;
}

.table td {
    border-color: var(--border-light) !important;
    vertical-align: middle;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
}

.table-hover > tbody > tr:hover > td {
    background-color: rgba(255,255,255,0.03) !important;
}

.table-light { background-color: rgba(255,255,255,0.03) !important; }
.table-light th { color: var(--text-secondary) !important; }

.table-danger { background-color: rgba(239,68,68,0.10) !important; }
.table-danger td { color: #fca5a5 !important; }
.table-warning { background-color: rgba(245,158,11,0.10) !important; }
.table-warning td { color: #fcd34d !important; }

/* ── Forms ────────────────────────────────────────────────── */
.form-control, .form-select {
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-btn) !important;
    color: var(--text-primary) !important;
    font-size: 0.9375rem;
    padding: 0.5rem 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control::placeholder { color: var(--text-muted) !important; }

.form-control:focus, .form-select:focus {
    background-color: var(--bg-input) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(249,115,22,0.15) !important;
    color: var(--text-primary) !important;
    outline: none;
}

.form-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.form-select option { background: var(--bg-card); color: var(--text-primary); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    border-radius: var(--radius-btn) !important;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    padding: 0.45rem 1rem;
    transition: all 0.18s;
}

.btn-primary {
    background: var(--primary) !important;
    border-color: transparent !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(249,115,22,0.30) !important;
}

.btn-primary:hover {
    background: var(--primary-hover) !important;
    box-shadow: 0 4px 14px rgba(249,115,22,0.40) !important;
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    background: transparent !important;
}

.btn-outline-primary:hover {
    background: rgba(249,115,22,0.12) !important;
    color: var(--primary) !important;
}

.btn-outline-secondary {
    border-color: var(--border-color) !important;
    color: var(--text-secondary) !important;
    background: rgba(255,255,255,0.04) !important;
}

.btn-outline-secondary:hover {
    background: rgba(255,255,255,0.08) !important;
    color: var(--text-primary) !important;
    border-color: rgba(255,255,255,0.16) !important;
}

.btn-sm { padding: 0.3rem 0.75rem !important; font-size: 0.8125rem !important; }

/* ── Badges ───────────────────────────────────────────────── */
.badge {
    border-radius: var(--radius-badge) !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.03em;
    padding: 0.3em 0.65em !important;
}

.bg-success   { background-color: rgba(34,197,94,0.18) !important;  color: #86efac !important; }
.bg-danger    { background-color: rgba(239,68,68,0.18) !important;  color: #fca5a5 !important; }
.bg-warning   { background-color: rgba(245,158,11,0.18) !important; color: #fcd34d !important; }
.bg-info      { background-color: rgba(96,165,250,0.18) !important; color: #93c5fd !important; }
.bg-primary   { background-color: rgba(249,115,22,0.18) !important; color: #fdba74 !important; }
.bg-secondary { background-color: rgba(255,255,255,0.10) !important; color: var(--text-secondary) !important; }
.bg-dark      { background-color: rgba(255,255,255,0.08) !important; color: var(--text-primary) !important; }
.bg-light     { background-color: rgba(255,255,255,0.06) !important; color: var(--text-secondary) !important; }

/* ── Alerts ───────────────────────────────────────────────── */
.alert { border-radius: var(--radius-card) !important; border: none !important; }
.alert-danger   { background-color: rgba(239,68,68,0.12) !important;  color: #fca5a5 !important; }
.alert-warning  { background-color: rgba(245,158,11,0.12) !important; color: #fcd34d !important; }
.alert-success  { background-color: rgba(34,197,94,0.12) !important;  color: #86efac !important; }

/* ── Nav Tabs ─────────────────────────────────────────────── */
.nav-tabs {
    border-bottom: 1px solid var(--border-color) !important;
    gap: 0.25rem;
}

.nav-tabs .nav-link {
    color: var(--text-secondary) !important;
    border: none !important;
    border-radius: var(--radius-btn) var(--radius-btn) 0 0 !important;
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.nav-tabs .nav-link:hover {
    color: var(--text-primary) !important;
    background: rgba(255,255,255,0.04);
}

.nav-tabs .nav-link.active {
    color: var(--primary) !important;
    background: rgba(249,115,22,0.08) !important;
    border-bottom: 2px solid var(--primary) !important;
    font-weight: 600;
}

/* ── Text helpers ─────────────────────────────────────────── */
.spinner-border { border-color: var(--primary); border-right-color: transparent; }
.text-primary   { color: var(--primary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-success   { color: #86efac !important; }
.text-danger    { color: #fca5a5 !important; }

/* ── Code ─────────────────────────────────────────────────── */
code {
    font-size: 0.875rem;
    color: #fdba74;
    background: rgba(249,115,22,0.10);
    border-radius: 4px;
    padding: 0.15em 0.45em;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* ── Sidebar Nav ──────────────────────────────────────────── */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border-light);
    text-decoration: none !important;
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-brand-text {
    color: var(--text-primary) !important;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.sidebar-brand-sub {
    color: var(--text-muted);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-section-title {
    padding: 1.25rem 1.5rem 0.4rem;
    font-size: 0.675rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sidebar-nav-item {
    padding: 0.2rem 0.75rem;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.875rem;
    border-radius: 7px;
    color: var(--text-secondary) !important;
    text-decoration: none !important;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
    position: relative;
}

.sidebar-nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary) !important;
}

.sidebar-nav-link.active {
    background: rgba(249,115,22,0.14);
    color: #fff !important;
    font-weight: 600;
}

.sidebar-nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 0 3px 3px 0;
}

.sidebar-nav-icon {
    font-size: 1.1rem !important;
    width: 22px;
    text-align: center;
    opacity: 0.75;
}

.sidebar-nav-link.active .sidebar-nav-icon { opacity: 1; }

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-card {
    border: 1px solid var(--border-light) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-card) !important;
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover) !important;
}

.stat-card .card-body { padding: 1.25rem 1.5rem 1.5rem; }

.stat-card-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.stat-card-icon-wrapper.pink   { background: rgba(249,115,22,0.18); }
.stat-card-icon-wrapper.orange { background: rgba(245,158,11,0.18); }
.stat-card-icon-wrapper.green  { background: rgba(34,197,94,0.18); }
.stat-card-icon-wrapper.blue   { background: rgba(96,165,250,0.18); }

.stat-card-icon-wrapper.pink   .stat-card-icon { color: #fdba74; }
.stat-card-icon-wrapper.orange .stat-card-icon { color: #fcd34d; }
.stat-card-icon-wrapper.green  .stat-card-icon { color: #86efac; }
.stat-card-icon-wrapper.blue   .stat-card-icon { color: #93c5fd; }

.stat-card-icon { font-size: 1.5rem !important; }

.stat-card-value {
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-primary);
}

.stat-card-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.15rem;
}

.stat-card-divider {
    border-top: 1px solid var(--border-light);
    margin: 0.875rem -0.25rem 0.75rem;
}

.stat-card-footer {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* ── Login Page ───────────────────────────────────────────── */
.login-page {
    min-height: 100vh;
    display: flex;
    background: var(--bg-default);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 20% 50%, rgba(249,115,22,0.07) 0%, transparent 55%);
    pointer-events: none;
}

.login-left {
    display: none;
    flex: 1;
    background: var(--bg-sidenav);
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    border-right: 1px solid var(--border-light);
}

@media (min-width: 768px) { .login-left { display: flex; } }

.login-left-content { text-align: center; color: var(--text-primary); max-width: 340px; }
.login-left-icon { font-size: 5rem; margin-bottom: 1.5rem; opacity: 0.85; }
.login-left-title { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.75rem; }
.login-left-desc { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.65; }

.login-right {
    flex: 0 0 440px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

@media (max-width: 767px) { .login-right { flex: 1; } }

.login-card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 16px 48px rgba(0,0,0,0.50);
    border: 1px solid var(--border-light);
}

.login-logo-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.login-logo-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.login-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.75rem;
    margin-top: 0.25rem;
}

/* ── Blazor system ────────────────────────────────────────── */
.blazor-error-boundary {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: var(--radius-card);
    padding: 1rem 1.25rem;
    color: #fca5a5;
    margin: 1rem 0;
}
.blazor-error-boundary::after { content: "Beklenmedik bir hata oluştu. Lütfen sayfayı yenileyin." }

#blazor-error-ui {
    background: rgba(239,68,68,0.92);
    color: #fff;
    bottom: 0;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.4);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 0.9375rem;
    border-top: 2px solid var(--error);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.5rem;
    opacity: 0.7;
}
#blazor-error-ui .dismiss:hover { opacity: 1; }

/* ── Validation ───────────────────────────────────────────── */
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--success); }
.invalid { outline: 1px solid var(--error); }
.validation-message { color: var(--error); font-size: 0.8125rem; margin-top: 0.25rem; }

/* ── Misc utility ─────────────────────────────────────────── */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.border-light-custom { border-color: var(--border-light) !important; }

dl.row dt { color: var(--text-secondary); font-weight: 500; font-size: 0.875rem; }
dl.row dd { color: var(--text-primary); font-size: 0.9375rem; }

/* ── Light Theme ──────────────────────────────────────────── */
[data-theme="light"] {
    --bg-default:     #f4f5f7;
    --bg-sidenav:     #ffffff;
    --bg-card:        #ffffff;
    --bg-card-hover:  #f8f9fa;
    --bg-input:       #f1f3f5;
    --bg-topbar:      #ffffff;

    --text-primary:   rgba(0,0,0,0.87);
    --text-secondary: rgba(0,0,0,0.55);
    --text-muted:     rgba(0,0,0,0.36);
    --text-link:      #e05e00;

    --border-color:   rgba(0,0,0,0.10);
    --border-light:   rgba(0,0,0,0.07);

    --shadow-card:    0 1px 8px rgba(0,0,0,0.10);
    --shadow-hover:   0 4px 20px rgba(0,0,0,0.14);
}

[data-theme="light"] .sidebar {
    box-shadow: 2px 0 12px rgba(0,0,0,0.08);
}

[data-theme="light"] .table {
    --bs-table-hover-bg: rgba(0,0,0,0.025);
    --bs-table-striped-bg: rgba(0,0,0,0.015);
}

[data-theme="light"] .table thead th {
    background-color: rgba(0,0,0,0.03) !important;
    color: rgba(0,0,0,0.50) !important;
}

[data-theme="light"] .table td {
    border-color: rgba(0,0,0,0.06) !important;
}

[data-theme="light"] .table-hover > tbody > tr:hover > td {
    background-color: rgba(0,0,0,0.025) !important;
}

[data-theme="light"] .form-control,
[data-theme="light"] .form-select {
    background-color: #ffffff !important;
    border-color: rgba(0,0,0,0.14) !important;
    color: rgba(0,0,0,0.87) !important;
}

[data-theme="light"] .form-control::placeholder { color: rgba(0,0,0,0.35) !important; }

[data-theme="light"] .form-select option {
    background: #ffffff;
    color: rgba(0,0,0,0.87);
}

[data-theme="light"] .btn-outline-secondary {
    border-color: rgba(0,0,0,0.18) !important;
    color: rgba(0,0,0,0.60) !important;
    background: rgba(0,0,0,0.03) !important;
}

[data-theme="light"] .btn-outline-secondary:hover {
    background: rgba(0,0,0,0.07) !important;
    color: rgba(0,0,0,0.87) !important;
    border-color: rgba(0,0,0,0.25) !important;
}

[data-theme="light"] .nav-tabs {
    border-bottom-color: rgba(0,0,0,0.10) !important;
}

[data-theme="light"] .nav-tabs .nav-link:hover {
    background: rgba(0,0,0,0.04);
}

[data-theme="light"] code {
    color: #c2410c;
    background: rgba(249,115,22,0.10);
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.25);
}

[data-theme="light"] .sidebar-nav-link:hover {
    background: rgba(0,0,0,0.05);
}

[data-theme="light"] .sidebar-nav-link.active {
    background: rgba(249,115,22,0.12);
    color: #c2410c !important;
}

[data-theme="light"] .bg-secondary {
    background-color: rgba(0,0,0,0.08) !important;
    color: rgba(0,0,0,0.60) !important;
}

[data-theme="light"] .bg-dark {
    background-color: rgba(0,0,0,0.07) !important;
    color: rgba(0,0,0,0.80) !important;
}

[data-theme="light"] .bg-light {
    background-color: rgba(0,0,0,0.04) !important;
    color: rgba(0,0,0,0.60) !important;
}

[data-theme="light"] .login-page::before {
    background: radial-gradient(ellipse at 20% 50%, rgba(249,115,22,0.06) 0%, transparent 55%);
}

/* Responsive */
@media (max-width: 640.98px) {
    .sidebar { display: none; }
    article.content { padding: 1rem; }
}

/* ── Team Metrics — colored cell indicators ────────────────── */
.metric-good { color: var(--success); font-weight: 600; }
.metric-warn  { color: var(--warning); font-weight: 600; }
.metric-bad   { color: var(--error);   font-weight: 600; }

/* ── Engineering Dashboard ──────────────────────────────────── */
.eng-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding-left: 2px;
}

.eng-metric-block {
    padding: 0.5rem 0.25rem;
}

.eng-metric-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.eng-metric-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 2px;
}

.eng-metric-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 1px;
}

