/* admin.css - Professional dark admin panel theme */
:root {
    --admin-bg: #0f172a;
    --admin-sidebar: #1e293b;
    --admin-card: #1e293b;
    --admin-card-hover: #263548;
    --admin-border: #334155;
    --admin-text: #e2e8f0;
    --admin-text-muted: #94a3b8;
    --admin-primary: #3b82f6;
    --admin-primary-hover: #2563eb;
    --admin-success: #22c55e;
    --admin-warning: #f59e0b;
    --admin-danger: #ef4444;
    --admin-danger-hover: #dc2626;
    --sidebar-width: 260px;
    --topbar-height: 64px;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--admin-bg);
    color: var(--admin-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ==================== LOGIN SCREEN ==================== */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    padding: 20px;
}

.login-card {
    background: var(--admin-card);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow);
    border: 1px solid var(--admin-border);
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo img {
    max-width: 180px;
    margin-bottom: 15px;
}

.login-logo h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--admin-primary);
}

.login-logo p {
    color: var(--admin-text-muted);
    font-size: 14px;
    margin-top: 4px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--admin-text-muted);
    margin-bottom: 6px;
}

.login-form label i {
    margin-right: 6px;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: var(--admin-bg);
    color: var(--admin-text);
    font-size: 15px;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.login-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 16px;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--admin-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-login:hover {
    background: var(--admin-primary-hover);
    transform: translateY(-1px);
}

.login-hint {
    margin-top: 20px;
    text-align: center;
    padding: 12px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    font-size: 12px;
    color: var(--admin-text-muted);
}

/* ==================== ADMIN DASHBOARD LAYOUT ==================== */
.admin-dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--admin-sidebar);
    border-right: 1px solid var(--admin-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid var(--admin-border);
}

.sidebar-header img {
    max-width: 120px;
    margin-bottom: 8px;
}

.sidebar-header h3 {
    font-size: 15px;
    color: var(--admin-primary);
    font-weight: 700;
}

.sidebar-nav {
    flex: 1;
    padding: 15px 10px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: var(--admin-text-muted);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.sidebar-link i {
    width: 22px;
    text-align: center;
    margin-right: 12px;
    font-size: 16px;
}

.sidebar-link:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--admin-text);
}

.sidebar-link.active {
    background: var(--admin-primary);
    color: white;
}

.sidebar-footer {
    padding: 15px 10px;
    border-top: 1px solid var(--admin-border);
}

/* Main Area */
.admin-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-topbar {
    height: var(--topbar-height);
    background: var(--admin-sidebar);
    border-bottom: 1px solid var(--admin-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--admin-text);
    font-size: 20px;
    cursor: pointer;
    margin-right: 16px;
}

.topbar-title {
    flex: 1;
}

.topbar-title h2 {
    font-size: 18px;
    font-weight: 600;
}

.topbar-user {
    font-size: 14px;
    color: var(--admin-text-muted);
}

.topbar-user i {
    margin-right: 6px;
    color: var(--admin-primary);
}

.admin-content {
    flex: 1;
    padding: 24px;
}

/* ==================== SECTIONS ==================== */
.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== STATS GRID ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--admin-card);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--admin-border);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-blue .stat-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.stat-green .stat-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.stat-orange .stat-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.stat-red .stat-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
}

.stat-label {
    font-size: 13px;
    color: var(--admin-text-muted);
}

/* ==================== DASHBOARD GRID ==================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.dashboard-card {
    background: var(--admin-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--admin-border);
}

.dashboard-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--admin-text);
}

.dashboard-card h3 i {
    margin-right: 8px;
    color: var(--admin-primary);
}

/* Recent News */
.recent-news-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--admin-border);
}

.recent-news-item:last-child {
    border-bottom: none;
}

.recent-news-item .news-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-news-item .news-date {
    font-size: 12px;
    color: var(--admin-text-muted);
    margin-left: 12px;
    white-space: nowrap;
}

/* Quick Links */
.quick-links {
    display: grid;
    gap: 10px;
}

.quick-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--admin-bg);
    border-radius: 8px;
    color: var(--admin-text);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.quick-link:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--admin-primary);
}

.quick-link i {
    margin-right: 10px;
    color: var(--admin-primary);
}

/* ==================== SECTION HEADER ==================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-header h3 {
    font-size: 18px;
    font-weight: 600;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary {
    background: var(--admin-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--admin-primary-hover);
}

.btn-secondary {
    background: var(--admin-border);
    color: var(--admin-text);
}

.btn-secondary:hover {
    background: #475569;
}

.btn-danger {
    background: var(--admin-danger);
    color: white;
}

.btn-danger:hover {
    background: var(--admin-danger-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* ==================== TABLE ==================== */
.news-table-wrapper {
    background: var(--admin-card);
    border-radius: var(--radius);
    border: 1px solid var(--admin-border);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: var(--admin-text-muted);
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--admin-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--admin-border);
}

.admin-table tbody tr:hover {
    background: var(--admin-card-hover);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.table-actions {
    display: flex;
    gap: 6px;
}

.btn-edit {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-edit:hover {
    background: rgba(59, 130, 246, 0.3);
}

.btn-delete {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: none;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* ==================== FORMS ==================== */
.admin-form .form-group {
    margin-bottom: 20px;
}

.admin-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--admin-text-muted);
    margin-bottom: 6px;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--admin-border);
    border-radius: 8px;
    background: var(--admin-bg);
    color: var(--admin-text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.admin-form textarea {
    resize: vertical;
    min-height: 100px;
}

.admin-form select {
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.settings-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

.settings-card h4 {
    font-size: 16px;
    margin-bottom: 16px;
    color: var(--admin-text);
}

.settings-card h4 i {
    margin-right: 8px;
    color: var(--admin-primary);
}

.settings-card p {
    color: var(--admin-text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

/* ==================== MODAL ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: var(--admin-sidebar);
    border-radius: var(--radius);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--admin-border);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--admin-border);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--admin-text-muted);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--admin-danger);
}

.modal-content .admin-form {
    padding: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 10px;
}

/* ==================== TOAST ==================== */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    z-index: 300;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    animation: slideInToast 0.3s ease;
}

.toast.success {
    background: var(--admin-success);
    color: white;
}

.toast.error {
    background: var(--admin-danger);
    color: white;
}

.toast.info {
    background: var(--admin-primary);
    color: white;
}

@keyframes slideInToast {
    from {
        transform: translateX(100px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 992px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
    }

    .sidebar-toggle {
        display: block;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .admin-content {
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: 16px;
    }

    .login-card {
        padding: 24px;
    }

    .modal-content {
        max-height: 95vh;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

/* Scrollbar */
.modal-content::-webkit-scrollbar,
.news-table-wrapper::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track,
.news-table-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb,
.news-table-wrapper::-webkit-scrollbar-thumb {
    background: var(--admin-border);
    border-radius: 3px;
}