/* ==========================================================================
   PORTAL & USER MANAGER HOTSPOT - MAN 1 JEMBER
   Tema: Modern Madrasah Emerald Green & Gold Accent
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #059669;        /* Emerald Green Utama */
    --primary-dark: #047857;   /* Emerald Gelap */
    --primary-darker: #064e3b; /* Forest Green Madrasah */
    --primary-light: #10b981;  /* Light Emerald */
    --primary-soft: #ecfdf5;   /* Soft Green Background */
    --primary-glow: rgba(5, 150, 105, 0.25);
    
    --gold: #d97706;           /* Aksen Emas Madrasah */
    --gold-light: #fef3c7;
    --gold-dark: #b45309;

    --surface: #ffffff;
    --bg: #f4f7f6;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --border-light: #f1f5f9;

    --text: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --shadow: 0 10px 25px -5px rgba(4, 120, 87, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 35px -10px rgba(4, 120, 87, 0.15), 0 10px 15px -5px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(5, 150, 105, 0.35);

    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Background Ornament */
.madrasah-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    background: 
        radial-gradient(circle at 10% 20%, rgba(5, 150, 105, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(217, 119, 6, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.03) 0%, transparent 60%);
}

/* ==========================================================================
   NAVIGATION & APP BAR
   ========================================================================== */
.app-bar {
    background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary-dark) 60%, var(--primary) 100%);
    color: #ffffff;
    padding: 12px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: #ffffff;
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #ffffff;
    padding: 4px;
    object-fit: contain;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: var(--transition);
}

.brand:hover .brand-logo {
    transform: scale(1.05);
}

.brand-text h1 {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.2px;
    line-height: 1.2;
}

.brand-text p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
}

.user-badge strong {
    color: #fef08a;
}

.role-pill {
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.role-pill.admin {
    background: #fef08a;
    color: #854d0e;
}

.role-pill.staff {
    background: #d1fae5;
    color: #065f46;
}

/* ==========================================================================
   HERO / PORTAL HOMEPAGE HEADER
   ========================================================================== */
.portal-hero {
    background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary-dark) 50%, var(--primary) 100%);
    color: #ffffff;
    padding: 44px 20px 58px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.portal-hero::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 30px;
    background: var(--bg);
    clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-content {
    max-width: 820px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 6px 16px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 600;
    color: #d1fae5;
    margin-bottom: 16px;
}

.hero-pill .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #34d399;
    box-shadow: 0 0 10px #34d399;
    animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.hero-title span {
    color: #fef08a;
}

.hero-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 680px;
    margin: 0 auto 12px;
    font-weight: 400;
}

/* ==========================================================================
   CONTAINER & LAYOUT
   ========================================================================== */
.container {
    max-width: 1200px;
    margin: -18px auto 40px;
    padding: 0 20px;
    position: relative;
    z-index: 10;
}

.container-admin {
    margin-top: 24px;
}

/* ==========================================================================
   PORTAL TABS & CARDS
   ========================================================================== */
.portal-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    position: relative;
    z-index: 20;
}

.tab-btn {
    background: #ffffff;
    border: 1.5px solid var(--border);
    padding: 10px 22px;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary);
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.1);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #ffffff;
    border-color: var(--primary-dark);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.28);
}

.tab-panel {
    display: none;
    animation: fadeIn 0.35s ease;
}

.tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Card Surface */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 24px;
    position: relative;
}

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

.card-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ==========================================================================
   STAT CARDS (ADMIN & PORTAL)
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 26px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--primary);
}

.stat-card.c-primary::before { background: var(--primary); }
.stat-card.c-success::before { background: var(--success); }
.stat-card.c-warning::before { background: var(--warning); }
.stat-card.c-danger::before { background: var(--danger); }
.stat-card.c-gold::before { background: var(--gold); }
.stat-card.c-info::before { background: var(--info); }

.stat-info .label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.stat-info .value {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}

.stat-info .hint {
    font-size: 0.74rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.stat-icon {
    font-size: 1.8rem;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-soft);
}

.stat-card.c-warning .stat-icon { background: #fef3c7; }
.stat-card.c-danger .stat-icon { background: #fee2e2; }
.stat-card.c-gold .stat-icon { background: #fef9c3; }
.stat-card.c-info .stat-icon { background: #dbeafe; }

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: var(--transition);
    line-height: 1.2;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary-dark) 100%);
    box-shadow: 0 6px 18px var(--primary-glow);
    color: #ffffff;
}

.btn-secondary {
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg);
    border-color: var(--text-muted);
}

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

.btn-success:hover {
    background: #059669;
}

.btn-warning {
    background: var(--warning);
    color: #ffffff;
}

