/* =======================================================
   dkart.tr - Admin & Bayi Paneli Ortak Tasarım Sistemi (SaaS)
   ======================================================= */

:root {
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --primary-light: #e0f2fe;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg-page: #f1f5f9;
    --bg-card: #ffffff;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding: 24px 16px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    text-decoration: none;
    padding: 0 8px 24px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 24px;
}

.sidebar-logo span {
    color: var(--primary);
}

.sidebar-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(2, 132, 199, 0.2);
    color: #38bdf8;
    text-transform: uppercase;
    margin-left: auto;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.18s ease;
}

.nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: #ffffff;
}

.nav-link.active {
    background: var(--primary);
    color: #ffffff;
}

.nav-link svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 100vh;
}

.topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.topbar-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 14px;
}

.content-container {
    padding: 32px;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
}

/* Kota Kartı (Reseller / Bayi Özel Göstergesi) */
.quota-banner {
    background: linear-gradient(135deg, #0284c7, #2563eb);
    color: #ffffff;
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.35);
}

.quota-info h2 {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
}

.quota-info p {
    font-size: 14px;
    opacity: 0.9;
}

.quota-progress-box {
    min-width: 240px;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.progress-bar-bg {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.25);
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #ffffff;
    border-radius: 5px;
    transition: width 0.4s ease;
}

/* Stat Kartları Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Tablolar & Kartlar */
.panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 28px;
}

.panel-card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-card-title {
    font-size: 17px;
    font-weight: 700;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.data-table th {
    background: #f8fafc;
    padding: 12px 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.data-table td {
    padding: 14px 20px;
    font-size: 13.5px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: #f8fafc;
}

/* Rozetler (Badges) */
.badge-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.badge-active { background: #dcfce7; color: #15803d; }
.badge-suspended { background: #fee2e2; color: #b91c1c; }
.badge-expired { background: #fef3c7; color: #b45309; }

/* Butonlar */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
}

.btn-danger:hover {
    background: #fca5a5;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Formlar */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.form-control {
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
    background: #ffffff;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.form-help {
    font-size: 12px;
    color: var(--text-secondary);
}

.alert {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 13.5px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fef3c7;
    color: #92400e;
}

/* Giriş Ekranı (Login) */
.login-body {
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-card {
    background: #ffffff;
    width: 100%;
    max-width: 420px;
    border-radius: 16px;
    padding: 40px 32px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    font-size: 22px;
    font-weight: 800;
    margin-top: 12px;
}

.login-header p {
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* =======================================================
   Mobil & Responsive Tasarım Sistemi
   ======================================================= */

/* Topbar Sol Kısım ve Hamburger Butonu */
.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.sidebar-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: var(--text-primary);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.sidebar-toggle-btn:hover,
.sidebar-toggle-btn:active {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* Mobil Kapatma Butonu (Sidebar İçinde) */
.sidebar-close-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: none;
    cursor: pointer;
    margin-left: auto;
    transition: background 0.15s ease;
}

.sidebar-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Karartma Perdesi (Backdrop) */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

/* Tablo Kapsayıcısı */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0;
}

/* Tablet ve Mobil Ekranlar (<= 992px) */
@media (max-width: 992px) {
    body {
        display: block !important;
        position: relative !important;
        overflow-x: hidden !important;
        width: 100% !important;
    }

    body.sidebar-open {
        overflow: hidden !important;
    }

    /* Sol Menü (Sidebar) Çekmece / Drawer Haline Gelir */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        width: 280px !important;
        max-width: 84vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 99999 !important;
        transform: translateX(-100%) !important;
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s ease !important;
        box-shadow: none !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .sidebar.open,
    body.sidebar-open .sidebar {
        transform: translateX(0) !important;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.65) !important;
    }

    .sidebar-toggle-btn {
        display: inline-flex !important;
    }

    .sidebar-close-btn {
        display: inline-flex !important;
    }

    /* Sağ Taraf (Main Wrapper) Tam Genişlik */
    .main-wrapper {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        max-height: none !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
    }

    .topbar {
        position: sticky !important;
        top: 0 !important;
        z-index: 100 !important;
        padding: 12px 16px !important;
        gap: 10px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
    }

    .topbar-title {
        font-size: 16px !important;
        line-height: 1.25 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 200px !important;
    }

    .content-container {
        padding: 16px 12px;
        width: 100%;
        max-width: 100%;
    }

    /* Kota Kartı (Bayi Paneli) */
    .quota-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 18px 16px;
    }

    .quota-info h2 {
        font-size: 18px;
    }

    .quota-progress-box {
        width: 100%;
        min-width: 0;
    }

    /* İstatistik Kartları */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }

    .stat-card {
        padding: 14px;
        gap: 12px;
    }

    .stat-icon {
        width: 42px;
        height: 42px;
    }

    .stat-value {
        font-size: 20px;
    }

    /* Kartvizit & Tablo Başlıkları */
    .panel-card-header {
        padding: 14px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .panel-card-header > div,
    .panel-card-header > a,
    .panel-card-header > button {
        width: 100%;
        justify-content: center;
    }

    /* Form Izgaraları */
    .form-grid {
        grid-template-columns: 1fr;
        padding: 16px 12px;
        gap: 16px;
    }

    /* Tablo Kaydırma */
    .panel-card {
        margin-bottom: 18px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .data-table {
        min-width: 600px;
    }

    .data-table th,
    .data-table td {
        padding: 12px 14px;
        font-size: 13px;
    }
}

/* Küçük Ekranlı Akıllı Telefonlar (<= 576px) */
@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .topbar-title {
        max-width: 160px;
        font-size: 15px;
    }

    .user-profile span {
        display: none;
    }

    .user-profile {
        gap: 6px;
    }

    .btn-sm {
        padding: 6px 10px;
        font-size: 11.5px;
    }

    .login-card {
        margin: 16px;
        padding: 24px 18px;
    }
}

/* =======================================================
   Filtreleme & Arama Çubuğu (Search & Filter Bar)
   ======================================================= */
.filter-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.filter-form {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 200px;
}

.filter-form .form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 13.5px;
    min-width: 160px;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

/* =======================================================
   Sayfalama (Pagination Component)
   ======================================================= */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 12px;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-secondary);
}

.pagination-info strong {
    color: var(--text-primary);
}

.pagination-list {
    display: flex;
    gap: 4px;
    list-style: none;
    align-items: center;
    margin: 0;
    padding: 0;
}

.pagination-item a,
.pagination-item span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
    background: #ffffff;
    transition: all 0.15s ease;
}

