/* ============================================================
   Portal Administrasi - PKBM Madina Islamic Premier School
   CSS Utama
   ============================================================ */

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

:root {
    --primary:       #047CF6;
    --primary-dark:  #0360cc;
    --primary-light: #e8f3ff;
    --secondary:     #13E5E6;
    --secondary-dark:#0ec4c5;
    --accent:        #FF6B35;
    --success:       #10B981;
    --warning:       #F59E0B;
    --danger:        #EF4444;
    --info:          #6366F1;

    --text-dark:     #0F172A;
    --text-body:     #334155;
    --text-muted:    #64748B;
    --text-light:    #94A3B8;

    --bg-page:       #F1F5F9;
    --bg-card:       #FFFFFF;
    --bg-glass:      rgba(255,255,255,0.8);

    --border:        rgba(148,163,184,0.2);
    --border-focus:  rgba(4,124,246,0.4);

    --gradient-main: linear-gradient(135deg, #047CF6 0%, #13E5E6 100%);
    --gradient-dark: linear-gradient(135deg, #0F172A 0%, #1E3A5F 100%);
    --gradient-card: linear-gradient(135deg, rgba(4,124,246,0.05) 0%, rgba(19,229,230,0.05) 100%);

    --shadow-sm:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md:     0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg:     0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
    --shadow-xl:     0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.04);
    --shadow-glow:   0 0 30px rgba(4,124,246,0.15);
    --shadow-btn:    0 4px 15px rgba(4,124,246,0.35);
    --shadow-btn-hover: 0 8px 25px rgba(4,124,246,0.45);

    --radius-sm:     8px;
    --radius-md:     12px;
    --radius-lg:     16px;
    --radius-xl:     24px;
    --radius-full:   9999px;

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

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
    background: var(--bg-page);
    color: var(--text-body);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: -300px;
    left: -300px;
    width: 700px;
    height: 700px;
    background: var(--gradient-main);
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.07;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    bottom: -300px;
    right: -300px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(19,229,230,0.12) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.portal-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
}

.container-wide {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ============================================================
   HEADER PORTAL
   ============================================================ */
.portal-header {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.portal-header-inner {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.portal-header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.portal-header-logo {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--gradient-main);
    padding: 2px;
}

.portal-header-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.2;
}

.portal-header-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 400;
}

.portal-header-nav a {
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ============================================================
   HERO SECTION (halaman utama)
   ============================================================ */
.hero-section {
    padding: 3rem 1rem 1.5rem;
    text-align: center;
}

.hero-logo-wrap {
    width: 110px;
    height: 110px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.hero-logo-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: var(--gradient-main);
    opacity: 0.15;
    animation: pulse-ring 3s ease-in-out infinite;
}

@keyframes pulse-ring {
    0%, 100% { transform: scale(1); opacity: 0.15; }
    50% { transform: scale(1.08); opacity: 0.25; }
}

.hero-logo {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(4,124,246,0.15);
    position: relative;
    z-index: 1;
    background: white;
}

.hero-logo-placeholder {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: var(--gradient-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: white;
    border: 3px solid white;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.hero-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.3;
    margin-bottom: 0.4rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--gradient-main);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.9rem;
    border-radius: var(--radius-full);
    margin-bottom: 0.75rem;
    letter-spacing: 0.3px;
}

.hero-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    max-width: 380px;
    margin: 0 auto;
}

/* ============================================================
   SECTION DIVIDER
   ============================================================ */
.section-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0 0.75rem;
    padding: 0 0.25rem;
}

.section-label-text {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

.section-label-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ============================================================
   LAYANAN BUTTONS GRID
   ============================================================ */
.layanan-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.875rem;
    padding: 0 0 1rem;
}

@media (min-width: 480px) {
    .layanan-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Card Layanan */
.layanan-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.layanan-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-card);
    opacity: 0;
    transition: var(--transition);
}

.layanan-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    border-color: rgba(4,124,246,0.3);
}

.layanan-card:hover::before {
    opacity: 1;
}

.layanan-card:active {
    transform: translateY(-1px);
}

/* Icon wrapper */
.layanan-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.5rem;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}

.layanan-card:hover .layanan-icon {
    transform: scale(1.1);
}