.btn-warning:hover {
    background: #d97706;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-gold {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
    color: #ffffff;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 13px 26px;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

.btn-block {
    width: 100%;
}

.btn-nav-action {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-nav-action:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.25);
    color: #fee2e2;
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.9);
    color: #ffffff;
    border-color: rgba(239, 68, 68, 0.9);
}

/* Icon Buttons */
.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
    text-decoration: none;
}

.icon-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-soft);
}

.icon-btn.icon-del:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: #fee2e2;
}

.icon-btn.icon-edit:hover {
    border-color: var(--gold);
    color: var(--gold-dark);
    background: #fef3c7;
}

.icon-btn.icon-copy:hover {
    border-color: #25d366;
    color: #047857;
    background: #ecfdf5;
}

/* ==========================================================================
   PASSWORD MASKING & TOGGLE PEEK
   ========================================================================== */
.pass-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    padding: 3px 8px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.85rem;
    vertical-align: middle;
}

.pass-masked {
    letter-spacing: 2px;
    color: var(--text-muted);
    user-select: none;
    font-weight: 700;
}

.pass-plain {
    color: var(--text);
    font-weight: 700;
}

.btn-toggle-pass {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: 4px;
    transition: var(--transition);
}

.btn-toggle-pass:hover {
    color: var(--primary);
    background: rgba(5, 150, 105, 0.12);
}

/* Custom Checkbox & Bulk Actions */
.custom-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary);
}

.bulk-action-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fef2f2;
    border: 1.5px solid #fecaca;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    animation: fadeIn 0.2s ease;
}

.bulk-action-wrap span {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--danger);
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-group {
    margin-bottom: 18px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group label .req {
    color: var(--danger);
}

.form-control,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 11px 16px;
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--text);
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    transition: var(--transition);
    outline: none;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .form-row { grid-template-columns: 1fr; }
}

.input-with-btn {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.input-with-btn input {
    flex: 1;
    height: 48px;
    font-size: 0.95rem;
}

.input-with-btn .btn {
    height: 48px;
    padding: 0 22px;
    font-size: 0.92rem;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

@media (max-width: 500px) {
    .input-with-btn {
        flex-direction: column;
    }
    .input-with-btn .btn {
        width: 100%;
    }
}

.input-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==========================================================================
   STUDENT VERIFICATION & AUTOCOMPLETE SEARCH (ALA JURNAL PEMBELAJARAN)
   ========================================================================== */
.step-num-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    margin-right: 6px;
    flex-shrink: 0;
    vertical-align: middle;
}

.search-suggest-wrap {
    position: relative;
    width: 100%;
}

.portal-search-box {
    position: relative;
    width: 100%;
}

.portal-search-box .portal-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    pointer-events: none;
    width: 18px;
    height: 18px;
}

.portal-search-box input {
    height: 48px;
    padding: 0 16px 0 44px;
    font-size: 0.95rem;
    border-radius: var(--radius-sm);
    width: 100%;
    background: #ffffff;
    border: 1.5px solid var(--border);
    transition: var(--transition);
}

.portal-search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-suggest-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1.5px solid #10b981;
    border-radius: var(--radius);
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.18);
    max-height: 280px;
    overflow-y: auto;
    z-index: 100;
}

.suggest-item {
    padding: 11px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: var(--transition);
}

.suggest-item:last-child {
    border-bottom: none;
}

.suggest-item:hover,
.suggest-item.active {
    background: #ecfdf5;
}

.suggest-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.suggest-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
}

.suggest-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    gap: 8px;
}

.suggest-status {
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.student-verified-card {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 2px solid #10b981;
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    position: relative;
    box-shadow: 0 10px 25px -5px rgba(16, 185, 129, 0.15);
    animation: fadeIn 0.3s ease;
}

.student-verified-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.student-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.student-details h4 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-darker);
    line-height: 1.2;
    margin-bottom: 2px;
}

.student-details p {
    font-size: 0.84rem;
    color: var(--primary-dark);
    font-weight: 600;
}

.btn-remove-selected {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #cbd5e1;
    color: #64748b;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-remove-selected:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* Password Input with Peek Button */
.input-eye-wrap {
    position: relative;
    width: 100%;
}

.input-eye-wrap input {
    padding-right: 42px;
}

.input-eye-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition);
}

.input-eye-btn:hover {
    color: var(--primary);
}

/* ==========================================================================
   SUCCESS TICKET CARD & TIMELINE TRACKER
   ========================================================================== */
.ticket-card {
    background: #ffffff;
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 26px 24px;
    margin-bottom: 24px;
    box-shadow: 0 15px 35px -5px rgba(5, 150, 105, 0.2);
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.ticket-icon {
    width: 58px;
    height: 58px;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 12px;
}

.ticket-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--primary-darker);
    margin-bottom: 6px;
}

.ticket-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto 18px;
    line-height: 1.5;
}

