/* ═══ RESET & TOKENS ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
    --navy: #17264a;
    --navy-light: #1f3260;
    --red: #c0392b;
    --red-light: #e74c3c;
    --sand: #f4ede0;
    --white: #ffffff;
    --text-dark: #1a2340;
    --text-mid: #4a5568;
    --text-soft: #8896a8;
    --border: #e2d8c8;
    --green: #1e8449;
    --green-bg: #e8f5ed;
    --red-bg: #fdecea;
    --shadow-sm: 0 2px 8px rgba(23,38,74,0.08);
    --shadow-md: 0 6px 24px rgba(23,38,74,0.12);
    --shadow-lg: 0 16px 48px rgba(23,38,74,0.18);
    --radius: 10px;
    --radius-lg: 14px;
}
html, body { height: 100%; font-family: 'DM Sans', sans-serif; background: var(--sand); color: var(--text-dark); }

/* ═══ LOGIN ═══ */
.login-body {
    display: flex; align-items: center; justify-content: center; min-height: 100vh;
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 55%, #0f1a33 100%);
}
.login-container {
    width: 100%; max-width: 420px; padding: 20px;
}
.login-card {
    background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 36px 32px 30px;
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.login-icon {
    width: 38px; height: 38px; background: var(--red); border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 900; color: #fff; letter-spacing: -1px; flex-shrink: 0;
}
.login-brand-text { line-height: 1.2; }
.login-brand-name { font-size: 15px; font-weight: 800; color: var(--text-dark); }
.login-brand-sub { font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--text-soft); }
.login-card h2 { font-size: 17px; font-weight: 700; color: var(--text-dark); margin-bottom: 4px; }
.login-desc { font-size: 12px; color: var(--text-mid); margin-bottom: 20px; }
.login-field { margin-bottom: 15px; }
.login-field label { display: block; font-size: 11px; font-weight: 600; color: var(--text-mid); margin-bottom: 5px; }
.login-field input {
    width: 100%; padding: 10px 12px; font-size: 13px; font-family: 'DM Sans', sans-serif;
    border: 1px solid var(--border); border-radius: 8px; background: var(--sand);
    color: var(--text-dark); outline: none; transition: border-color .15s ease;
}
.login-field input:focus { border-color: var(--red); background: #fff; }
.login-btn {
    width: 100%; padding: 11px; margin-top: 6px; border: none; border-radius: 8px;
    background: var(--red); color: #fff; font-size: 13px; font-weight: 700;
    cursor: pointer; transition: background .15s ease; font-family: 'DM Sans', sans-serif;
}
.login-btn:hover { background: var(--red-light); }
.login-error {
    display: none; background: var(--red-bg); color: var(--red);
    font-size: 11.5px; font-weight: 600; padding: 8px 10px; border-radius: 7px; margin-bottom: 14px;
}
.login-error.show { display: block; }

/* ═══ DASHBOARD VIEWER ═══ */
.dashboard-body { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.dashboard-topbar {
    height: 50px; background: var(--navy); display: flex; align-items: center;
    padding: 0 20px; justify-content: space-between; flex-shrink: 0; z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-user { color: #fff; font-size: 13px; font-weight: 700; }
.topbar-role {
    color: rgba(255,255,255,0.6); font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .8px;
    background: rgba(255,255,255,0.1); padding: 3px 10px; border-radius: 20px;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-btn {
    padding: 6px 14px; border-radius: 8px; font-size: 11px; font-weight: 700;
    text-decoration: none; transition: all .15s; font-family: 'DM Sans', sans-serif;
}
.topbar-btn-admin { background: rgba(255,255,255,0.15); color: #fff; }
.topbar-btn-admin:hover { background: rgba(255,255,255,0.25); }
.topbar-btn-logout { background: var(--red); color: #fff; }
.topbar-btn-logout:hover { background: var(--red-light); }
.dashboard-frame-wrap { flex: 1; overflow: hidden; }
.dashboard-iframe { width: 100%; height: 100%; border: none; }

/* ═══ ADMIN ═══ */
.admin-body { min-height: 100vh; background: var(--sand); }
.admin-container { max-width: 800px; margin: 0 auto; padding: 30px 20px; }
.admin-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.admin-header h1 { font-size: 22px; font-weight: 800; color: var(--navy); margin-top: 8px; }
.admin-header p { font-size: 12px; color: var(--text-mid); margin-top: 2px; }
.admin-back {
    font-size: 12px; color: var(--red); text-decoration: none; font-weight: 600;
}
.admin-back:hover { text-decoration: underline; }
.admin-alert {
    padding: 12px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; margin-bottom: 20px;
}
.admin-alert-success { background: var(--green-bg); color: var(--green); }
.admin-alert-error { background: var(--red-bg); color: var(--red); }
.admin-section {
    background: #fff; border-radius: var(--radius-lg); padding: 24px; margin-bottom: 20px;
    border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.admin-section h2 { font-size: 16px; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.admin-section-desc { font-size: 12px; color: var(--text-mid); margin-bottom: 16px; }
.upload-form { display: flex; flex-direction: column; gap: 14px; }
.upload-area { position: relative; }
.upload-area input[type="file"] { position: absolute; opacity: 0; width: 100%; height: 100%; cursor: pointer; z-index: 2; }
.upload-label {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; padding: 30px; border: 2px dashed var(--border); border-radius: var(--radius);
    background: var(--sand); cursor: pointer; transition: all .15s;
}
.upload-label:hover { border-color: var(--red); background: #fff; }
.upload-icon { font-size: 32px; }
.upload-label span { font-size: 13px; color: var(--text-mid); font-weight: 600; }
.upload-hint { font-size: 11px; color: var(--text-soft); font-weight: 400 !important; }
.upload-btn {
    padding: 11px 20px; border: none; border-radius: 8px; background: var(--red); color: #fff;
    font-size: 13px; font-weight: 700; cursor: pointer; transition: background .15s;
    font-family: 'DM Sans', sans-serif;
}
.upload-btn:hover { background: var(--red-light); }
.file-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; background: var(--sand); border-radius: 8px; margin-bottom: 8px;
}
.file-card-current { border-left: 4px solid var(--green); }
.file-info { display: flex; flex-direction: column; gap: 2px; }
.file-name { font-size: 13px; font-weight: 700; color: var(--text-dark); }
.file-meta { font-size: 11px; color: var(--text-soft); }
.backup-list { display: flex; flex-direction: column; gap: 0; }
.backup-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.backup-header h2 { margin-bottom: 0; }
.file-card-backup {
    cursor: pointer; transition: background .12s;
}
.file-card-backup:hover { background: #ede3d2 !important; }
.file-card-backup.selected { background: #fdecea !important; border-left: 4px solid var(--red); }
.backup-check {
    width: 18px; height: 18px; margin-right: 14px; flex-shrink: 0;
    accent-color: var(--red); cursor: pointer;
}
.delete-btn {
    padding: 7px 16px; border: none; border-radius: 8px;
    background: var(--red); color: #fff;
    font-size: 12px; font-weight: 700; cursor: pointer;
    transition: background .15s; font-family: 'DM Sans', sans-serif;
}
.delete-btn:hover { background: var(--red-light); }

@media (max-width: 600px) {
    .admin-header { flex-direction: column; gap: 12px; }
    .admin-container { padding: 16px 12px; }
}
