/* ============================================================
   DESIGN SYSTEM & CSS STYLES - PENDATAAN SISWA MODERN
   ============================================================ */

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

:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #eff6ff;
    --secondary: #0f172a;
    --accent: #10b981;
    --accent-hover: #059669;
    --background: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --border-focus: #93c5fd;
    --danger: #ef4444;
    --warning: #f59e0b;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 35px -4px rgba(0, 0, 0, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

/* Background Gradients */
.bg-gradient-header {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 40px 20px 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.bg-gradient-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

/* Container Layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.form-wrapper {
    margin-top: -50px;
    margin-bottom: 60px;
    position: relative;
    z-index: 10;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    padding: 32px;
    margin-bottom: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px dashed var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.card-header .icon-box {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--secondary);
}

.card-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Form Grid & Inputs */
.form-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
}

.col-12 { grid-column: span 12; }
.col-8  { grid-column: span 8; }
.col-6  { grid-column: span 6; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }
.col-2  { grid-column: span 2; }

@media (max-width: 768px) {
    .col-8, .col-6, .col-4, .col-3, .col-2 {
        grid-column: span 12;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 4px;
}

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

.form-control, .form-select, textarea.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    color: var(--text-main);
    background-color: #f8fafc;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    outline: none;
    transition: all 0.2s ease-in-out;
}

.form-control:focus, .form-select:focus, textarea.form-control:focus {
    background-color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.form-control::placeholder {
    color: #94a3b8;
}

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

.help-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Map Container & Locate Button */
.map-box {
    position: relative;
    width: 100%;
    height: 340px;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-color);
    overflow: hidden;
    margin-top: 10px;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.btn-locate {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
    transition: all 0.25s ease;
}

.btn-locate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

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

.btn-submit {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    width: 100%;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.35);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.45);
}

/* Alert Boxes */
.alert-box {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid transparent;
}

.alert-box.success {
    background-color: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}

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

/* Admin Layout & Navigation */
.admin-navbar {
    background: var(--secondary);
    color: white;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-brand {
    font-size: 1.2rem;
    font-weight: 800;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-link {
    color: #94a3b8;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.admin-link:hover, .admin-link.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.btn-logout {
    background: #ef4444;
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: background 0.2s;
}

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

/* Admin Stats Cards */
.stat-card {
    background: white;
    padding: 24px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.stat-icon.blue { background: #eff6ff; color: #3b82f6; }
.stat-icon.green { background: #ecfdf5; color: #10b981; }
.stat-icon.purple { background: #f5f3ff; color: #8b5cf6; }

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

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

.custom-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    text-align: left;
    font-size: 0.9rem;
}

.custom-table th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 700;
    padding: 14px 16px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.custom-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    vertical-align: middle;
}

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

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    display: inline-block;
}

.badge-primary { background: #eff6ff; color: #1d4ed8; }
.badge-success { background: #ecfdf5; color: #047857; }
.badge-warning { background: #fffbeb; color: #b45309; }

/* Buttons & Badges */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
}

.btn-secondary { background: #e2e8f0; color: #334155; }
.btn-secondary:hover { background: #cbd5e1; }
.btn-danger { background: #fee2e2; color: #991b1b; }
.btn-danger:hover { background: #fca5a5; }
.btn-success { background: #d1fae5; color: #065f46; }
.btn-success:hover { background: #a7f3d0; }

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    padding: 24px;
    position: relative;
}

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

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-muted);
    cursor: pointer;
}

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

.detail-item {
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
}

.detail-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

.detail-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--secondary);
    margin-top: 2px;
}

.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.875rem;
}
