/* ============================================================
   SVJ 448 — Admin Styles
   Login, sidebar, cards, tables, stats, responsive
   ============================================================ */

/* --- Login Page --- */
.login-page {
    background: linear-gradient(135deg, var(--neutral-900) 0%, var(--neutral-800) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    background: var(--bg-surface);
    padding: 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.login-container h1 {
    margin: 0;
    color: var(--text);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.login-container h2 {
    margin: 0.25rem 0 1.75rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 400;
}

.login-container .form-group {
    text-align: left;
    margin-bottom: 1rem;
}

.login-container .form-group label {
    display: block;
    margin-bottom: 0.375rem;
    color: var(--neutral-600);
    font-size: 0.875rem;
    font-weight: 600;
}

.login-container .btn-submit {
    margin-top: 0.5rem;
}

.error-message {
    background: var(--danger-50);
    border: 1px solid var(--danger-500);
    color: var(--danger-700);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* --- Admin Layout --- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.admin-sidebar {
    width: 240px;
    background: linear-gradient(180deg, var(--neutral-900) 0%, #162032 100%);
    color: #fff;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-sidebar .sidebar-header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.admin-sidebar h1 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.03em;
}

.admin-sidebar .current-period {
    display: block;
    font-size: 0.75rem;
    color: var(--neutral-400);
    margin-top: 0.25rem;
    font-weight: 500;
}

.admin-sidebar nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0;
}

.admin-sidebar nav a {
    display: flex;
    align-items: center;
    padding: 0.625rem 1.25rem;
    color: var(--neutral-400);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
    margin: 1px 0;
}

.admin-sidebar nav a:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border-left-color: rgba(255, 255, 255, 0.2);
}

.admin-sidebar nav a.active {
    background: rgba(79, 70, 229, 0.2);
    color: #fff;
    border-left-color: var(--primary-500);
    font-weight: 600;
}

.admin-sidebar .sidebar-footer {
    flex-shrink: 0;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-sidebar .sidebar-footer a {
    color: var(--danger-500);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.admin-sidebar .sidebar-footer a:hover {
    opacity: 1;
}

/* --- Content Area --- */
.admin-content {
    flex: 1;
    padding: 1.75rem 2rem;
    background: var(--bg);
    margin-left: 240px;
    min-height: 100vh;
}

.admin-header {
    margin-bottom: 1.5rem;
}

.admin-header h1 {
    margin: 0;
    color: var(--text);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.admin-header p {
    margin: 0.25rem 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* --- Cards --- */
.card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: box-shadow var(--transition);
}

.card h2 {
    margin: 0 0 1rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

/* --- Tables --- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.admin-table th,
.admin-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--neutral-100);
}

.admin-table th {
    background: var(--neutral-50);
    font-weight: 600;
    color: var(--neutral-600);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.admin-table tr:hover {
    background: var(--neutral-50);
}

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

.admin-table .text-right {
    text-align: right;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    vertical-align: middle;
    line-height: 1.5;
    box-sizing: border-box;
    gap: 0.375rem;
    letter-spacing: -0.01em;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

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

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

.btn-success {
    background: var(--success-600);
    color: #fff;
}

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

.btn-danger {
    background: var(--danger-500);
    color: #fff;
}

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

.btn-copy {
    background: var(--neutral-200);
    color: var(--neutral-600);
    font-size: 0.8rem;
}

.btn-copy:hover {
    background: var(--neutral-300);
    color: var(--neutral-700);
}

.btn-copied {
    background: var(--success-500) !important;
    color: #fff !important;
}

.btn-open {
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    margin-left: 0.25rem;
    font-size: 0.8rem;
}

.btn-open:hover {
    background: var(--accent-hover);
    color: #fff;
}

/* --- Utility Classes --- */
.hint {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.status-ok {
    color: var(--success-600);
    font-weight: 600;
}

.init-form {
    margin-top: 1rem;
}

.form-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
}

.text-right {
    text-align: right;
}

.text-muted {
    color: var(--text-muted);
}

.text-danger {
    color: var(--danger-500);
}

.text-success {
    color: var(--success-600);
}

.small {
    font-size: 0.85rem;
}

/* --- Info Box --- */
.info-box {
    background: var(--success-50);
    border: 1px solid var(--success-500);
    color: var(--success-700);
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

/* --- Stats Grid --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-surface);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all var(--transition-fast);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.125rem;
}

/* --- Mobile Header --- */
.mobile-header {
    display: none;
    background: linear-gradient(135deg, var(--neutral-900) 0%, #162032 100%);
    color: #fff;
    height: 56px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0 1rem;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
}

.mobile-brand {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
}

.mobile-period {
    font-weight: 400;
    font-size: 0.85rem;
    opacity: 0.5;
    margin-left: 0.5rem;
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
    border-radius: 1px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Mobile Slide-in Menu --- */
.mobile-menu {
    display: none;
    position: fixed;
    top: 56px;
    right: -280px;
    width: 280px;
    height: calc(100vh - 56px);
    background: linear-gradient(180deg, var(--neutral-900) 0%, #162032 100%);
    z-index: 999;
    transition: right 0.3s var(--ease);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
}

.mobile-menu.active {
    right: 0;
}

.mobile-nav {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
}

.mobile-nav a {
    padding: 0.875rem 1.5rem;
    color: var(--neutral-300);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: all var(--transition-fast);
}

.mobile-nav a:hover,
.mobile-nav a.active {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.mobile-nav a.active {
    background: rgba(79, 70, 229, 0.2);
    border-left: 3px solid var(--primary-500);
}

.mobile-nav .nav-logout {
    color: var(--danger-500);
    margin-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: none;
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s var(--ease);
    pointer-events: none;
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* --- Responsive (Mobile) --- */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
    }

    .admin-sidebar {
        display: none;
    }

    .mobile-header {
        display: flex;
        width: 100%;
    }

    .mobile-menu {
        display: block;
    }

    .mobile-overlay {
        display: block;
        pointer-events: none;
    }

    .mobile-overlay.active {
        pointer-events: auto;
    }

    .admin-content {
        padding: 1rem;
        padding-top: calc(56px + 1rem);
        margin-left: 0;
        max-width: 100vw;
        overflow-x: auto;
    }

    .admin-header {
        margin-bottom: 1rem;
    }

    .admin-header h1 {
        font-size: 1.25rem;
    }

    .admin-header p {
        font-size: 0.85rem;
    }

    /* Table - horizontal scroll */
    .table-responsive {
        overflow-x: auto;
        margin: 0 -1rem;
        padding: 0 1rem;
    }

    .admin-table {
        min-width: 500px;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.5rem 0.75rem;
        font-size: 1rem;
    }

    /* Stats grid on mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .stat-value {
        font-size: 1.5rem;
    }

    .card {
        padding: 1rem;
        margin: 0 -0.25rem 1rem;
        border-radius: var(--radius-md);
    }
}
