/* Admin Panel – Sade, tutarlı, okunaklı */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --abg: #111113;
    --abg-soft: #18181b;
    --abg-card: #1c1c1f;
    --aborder: #2d2d33;
    --aborder-focus: #3f3f46;
    --atext: #fafafa;
    --amuted: #71717a;
    --aprimary: #eab308;
    --aprimary-h: #facc15;
    --aerr: #dc2626;
    --aok: #16a34a;
    --ar: 10px;
    --ar-sm: 6px;
    --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font-ui);
    background: var(--abg);
    color: var(--atext);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* ========== LOGIN ========== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--abg-soft);
}

.login-box {
    background: var(--abg-card);
    padding: 32px;
    width: 100%;
    max-width: 380px;
    border: 1px solid var(--aborder);
    border-radius: var(--ar);
}

.login-box h1 {
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 4px;
    color: var(--atext);
}

.login-box .login-subtitle {
    font-size: 0.8125rem;
    color: var(--amuted);
    text-align: center;
    margin-bottom: 24px;
}

/* ========== FORM ========== */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.8125rem;
    color: var(--atext);
}
.form-hint { margin-top: 6px; font-size: 0.75rem; color: var(--amuted); }
.form-group-gallery .form-hint { margin-bottom: 8px; }
.gallery-preview-list { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.gallery-preview-item { width: 100px; text-align: center; }
.gallery-preview-item img { width: 100%; height: 80px; object-fit: cover; border-radius: var(--ar-sm); border: 1px solid var(--aborder); }
.gallery-delete-label { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 0.75rem; cursor: pointer; color: var(--amuted); }
.gallery-delete-label:hover { color: var(--aerr); }

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--aborder);
    border-radius: var(--ar-sm);
    background: var(--abg);
    color: var(--atext);
    font-family: var(--font-ui);
    font-size: 0.875rem;
    transition: border-color 0.2s var(--ease);
}

.form-control::placeholder { color: var(--amuted); }
.form-control:focus {
    outline: 0;
    border-color: var(--aprimary);
}

textarea.form-control { min-height: 120px; resize: vertical; }
select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}
input[type="file"].form-control { padding: 8px; }
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--aprimary);
    vertical-align: middle;
}
.form-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.form-section-title {
    font-size: 0.9rem; font-weight: 600; color: var(--amuted); margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--aborder);
}
.form-section-title:first-child { margin-top: 0; }
.form-actions { margin-top: 24px; display: flex; gap: 12px; align-items: center; }
.color-picker-group { display: flex; align-items: center; gap: 10px; }
.color-picker { width: 40px; height: 32px; border: 1px solid var(--aborder); cursor: pointer; padding: 2px; border-radius: var(--ar-sm); }
.color-preview { padding: 8px 12px; font-size: 0.75rem; color: var(--atext); border: 1px solid var(--aborder); border-radius: var(--ar-sm); }
label.checkbox-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 400; font-size: 0.875rem; }
.main-content img { max-width: 100%; height: auto; }

.admin-footer-hint { margin-top: 20px; font-size: 0.8125rem; color: var(--amuted); }
.admin-footer-hint a { color: var(--aprimary); text-decoration: none; }
.admin-footer-hint a:hover { text-decoration: underline; }

.abonelik-quick-extend-label { margin: 16px 0 8px; font-size: 0.75rem; color: var(--amuted); }
.abonelik-quick-extend { display: flex; flex-wrap: wrap; gap: 8px; }