.ticket-box {
    background: #ecfdf5;
    border: 1.5px dashed var(--primary);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    max-width: 420px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ticket-code-val {
    font-family: monospace;
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--primary-darker);
    letter-spacing: 1px;
}

.ticket-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    text-align: left;
    margin-bottom: 18px;
    font-size: 0.82rem;
}

@media (max-width: 600px) {
    .ticket-grid {
        grid-template-columns: 1fr;
    }
}

.ticket-grid .label {
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 2px;
}

.ticket-grid .val {
    font-weight: 800;
    color: var(--text);
}

/* Timeline Progress Tracker */
.timeline-tracker {
    margin: 24px 0 10px;
    padding: 0 8px;
    text-align: left;
}

.timeline-step {
    display: flex;
    gap: 16px;
    position: relative;
    padding-bottom: 20px;
}

.timeline-step:last-child {
    padding-bottom: 0;
}

.timeline-step::before {
    content: '';
    position: absolute;
    left: 17px;
    top: 36px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-step:last-child::before {
    display: none;
}

.timeline-step.completed::before {
    background: var(--primary);
}

.step-marker {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 2px solid #cbd5e1;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    flex-shrink: 0;
    z-index: 2;
}

.timeline-step.completed .step-marker {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.timeline-step.active .step-marker {
    background: var(--gold);
    border-color: var(--gold-dark);
    color: #ffffff;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}

.timeline-step.rejected .step-marker {
    background: var(--danger);
    border-color: var(--danger);
    color: #ffffff;
}

.step-info h5 {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 2px;
}

.step-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.step-info .step-date {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 4px;
    display: block;
}

/* ==========================================================================
   TABLES & TOOLBAR (SINGLE LINE 1-BARIS)
   ========================================================================== */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: nowrap;
    width: 100%;
}

.filters-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    flex-wrap: nowrap;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: nowrap;
}

.search-box {
    position: relative;
    flex: 1 1 200px;
    min-width: 150px;
    max-width: 280px;
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-box input {
    height: 38px;
    padding: 0 14px 0 36px;
    border-radius: var(--radius-full);
    font-size: 0.84rem;
    width: 100%;
}

.filter-select {
    height: 38px;
    padding: 0 28px 0 12px;
    border-radius: var(--radius-full);
    font-size: 0.83rem;
    width: auto;
    max-width: 150px;
    flex-shrink: 0;
    background-color: #ffffff;
    cursor: pointer;
}

.toolbar-btn {
    height: 38px;
    padding: 0 14px;
    font-size: 0.82rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
}

.bulk-action-wrap {
    height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fef2f2;
    border: 1.5px solid #fecaca;
    padding: 0 10px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    animation: fadeIn 0.2s ease;
}

.bulk-action-wrap span {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--danger);
    white-space: nowrap;
}

.bulk-action-wrap .btn {
    height: 28px;
    padding: 0 10px;
    font-size: 0.76rem;
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
}

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

thead th {
    background: #f8fafc;
    color: var(--text);
    padding: 12px 16px;
    font-weight: 700;
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
    color: var(--text);
}

tbody tr:hover {
    background: #f8fafc;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-green { background: #d1fae5; color: #065f46; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }
.badge-gray { background: #f1f5f9; color: #475569; }
.badge-gold { background: #fef08a; color: #854d0e; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-admin { background: #ede9fe; color: #5b21b6; border: 1px solid #ddd6fe; }
.badge-staff { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

/* ==========================================================================
   PAGINATION
   ========================================================================== */
.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pagination-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-left select {
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    width: auto;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

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

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==========================================================================
   MODAL DIALOG (SMOOTH POPUP)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.92) translateY(10px);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-dialog.modal-lg {
    max-width: 720px;
}

.modal-overlay.active .modal-dialog {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    transition: var(--transition);
}

.modal-close:hover {
    background: #fee2e2;
    color: var(--danger);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    background: #f8fafc;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px 18px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 440px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease;
    border-left: 5px solid var(--primary);
    font-size: 0.88rem;
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--info); }

.toast-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.toast-msg {
    flex: 1;
    color: var(--text);
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   FAQ & PANDUAN CARDS
   ========================================================================== */
.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.guide-step-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    position: relative;
    transition: var(--transition);
}

.guide-step-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.guide-step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    margin-bottom: 14px;
}

.guide-step-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.guide-step-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Footer */
.portal-footer {
    text-align: center;
    padding: 30px 20px 40px;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.portal-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ffffff;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .app-bar {
        padding: 10px 16px;
    }
    .hero-title {
        font-size: 1.7rem;
    }
    .container {
        padding: 0 14px;
    }
    .table-toolbar {
        overflow-x: auto;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }
    .table-toolbar::-webkit-scrollbar {
        height: 4px;
    }
    .table-toolbar::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 4px;
    }