.pagination-item a:hover {
    background: var(--bg-page);
    border-color: #cbd5e1;
    color: var(--primary);
}

.pagination-item.active span {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.pagination-item.disabled span {
    color: #cbd5e1;
    cursor: not-allowed;
    background: #f8fafc;
    border-color: #e2e8f0;
}

@media (max-width: 768px) {
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    .filter-group {
        width: 100%;
        min-width: unset;
    }
    .filter-actions {
        width: 100%;
        justify-content: flex-end;
    }
    .pagination-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}

/* =======================================================
   Kompakt Simge Butonlar & Tooltip (Action Icon Buttons)
   ======================================================= */
.action-buttons {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: nowrap;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: #ffffff;
    color: #475569;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    flex-shrink: 0;
    box-sizing: border-box;
}

.btn-icon svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.btn-icon:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.btn-icon-primary {
    color: #0284c7;
    background: #f0f9ff;
    border-color: #bae6fd;
}
.btn-icon-primary:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.btn-icon-secondary {
    color: #475569;
    background: #f8fafc;
    border-color: #e2e8f0;
}
.btn-icon-secondary:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #cbd5e1;
}

.btn-icon-warning {
    color: #d97706;
    background: #fffbeb;
    border-color: #fde68a;
}
.btn-icon-warning:hover {
    background: #d97706;
    color: #ffffff;
    border-color: #d97706;
}

.btn-icon-danger {
    color: #dc2626;
    background: #fef2f2;
    border-color: #fecaca;
}
.btn-icon-danger:hover {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
}

/* Şık CSS Tooltip Bilgi Balonu */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 118%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 4px 8px;
    border-radius: 6px;
    background: #0f172a;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 99999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.22);
}

[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 118%;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    border-width: 4px 4px 0 4px;
    border-style: solid;
    border-color: #0f172a transparent transparent transparent;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 99999;
}

[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-2px);
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(2px);
}