/* ========== BUTTONS ========== */
.btn {
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: var(--ar-sm);
    font-family: var(--font-ui);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    min-height: 40px;
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.btn-primary {
    background: var(--aprimary);
    color: #0a0a0a;
    border-color: var(--aprimary);
}
.btn-primary:hover {
    background: var(--aprimary-h);
    border-color: var(--aprimary-h);
    color: #0a0a0a;
}

.login-box .btn-primary { width: 100%; }

.btn-success {
    background: var(--aok);
    color: #fff;
    border-color: var(--aok);
}
.btn-success:hover { background: #15803d; border-color: #15803d; color: #fff; }

.btn-danger {
    background: var(--aerr);
    color: #fff;
    border-color: var(--aerr);
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }

.btn-secondary {
    background: transparent;
    color: var(--amuted);
    border: 1px solid var(--aborder);
}
.btn-secondary:hover {
    border-color: var(--aborder-focus);
    color: var(--atext);
}

.btn-sm { padding: 6px 12px; font-size: 0.75rem; min-height: 34px; }

/* ========== ALERTS ========== */
.alert {
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.8125rem;
    border: 1px solid;
    border-radius: var(--ar-sm);
}
.alert-error, .alert-danger {
    background: rgba(220, 38, 38, 0.1);
    color: #fca5a5;
    border-color: rgba(220, 38, 38, 0.3);
}
.alert-success {
    background: rgba(22, 163, 74, 0.1);
    color: #86efac;
    border-color: rgba(22, 163, 74, 0.3);
}

/* ========== LAYOUT ========== */
.admin-wrapper, .admin-container { display: flex; min-height: 100vh; }

.mobile-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1001;
    min-width: 44px;
    min-height: 44px;
    padding: 0 14px;
    background: var(--abg-card);
    color: var(--atext);
    border: 1px solid var(--aborder);
    border-radius: var(--ar-sm);
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 0.875rem;
    font-weight: 500;
}
.mobile-sidebar-toggle:hover { border-color: var(--aborder-focus); background: var(--aborder); }
.mobile-sidebar-toggle-text { display: none; }
@media (min-width: 400px) { .mobile-sidebar-toggle-text { display: inline; } }

.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 998;
}
.mobile-sidebar-overlay.active { display: block; }

/* ========== SIDEBAR ========== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(260px, 85vw);
    max-width: 260px;
    height: 100vh;
    background: var(--abg-card);
    border-right: 1px solid var(--aborder);
    z-index: 1000;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.2s var(--ease);
    display: flex;
    flex-direction: column;
}
.sidebar.active { transform: translateX(0); }

.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid var(--aborder);
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--atext);
    display: block;
    margin-bottom: 2px;
}
.sidebar-tagline {
    font-size: 0.6875rem;
    color: var(--amuted);
}

.sidebar-menu {
    list-style: none;
    padding: 12px 8px;
    flex: 1;
}

.sidebar-menu .menu-group-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--amuted);
    padding: 12px 12px 6px;
    margin-top: 4px;
    border-top: 1px solid var(--aborder);
}
.sidebar-menu .menu-group-label:first-child { border-top: none; margin-top: 0; padding-top: 0; }

.sidebar-menu li { margin-bottom: 2px; }

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--amuted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    min-height: 40px;
    border-radius: var(--ar-sm);
    transition: color 0.2s var(--ease), background 0.2s var(--ease);
}

.sidebar-menu a .menu-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    opacity: 0.85;
}

.sidebar-menu a:hover {
    color: var(--atext);
    background: var(--abg-soft);
}

.sidebar-menu a.active {
    color: var(--atext);
    background: rgba(234, 179, 8, 0.15);
}

/* ========== MAIN CONTENT ========== */
.main-content {
    flex: 1;
    margin-left: 0;
    padding: 24px 16px 32px;
    min-height: 100vh;
    width: 100%;
    background: var(--abg-soft);
}

.admin-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99;
    background: var(--abg-card);
    padding: 12px 20px;
    border-bottom: 1px solid var(--aborder);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    min-height: 52px;
}

.admin-header h1 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--atext);
    flex: 1;
    min-width: 0;
}

.admin-header .user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--amuted);
    flex-shrink: 0;
}
.admin-header .user-info .btn { flex-shrink: 0; }

/* ========== CARDS ========== */
.card {
    background: var(--abg-card);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--aborder);
    border-radius: var(--ar);
}

.card-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--aborder);
}

.card-header h2 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--atext);
}

.content-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}
.content-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--atext);
    margin-bottom: 0;
}
.content-header p { color: var(--amuted); font-size: 0.8125rem; }
.card-body { padding: 0; }
.card > p { margin-bottom: 0.75rem; color: var(--amuted); font-size: 0.8125rem; }