.layanan-icon.blue   { background: linear-gradient(135deg, #EFF6FF, #DBEAFE); color: #2563EB; }
.layanan-icon.cyan   { background: linear-gradient(135deg, #ECFEFF, #CFFAFE); color: #0891B2; }
.layanan-icon.green  { background: linear-gradient(135deg, #ECFDF5, #D1FAE5); color: #059669; }
.layanan-icon.orange { background: linear-gradient(135deg, #FFF7ED, #FED7AA); color: #EA580C; }
.layanan-icon.purple { background: linear-gradient(135deg, #F5F3FF, #EDE9FE); color: #7C3AED; }
.layanan-icon.pink   { background: linear-gradient(135deg, #FFF1F2, #FFE4E6); color: #E11D48; }

.layanan-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

.layanan-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.layanan-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.layanan-arrow {
    color: var(--text-light);
    transition: var(--transition);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.layanan-card:hover .layanan-arrow {
    color: var(--primary);
    transform: translateX(3px);
}

/* SOP badge */
.sop-badge {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 5;
    background: rgba(4,124,246,0.1);
    color: var(--primary);
    border: 1px solid rgba(4,124,246,0.2);
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.sop-badge:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Status badge */
.layanan-status {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.layanan-status.ext {
    background: rgba(16,185,129,0.1);
    color: var(--success);
    border: 1px solid rgba(16,185,129,0.2);
}

/* ============================================================
   MODAL SOP
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-slow);
}

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

.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    transform: scale(0.92) translateY(20px);
    transition: var(--transition-slow);
}

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

.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.modal-header-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.modal-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    flex: 1;
}

.modal-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

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

.modal-close:hover {
    background: var(--bg-page);
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
}

/* Flowchart SOP */
.sop-flow {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sop-step {
    display: flex;
    gap: 1rem;
    position: relative;
}

.sop-step-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.sop-step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gradient-main);
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(4,124,246,0.3);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.sop-step-line {
    width: 2px;
    flex: 1;
    background: linear-gradient(to bottom, rgba(4,124,246,0.3), rgba(19,229,230,0.3));
    margin: 4px 0;
    min-height: 20px;
}

.sop-step:last-child .sop-step-line {
    display: none;
}

.sop-step-content {
    padding: 0 0 1.25rem 0;
    flex: 1;
}

.sop-step-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    padding-top: 0.4rem;
}

.sop-step-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.sop-step-icon {
    font-size: 1rem;
    margin-right: 0.35rem;
}

.modal-footer {
    padding: 0 1.5rem 1.5rem;
}

.btn-modal-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.875rem;
    background: var(--gradient-main);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-btn);
}

.btn-modal-action:hover {
    box-shadow: var(--shadow-btn-hover);
    transform: translateY(-1px);
    color: white;
}

/* ============================================================
   FOOTER PORTAL
   ============================================================ */
.portal-footer {
    margin-top: auto;
    padding: 1.5rem 1rem;
    text-align: center;
    border-top: 1px solid var(--border);
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
}

.portal-footer-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.portal-footer-wa {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--success);
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.2);
    transition: var(--transition);
}

.portal-footer-wa:hover {
    background: rgba(16,185,129,0.15);
}

.portal-footer-copy {
    font-size: 0.72rem;
    color: var(--text-light);
    margin-top: 0.75rem;
}

/* ============================================================
   FORM PAGES
   ============================================================ */
.page-wrapper {
    max-width: 640px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.page-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1.25rem;
    transition: var(--transition);
}

.page-back:hover { color: var(--primary); }

/* Hero card di halaman form */
.form-hero {
    background: var(--gradient-main);
    border-radius: var(--radius-xl);
    padding: 1.75rem 1.5rem;
    color: white;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.form-hero::after {
    content: '';
    position: absolute;
    right: -30px;
    top: -30px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.form-hero-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    display: block;
    position: relative;
    z-index: 1;
}

.form-hero-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    position: relative;
    z-index: 1;
}

.form-hero-desc {
    font-size: 0.85rem;
    opacity: 0.85;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

/* SOP inline mini */
.sop-inline {
    background: linear-gradient(135deg, rgba(4,124,246,0.04), rgba(19,229,230,0.04));
    border: 1px solid rgba(4,124,246,0.1);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.sop-inline-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sop-inline-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.sop-inline-step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-body);
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.7rem;
}

.sop-inline-step span {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.7rem;
    background: var(--primary-light);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Form Card */
.form-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 1rem;
}

.form-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-group {
    margin-bottom: 1.1rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
}

.form-label .req {
    color: var(--danger);
    margin-left: 2px;
}

.form-label .opt {
    color: var(--text-light);
    font-weight: 400;
    font-size: 0.78rem;
    margin-left: 4px;
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    background: var(--bg-page);
    border: 1.5px solid rgba(148,163,184,0.25);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: var(--text-dark);
    font-family: 'Inter', sans-serif;
    transition: var(--transition);
    outline: none;
    line-height: 1.5;
}

.form-control:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(4,124,246,0.08);
}

.form-control::placeholder {
    color: var(--text-light);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748B'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.1rem;
    padding-right: 2.5rem;
}

/* Error alert */
.alert {
    padding: 0.875rem 1.1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
}

.alert-error {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    color: #DC2626;
}

.alert-success {
    background: rgba(16,185,129,0.08);
    border: 1px solid rgba(16,185,129,0.2);
    color: #059669;
}

.alert ul {
    padding-left: 1rem;
    margin: 0;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
    line-height: 1;
}

.btn-primary {
    background: var(--gradient-main);
    color: white;
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
    box-shadow: var(--shadow-btn-hover);
    transform: translateY(-2px);
    color: white;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--border);
    color: var(--text-body);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

.btn-wa {
    background: #25D366;
    color: white;
    box-shadow: 0 4px 15px rgba(37,211,102,0.3);
}

.btn-wa:hover {
    background: #1da851;
    box-shadow: 0 8px 25px rgba(37,211,102,0.4);
    transform: translateY(-2px);
    color: white;
}

.btn-print {
    background: var(--text-dark);
    color: white;
}

.btn-print:hover {
    background: #1E293B;
    color: white;
    transform: translateY(-2px);
}

/* ============================================================
   CETAK / PRINT
   ============================================================ */
.cetak-page {
    min-height: 100vh;
    background: #F8FAFC;
    padding: 2rem 1rem;
    font-family: 'Inter', sans-serif;
}

.cetak-actions {
    max-width: 700px;
    margin: 0 auto 1.5rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cetak-document {
    max-width: 700px;
    margin: 0 auto;
    background: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    border: 1px solid var(--border);
}

.cetak-header {
    background: var(--gradient-main);
    padding: 1.75rem 2rem;
    color: white;
    text-align: center;
    position: relative;
}

.cetak-header-logo {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.7);
    object-fit: cover;
    margin-bottom: 0.75rem;
    background: white;
}

.cetak-header-school {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
}

.cetak-header-type {
    font-size: 0.75rem;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cetak-header-doc-title {
    font-size: 0.95rem;
    font-weight: 700;
    background: rgba(255,255,255,0.15);
    display: inline-block;
    padding: 0.3rem 1rem;
    border-radius: var(--radius-full);
    margin-top: 0.75rem;
}

.cetak-body {
    padding: 2rem;
}

.cetak-no {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    padding: 0.5rem;
    background: var(--bg-page);
    border-radius: var(--radius-sm);
}

.cetak-no strong {
    color: var(--primary);
    font-size: 1rem;
    display: block;
    margin-top: 0.25rem;
    letter-spacing: 1px;
}

.cetak-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    margin-left: 0.5rem;
}

.cetak-status.menunggu { background: rgba(245,158,11,0.1); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }
.cetak-status.diproses { background: rgba(99,102,241,0.1); color: var(--info); border: 1px solid rgba(99,102,241,0.2); }
.cetak-status.selesai  { background: rgba(16,185,129,0.1); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }

.cetak-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

.cetak-table tr {
    border-bottom: 1px solid var(--border);
}

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

.cetak-table td {
    padding: 0.7rem 0.5rem;
    vertical-align: top;
}

.cetak-table td:first-child {
    color: var(--text-muted);
    width: 38%;
    font-weight: 500;
}

.cetak-table td:nth-child(2) {
    color: var(--text-muted);
    width: 4%;
}

.cetak-table td:last-child {
    color: var(--text-dark);
    font-weight: 600;
}

.cetak-note {
    background: rgba(245,158,11,0.06);
    border: 1px solid rgba(245,158,11,0.15);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.82rem;
    color: var(--text-body);
    line-height: 1.6;
}

.cetak-note strong {
    color: var(--warning);
    display: block;
    margin-bottom: 0.25rem;
}

.cetak-wa-section {
    background: linear-gradient(135deg, rgba(37,211,102,0.05), rgba(37,211,102,0.08));
    border: 1px solid rgba(37,211,102,0.2);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.cetak-wa-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.35rem;
}

.cetak-wa-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.cetak-footer-doc {
    border-top: 1px dashed var(--border);
    padding-top: 1.25rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-light);
}

/* ============================================================
   ADMIN PANEL
   ============================================================ */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 240px;
    background: var(--gradient-dark);
    color: white;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 200;
}

.admin-sidebar-brand {
    padding: 0 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 1rem;
}

.admin-sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.5rem;
}

.admin-sidebar-school {
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    line-height: 1.3;
}

.admin-sidebar-tag {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.5);
    margin-top: 0.1rem;
}

.admin-nav-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
    padding: 0 1.25rem;
    margin-bottom: 0.4rem;
    margin-top: 1rem;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.25rem;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
    position: relative;
}

.admin-nav-item:hover {
    color: white;
    background: rgba(255,255,255,0.06);
}

.admin-nav-item.active {
    color: white;
    background: rgba(255,255,255,0.1);
    border-left-color: var(--secondary);
}

.admin-nav-icon {
    width: 18px;
    text-align: center;
    font-size: 1rem;
}

.admin-nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-main {
    margin-left: 240px;
    flex: 1;
    min-height: 100vh;
    background: var(--bg-page);
}

.admin-topbar {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-page-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
}

.admin-content {
    padding: 1.75rem;
}

/* Stat Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -15px;
    right: -15px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.05;
}

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

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stat-card.blue { color: var(--primary); }
.stat-card.green { color: var(--success); }
.stat-card.orange { color: var(--accent); }
.stat-card.purple { color: var(--info); }
.stat-card.cyan { color: var(--secondary-dark); }
.stat-card.red { color: var(--danger); }

/* Table Admin */
.table-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

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

.table-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table thead th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-page);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-body);
    vertical-align: middle;
}

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

.data-table tbody tr:hover td {
    background: var(--bg-page);
}

/* Status badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-menunggu { background: rgba(245,158,11,0.1); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }
.badge-diproses { background: rgba(99,102,241,0.1); color: var(--info); border: 1px solid rgba(99,102,241,0.2); }
.badge-selesai  { background: rgba(16,185,129,0.1); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }
.badge-ditolak  { background: rgba(239,68,68,0.1); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.badge-baru     { background: rgba(239,68,68,0.1); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.badge-dibaca   { background: rgba(245,158,11,0.1); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }
.badge-ditindaklanjuti { background: rgba(16,185,129,0.1); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }

/* Dropdown status update */
.status-form {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.status-select {
    padding: 0.35rem 0.6rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-body);
    background: white;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-sm-primary {
    background: var(--primary);
    color: white;
}

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

.btn-sm-wa {
    background: #25D366;
    color: white;
}

.btn-sm-wa:hover { background: #1da851; }

/* Login page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    background: var(--gradient-dark);
}

.login-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-xl);
}

.login-logo-wrap {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-logo {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin-bottom: 0.75rem;
}

.login-school {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
}

.login-panel-tag {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.2rem 0.7rem;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-top: 0.4rem;
    font-weight: 600;
}

/* Aspirasi sukses */
.sukses-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.sukses-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce-in 0.6s ease;
}

@keyframes bounce-in {
    0% { transform: scale(0); }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.sukses-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.sukses-desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* ============================================================
   PRINT MEDIA
   ============================================================ */
@media print {
    .cetak-actions { display: none !important; }
    .cetak-page { background: white; padding: 0; }
    .cetak-document {
        box-shadow: none;
        border-radius: 0;
        border: none;
        max-width: 100%;
    }
    body::before, body::after { display: none; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 200px;
    }
    .admin-main {
        margin-left: 200px;
    }
    .admin-content {
        padding: 1.25rem;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: var(--transition);
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .hero-title {
        font-size: 1.3rem;
    }
    .form-card {
        padding: 1.25rem;
    }
}
