/* ═══════════════════════════════════════════════
   Brabus Avto — Global Design System (Dark Theme)
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #263348;
    --bg-input: #1e293b;
    --bg-surface: #162032;
    --border: #334155;
    --border-light: #475569;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-soft: rgba(59,130,246,0.12);
    --accent: #10b981;
    --accent-soft: rgba(16,185,129,0.12);
    --danger: #ef4444;
    --danger-soft: rgba(239,68,68,0.12);
    --warning: #f59e0b;
    --warning-soft: rgba(245,158,11,0.12);
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --shadow: 0 4px 24px rgba(0,0,0,0.3);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: #60a5fa; }

/* ═══════════════ TOPBAR ═══════════════ */
.top-bar {
    background: linear-gradient(180deg, #1e293b 0%, #162032 100%);
    border-bottom: 1px solid var(--border);
    padding: 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 10px 20px;
}

.top-bar .logo a { text-decoration: none; }
.top-bar .logo img {
    height: 75px; /* Loqo böyüdüldü */
    width: auto;
    border-radius: 10px;
    transition: transform var(--transition);
}
.top-bar .logo img:hover { transform: scale(1.05); }

.top-bar .navigation ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.top-bar .navigation a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13px;
    letter-spacing: 0.02em;
    transition: all var(--transition);
}
.top-bar .navigation a:hover {
    color: var(--text);
    background: var(--primary-soft);
}

.top-bar .user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
}
.top-bar .user-info a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}
.top-bar .user-info a:hover {
    color: var(--text);
    background: var(--primary-soft);
}
.top-bar .user-info .separator {
    color: var(--border);
    font-size: 11px;
}

/* ═══════════════ PAGE LAYOUT ═══════════════ */
.page-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

.page-title {
    text-align: center;
    margin-bottom: 28px;
}
.page-title h1 {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}
.page-title .subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ═══════════════ CARDS ═══════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.card-body {
    padding: 24px;
}
.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-surface);
}
.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
}

/* ═══════════════ FORMS ═══════════════ */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.form-textarea { resize: vertical; min-height: 80px; }

/* Auth forms (login, register, profile) */
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 28px;
    max-width: 440px;
    margin: 40px auto;
    box-shadow: var(--shadow-lg);
}
.auth-card h2 {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
}

/* ═══════════════ BUTTONS ═══════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: #fff;
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(59,130,246,0.35); }

.btn-success {
    background: linear-gradient(135deg, var(--accent), #059669);
    color: #fff;
}
.btn-success:hover { box-shadow: 0 6px 20px rgba(16,185,129,0.35); }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: #fff;
}
.btn-danger:hover { box-shadow: 0 6px 20px rgba(239,68,68,0.35); }

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d97706);
    color: #000;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-ghost:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-xs { padding: 6px 12px; font-size: 12px; border-radius: var(--radius-sm); }

.btn-submit {
    display: block;
    width: 100%;
    padding: 14px;
    margin-top: 20px;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(59,130,246,0.35);
}

/* ═══════════════ DATA TABLE ═══════════════ */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.table-scroll { overflow-x: auto; }

.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.data-table thead th {
    padding: 14px 16px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 5;
}
.data-table tbody tr {
    transition: background var(--transition);
}
.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(51,65,85,0.5);
    font-size: 14px;
    vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }

.data-table th.center,
.data-table td.center { text-align: center; }

/* ═══════════════ STATUS BADGES ═══════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.badge .dot {
    width: 6px; height: 6px; border-radius: 50%;
}
.badge-success { background: var(--accent-soft); color: var(--accent); }
.badge-success .dot { background: var(--accent); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-warning .dot { background: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-danger .dot { background: var(--danger); }
.badge-info { background: var(--primary-soft); color: var(--primary); }
.badge-info .dot { background: var(--primary); }

/* ═══════════════ FILTERS ═══════════════ */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.filter-bar label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}
.filter-bar input[type="date"] {
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
}
.filter-bar input[type="date"]:focus { outline: none; border-color: var(--primary); }

/* ═══════════════ FLASH MESSAGES ═══════════════ */
.flash {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: flashIn 0.3s ease-out;
}
@keyframes flashIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.flash-success { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(16,185,129,0.2); }
.flash-error { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }

/* ═══════════════ CONTACT ═══════════════ */
.contact-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 40px;
}
.contact-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 32px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    min-width: 260px;
}
.contact-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 12px 32px rgba(59,130,246,0.15);
}
.contact-card .phone-icon {
    font-size: 32px;
    margin-bottom: 12px;
}
.contact-card .phone-number {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
}

/* ═══════════════ EMPTY STATE ═══════════════ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 16px; }

/* ═══════════════ PAGINATION ═══════════════ */
.pagination-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 28px 0;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px; height: 38px;
    padding: 0 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition);
}
.page-link:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}
.page-link.active {
    background: linear-gradient(135deg, var(--primary), #6366f1);
    border-color: transparent;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(59,130,246,0.3);
}

/* ═══════════════ TOAST ═══════════════ */
.toast {
    position: fixed;
    bottom: 24px; right: 24px;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 99999;
    animation: toastIn 0.3s ease-out, toastOut 0.3s ease-in 2.7s forwards;
    pointer-events: none;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(20px); } }

/* ═══════════════ FOOTER ═══════════════ */
.site-footer {
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    text-align: center;
    padding: 18px 12px;
    font-size: 13px;
    margin-top: auto;
}

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 992px) {
    .top-bar .container {
        flex-direction: column;
        text-align: center;
    }
    .top-bar .navigation ul { justify-content: center; }
    .top-bar .user-info { justify-content: center; }
    .filter-bar { flex-direction: column; align-items: stretch; }
}

@media (max-width: 768px) {
    .page-wrap { padding: 16px 12px 40px; }
    .page-title h1 { font-size: 22px; }
    .auth-card { margin: 20px 12px; padding: 24px 20px; }
    .data-table td { padding: 10px 10px; font-size: 13px; }
    .data-table thead th { padding: 10px; font-size: 10px; }
    .contact-grid { flex-direction: column; align-items: center; }
}

@media (max-width: 480px) {
    .top-bar .navigation a { font-size: 11px; padding: 6px 10px; }
    .top-bar .user-info a { font-size: 11px; padding: 4px 8px; }
    .btn { font-size: 12px; padding: 8px 14px; }
}
