/**
 * Admin Panel Modern Design System & UI Theme
 * Designed for High Usability, Professional Aesthetics & Full Cross-Browser Consistency
 * Copyright (c) 2026-2060, Arya-WR. Alrights Reserved. Written for Universitas Bung Karno
 */

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

:root {
    --primary: #6a1b1a;
    --primary-hover: #8b2c2a;
    --primary-light: #fbeee9;
    --primary-border: #f0c9c5;
    --accent: #c9a03d;
    --dark: #1e293b;
    --slate: #475569;
    --light-slate: #64748b;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --border-focus: #8b2c2a;
    --ring-focus: rgba(139, 44, 42, 0.18);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* ========== RESET & BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-page);
    color: var(--dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

/* ========== SIDEBAR NAVIGATION ========== */
.admin-sidebar {
    width: 270px;
    background: #ffffff;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
}

.sidebar-logo {
    height: 44px;
    width: auto;
}

.sidebar-title h2 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.sidebar-title span {
    font-size: 0.75rem;
    color: var(--light-slate);
    font-weight: 500;
}

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

.nav-section-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: #94a3b8;
    padding: 0.75rem 0.85rem 0.35rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.95rem;
    border-radius: var(--radius-md);
    color: #334155;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.15s ease;
    margin-bottom: 2px;
}

.nav-link i {
    width: 20px;
    font-size: 1rem;
    color: #64748b;
    transition: color 0.15s ease;
}

.nav-link:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.nav-link:hover i {
    color: var(--primary);
}

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

.nav-link.active i {
    color: #ffffff;
}

/* ========== MAIN CONTENT AREA ========== */
.admin-main {
    margin-left: 270px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

/* ========== TOPBAR ========== */
.admin-topbar {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 0.85rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--slate);
    cursor: pointer;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.lang-switch {
    display: flex;
    align-items: center;
    background: #f1f5f9;
    border-radius: 20px;
    padding: 2px;
}

.lang-switch a {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--slate);
    border-radius: 18px;
    transition: all 0.15s;
}

.lang-switch a.active {
    background: var(--primary);
    color: white;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.88rem;
    font-weight: 500;
}

.badge-role {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid var(--primary-border);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
}

/* ========== PAGE BODY & CARDS ========== */
.admin-content {
    padding: 2rem;
    flex: 1;
}

.page-header {
    margin-bottom: 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1e293b;
}

/* Dashboard stat grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: var(--primary-light);
    color: var(--primary);
}

.stat-info h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.1;
}

.stat-info p {
    font-size: 0.85rem;
    color: var(--light-slate);
    font-weight: 500;
}

/* ========== PROFESSIONAL FORM CONTROLS (REQUIREMENT 8) ========== */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.45rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
}

.form-label .required {
    color: #dc2626;
    margin-left: 2px;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    font-family: inherit;
    font-size: 0.92rem;
    color: #1e293b;
    background-color: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--ring-focus);
}

select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.1em;
    padding-right: 2.5rem;
    cursor: pointer;
}

textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

/* ========== UNIFIED CONSISTENT BUTTONS (REQUIREMENT 14) ========== */
.btn {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    white-space: nowrap;
    vertical-align: middle;
}

.btn:active {
    transform: translateY(1px);
}

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

.btn-secondary {
    background-color: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}
.btn-secondary:hover {
    background-color: #e2e8f0;
    color: #0f172a;
}

.btn-success {
    background-color: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
}
.btn-success:hover {
    background-color: #15803d;
    border-color: #15803d;
}

.btn-danger {
    background-color: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
}
.btn-danger:hover {
    background-color: #b91c1c;
    border-color: #b91c1c;
}

.btn-warning {
    background-color: #d97706;
    color: #ffffff;
    border-color: #d97706;
}
.btn-warning:hover {
    background-color: #b45309;
    border-color: #b45309;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
}

/* ========== TABLES ========== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    text-align: left;
}

.table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 0.85rem 1rem;
    border-bottom: 1.5px solid var(--border-color);
    white-space: nowrap;
}

.table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color);
    color: #334155;
    vertical-align: middle;
}

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

/* ========== ALERTS ========== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid transparent;
}

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

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

.alert-warning {
    background-color: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}

.alert-info {
    background-color: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}

/* Default password warning banner */
.security-banner {
    background: linear-gradient(135deg, #fff1f2 0%, #fee2e2 100%);
    border: 1.5px solid #f87171;
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.25rem;
    color: #991b1b;
}

.security-banner-text h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.security-banner-text p {
    font-size: 0.85rem;
    line-height: 1.4;
}

/* ========== FOOTER ========== */
.admin-footer {
    background: #ffffff;
    border-top: 1px solid var(--border-color);
    padding: 1rem 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--light-slate);
    margin-top: auto;
}

/* ========== RESPONSIVENESS ========== */
@media (max-width: 992px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.show {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .topbar-toggle {
        display: block;
    }
}