/* ========== STATS ========== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--abg-card);
    padding: 18px;
    border: 1px solid var(--aborder);
    border-radius: var(--ar);
}

.stat-card h3 {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--amuted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--atext);
}


/* ========== DASHBOARD CTA & QUICK ACTIONS ========== */
.dashboard-cta {
    background: transparent;
    border: none;
    padding: 0;
    margin: 28px 0;
}
.dashboard-cta h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--atext);
    margin-bottom: 16px;
}
.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px 16px;
    background: var(--abg-card);
    border: 1px solid var(--aborder);
    border-radius: var(--ar);
    color: var(--amuted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
}
.quick-action-btn:hover {
    border-color: var(--aprimary);
    color: var(--atext);
    background: var(--abg-card);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.qa-icon {
    font-size: 1.75rem;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(234,179,8,0.1);
    border-radius: 14px;
}
.quick-action-btn:hover .qa-icon {
    background: rgba(234,179,8,0.25);
}

/* ========== DASHBOARD GRID ========== */
.dashboard-grid {
    display: grid;
    gap: 20px;
}

@media (max-width: 768px) {
    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 2fr 1fr;
    }
}

/* ========== ENHANCED STAT CARDS ========== */
.stats-grid {
    grid-template-columns: repeat(4, 1fr);
}
.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--aprimary);
    border-radius: 0 2px 2px 0;
}
.stat-card-success::before { background: #22c55e; }
.stat-card-warning::before { background: #f59e0b; }
.stat-card-info::before { background: #3b82f6; }
.stat-icon {
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(234,179,8,0.1);
    border-radius: 12px;
    flex-shrink: 0;
}
.stat-card-success .stat-icon { background: rgba(34,197,94,0.1); }
.stat-card-warning .stat-icon { background: rgba(245,158,11,0.1); }
.stat-card-info .stat-icon { background: rgba(59,130,246,0.1); }
.stat-info { flex: 1; }

/* ========== TABLE FULL WIDTH ========== */
.table-responsive table {
    width: 100%;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 769px) {
    .sidebar + .main-content {
        margin-left: 0;
    }
}

/* ========== DESKTOP SIDEBAR ========== */
@media (min-width: 1024px) {
    .sidebar {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 260px;
    }
    .mobile-sidebar-toggle {
        display: none;
    }
    .admin-header {
        left: 260px;
    }
}

/* ========== STAT CARD LABELS ========== */
.stat-card h3 {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--amuted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ========== LAYOUT FIXES ========== */
@media (min-width: 1024px) {
    .main-content {
        padding-top: 76px;
        padding-left: 24px;
        padding-right: 24px;
    }
}
.dashboard-grid > .card {
    overflow: visible;
}

/* ========== WIDTH FIX ========== */
@media (min-width: 1024px) {
    .main-content {
        width: calc(100% - 260px);
        margin-left: 260px;
    }
}

/* ========== OVERRIDE WIDTH ========== */
@media (min-width: 1024px) {
    .main-content {
        width: auto !important;
        margin-left: 260px !important;
        overflow-x: hidden;
    }
}

/* ========== BADGES ========== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    line-height: 1.4;
}
.badge-success {
    background: rgba(34,197,94,0.15);
    color: #22c55e;
}
.badge-danger {
    background: rgba(239,68,68,0.15);
    color: #ef4444;
}
.badge-warning {
    background: rgba(245,158,11,0.15);
    color: #f59e0b;
}

/* ========== DASHBOARD GRID FULL WIDTH ========== */
@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ========== TABLE STYLES ========== */
table {
    width: 100%;
    border-collapse: collapse;
}
table thead th {
    text-align: left;
    padding: 10px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--amuted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--aborder);
}
table tbody td {
    padding: 10px 16px;
    font-size: 0.8125rem;
    color: var(--atext);
    border-bottom: 1px solid var(--aborder);
}
table tbody tr:last-child td {
    border-bottom: none;
}
table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

/* ========== CARD HEADER FIX ========== */
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--aborder);
}
.card-header h2 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--atext);
}

/* ========== TEXT HELPERS ========== */
.text-danger { color: #ef4444; }
.text-success { color: #22c55e; }
