/* ============================================================
   PIMS - Personnel Information Management System
   Custom Stylesheet (Replaces Tailwind CSS)
   ============================================================ */

/* ---------- CSS Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-950: #020617;
    --bg-900: #0f172a;
    --bg-850: #141f38;
    --bg-800: #1e293b;
    --bg-750: #263449;
    --border: #1e293b;
    --border-light: #334155;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --amber: #f59e0b;
    --amber-dark: #d97706;
    --amber-light: #fbbf24;
    --emerald: #10b981;
    --red: #ef4444;
    --blue: #3b82f6;
    --purple: #8b5cf6;
    --pink: #ec4899;
    --radius: 12px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --shadow: 0 10px 30px rgba(0,0,0,0.4);
    --shadow-lg: 0 20px 50px rgba(0,0,0,0.5);
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-950);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--amber); color: var(--bg-950); }

img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; font-size: 0.875rem; }

.hidden { display: none !important; }
.text-right { text-align: right; }
.text-amber { color: var(--amber); }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.stack { display: flex; flex-direction: column; gap: 2rem; }
.stack-sm { display: flex; flex-direction: column; gap: 1rem; }
.muted-text { color: var(--text-muted); font-size: 0.75rem; line-height: 1.6; }
.req { color: var(--red); }

/* ---------- Header ---------- */
.site-header {
    background: rgba(15, 23, 42, 0.92);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(12px);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    gap: 1rem;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-lg);
    background: rgba(245, 158, 11, 0.1);
    color: var(--amber);
    border: 1px solid rgba(245, 158, 11, 0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 5px 20px rgba(120, 53, 15, 0.5);
}
.brand-text h1 {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #fff;
    display: flex; align-items: center; gap: 0.5rem;
    flex-wrap: wrap;
}
.brand-text p { font-size: 0.7rem; color: var(--text-muted); }
.version-badge {
    font-size: 0.625rem;
    background: rgba(245, 158, 11, 0.2);
    color: var(--amber-light);
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-weight: 600;
    border: 1px solid rgba(245, 158, 11, 0.3);
    text-transform: none;
    letter-spacing: 0;
}
.nav-controls { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.logged-in-label { font-size: 0.75rem; color: #cbd5e1; }
.logged-in-label strong { color: var(--amber); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.1rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
    text-decoration: none;
}
.btn-primary {
    background: var(--amber);
    color: var(--bg-950);
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.25);
}
.btn-primary:hover { background: var(--amber-light); }
.btn-secondary {
    background: var(--bg-800);
    color: #cbd5e1;
    border-color: var(--border-light);
}
.btn-secondary:hover { background: var(--bg-750); }
.btn-danger {
    background: rgba(69, 10, 10, 0.6);
    color: #fca5a5;
    border-color: #991b1b;
}
.btn-danger:hover { background: #7f1d1d; color: #fff; }
.btn-outline-amber {
    background: transparent;
    color: var(--amber);
    border-color: rgba(245, 158, 11, 0.4);
}
.btn-outline-amber:hover { background: rgba(245, 158, 11, 0.15); }
.btn-success {
    background: #059669;
    color: #fff;
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.3);
}
.btn-success:hover { background: #10b981; }
.btn-lg { padding: 0.9rem 1.6rem; font-size: 0.85rem; border-radius: 16px; }
.btn-block { width: 100%; padding: 0.9rem; }
.btn-tiny { padding: 0.35rem 0.7rem; font-size: 0.65rem; background: var(--bg-800); color: #cbd5e1; border: 1px solid var(--border-light); border-radius: 8px; }
.btn-tiny:hover { background: var(--bg-750); }
.btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn.active { background: var(--amber) !important; color: var(--bg-950) !important; }

/* ---------- Main Content ---------- */
.main-content { flex: 1; padding: 2.5rem 1rem; width: 100%; }
.view { display: flex; flex-direction: column; gap: 2rem; }

/* ---------- Landing Splash ---------- */
.landing-splash {
    max-width: 640px;
    margin: 5rem auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
.splash-icon {
    width: 96px; height: 96px;
    margin: 0 auto;
    border-radius: var(--radius-xl);
    background: rgba(245, 158, 11, 0.1);
    color: var(--amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
    box-shadow: var(--shadow-lg);
}
.splash-text h2 { font-size: 1.9rem; font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.splash-text p { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.75rem; line-height: 1.7; }
.splash-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; padding-top: 1rem; }

/* ---------- Panels ---------- */
.panel {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}
.page-header-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    background: linear-gradient(120deg, #0f172a, #0f172a 60%, #020617);
}
.page-header-panel h2 { font-size: 1.25rem; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.page-header-panel p { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.35rem; max-width: 640px; line-height: 1.6; }
.info-chip {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--amber);
    white-space: nowrap;
}

/* ---------- Sections ---------- */
.section-panel { display: flex; flex-direction: column; gap: 1.5rem; }
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.section-header h3 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--amber);
    display: flex; align-items: center; gap: 0.5rem;
}
.tag {
    font-size: 0.7rem;
    background: var(--bg-800);
    color: #cbd5e1;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-weight: 500;
}

/* ---------- Photo Section ---------- */
.photo-row { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.photo-frame {
    width: 160px; height: 160px;
    border-radius: var(--radius-lg);
    background: var(--bg-950);
    border: 2px dashed var(--border-light);
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}
.photo-frame img, .photo-frame video {
    width: 100%; height: 100%; object-fit: cover;
    position: absolute; inset: 0;
}
.photo-controls { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 1rem; }

/* ---------- Form Grid ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.col-span-2 { grid-column: span 2; }
.col-span-3 { grid-column: span 3; }

label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #cbd5e1;
    margin-bottom: 0.5rem;
}
.label-amber { color: var(--amber) !important; }
.label-muted { color: var(--text-muted) !important; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.7rem; }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-950);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--amber);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}
textarea { resize: vertical; min-height: 60px; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1rem center; padding-right: 2.5rem; }
.input-amber { border-color: rgba(245, 158, 11, 0.5) !important; }

/* ---------- Radio Cards ---------- */
.radio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}
.radio-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem;
    background: var(--bg-950);
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    margin: 0;
}
.radio-card:hover { border-color: rgba(245, 158, 11, 0.5); }
.radio-card input[type="radio"] {
    width: auto;
    accent-color: var(--amber);
    cursor: pointer;
}
.radio-card span { font-size: 0.75rem; font-weight: 500; color: var(--text); }

/* ---------- Unit Blocks ---------- */
.unit-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.unit-block { display: flex; flex-direction: column; gap: 0.75rem; }
.unit-block label { margin-bottom: 0; }
.unit-block label + input { margin-top: -0.25rem; }

.form-actions { display: flex; justify-content: flex-end; padding-top: 1rem; }

/* ---------- Success Banner ---------- */
.success-banner {
    background: rgba(6, 78, 59, 0.6);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: var(--radius-xl);
    padding: 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    box-shadow: var(--shadow-lg);
}
.success-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--emerald);
    color: var(--bg-950);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.4);
}
.success-banner h2 { font-size: 1.1rem; font-weight: 700; color: #6ee7b7; }
.success-banner p { font-size: 0.8rem; color: #cbd5e1; }

/* ---------- ID Card ---------- */
.id-card {
    max-width: 780px;
    margin: 0 auto;
    background: linear-gradient(135deg, #0f172a, #141f38, #0f172a);
    border: 2px solid rgba(245, 158, 11, 0.4);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    position: relative;
    overflow: hidden;
}
.id-card::before {
    content: '';
    position: absolute;
    top: -50%; right: -50%;
    width: 100%; height: 100%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.06), transparent 70%);
    pointer-events: none;
}
.id-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.8);
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}
.id-card-title {
    display: flex; align-items: center; gap: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--amber);
}
.badge-amber {
    font-size: 0.75rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.2);
    color: var(--amber-light);
    font-weight: 700;
    border: 1px solid rgba(245, 158, 11, 0.3);
    white-space: nowrap;
}
.id-card-body {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
}
.id-photo {
    width: 140px; height: 140px;
    border-radius: var(--radius-lg);
    background: var(--bg-950);
    border: 2px solid rgba(245, 158, 11, 0.6);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow);
}
.id-photo img { width: 100%; height: 100%; object-fit: cover; }
.id-info { flex: 1; min-width: 220px; }
.id-info h3 { font-size: 1.5rem; font-weight: 800; color: #fff; letter-spacing: 0.02em; }
.id-serial { font-family: 'SF Mono', Consolas, monospace; font-size: 0.85rem; font-weight: 600; color: var(--amber); padding-top: 0.35rem; }
.id-occupation { font-size: 0.75rem; color: #cbd5e1; padding-top: 0.35rem; }
.id-occupation span:first-child { display: block; font-size: 0.65rem; text-transform: uppercase; color: var(--text-dim); }
.id-occupation span:last-child { font-weight: 500; }

.id-details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    background: rgba(2, 6, 23, 0.6);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    position: relative;
    z-index: 1;
}
.detail-label { display: block; font-size: 0.65rem; text-transform: uppercase; font-weight: 700; color: var(--text-dim); margin-bottom: 0.25rem; }
.detail-value { font-size: 0.85rem; font-weight: 600; color: var(--text); }

.id-two-cols {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    background: rgba(15, 23, 42, 0.6);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    position: relative;
    z-index: 1;
}
.id-two-cols h4 {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--amber);
    padding-bottom: 0.65rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}
.kv { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.75rem; padding: 0.35rem 0; }
.kv span:first-child { color: var(--text-muted); flex-shrink: 0; }
.kv span:last-child { font-weight: 600; color: var(--text); text-align: right; }
.center-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; max-width: 780px; margin: 0 auto; }

/* ---------- Stats Grid ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.stat-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.stat-head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}
.stat-head i { font-size: 1rem; color: var(--amber); }
.stat-card:nth-child(2) .stat-head i { color: var(--blue); }
.stat-card:nth-child(3) .stat-head i { color: var(--purple); }
.stat-card:nth-child(4) .stat-head i { color: var(--emerald); }
.stat-value { font-size: 2rem; font-weight: 800; color: #fff; line-height: 1; }
.stat-card p { font-size: 0.7rem; color: var(--text-dim); }

/* ---------- Charts ---------- */
.charts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.chart-panel { display: flex; flex-direction: column; gap: 1rem; }
.chart-panel h3 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--amber);
    display: flex; align-items: center; gap: 0.5rem;
}
.chart-box { position: relative; width: 100%; height: 260px; }

/* ---------- Table ---------- */
.table-panel { display: flex; flex-direction: column; gap: 1.25rem; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.table-toolbar h3 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #fff;
    display: flex; align-items: center; gap: 0.5rem;
}
.table-toolbar h3 i { color: var(--amber); }
.table-filters { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.table-filters input, .table-filters select { width: auto; min-width: 200px; padding: 0.55rem 0.9rem; font-size: 0.75rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.records-table { width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.records-table thead { background: var(--bg-950); }
.records-table th {
    text-align: left;
    padding: 0.85rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.records-table td { padding: 0.85rem 1rem; border-top: 1px solid var(--border); color: #cbd5e1; vertical-align: middle; }
.records-table tbody tr { transition: background 0.15s; }
.records-table tbody tr:hover { background: rgba(30, 41, 59, 0.4); }
.thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; border: 1px solid var(--border-light); }
.serial-cell { font-family: 'SF Mono', Consolas, monospace; color: var(--amber); font-weight: 600; }
.name-cell { color: #fff; font-weight: 500; }
.tag-chip {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    background: var(--bg-800);
    color: #cbd5e1;
    font-weight: 500;
    font-size: 0.7rem;
}
.empty-row { padding: 2rem; text-align: center; color: var(--text-dim); }

/* ---------- Modals ---------- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-box {
    background: var(--bg-900);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 2rem;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.modal-box-sm { max-width: 380px; text-align: center; align-items: center; }
.modal-close {
    position: absolute;
    top: 1.25rem; right: 1.25rem;
    background: transparent;
    color: var(--text-muted);
    font-size: 1rem;
    transition: color 0.2s;
}
.modal-close:hover { color: #fff; }
.modal-header { text-align: center; display: flex; flex-direction: column; gap: 0.5rem; align-items: center; }
.modal-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.2);
    color: var(--amber);
    border: 1px solid rgba(245, 158, 11, 0.3);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
}
.modal-header h3 { font-size: 1.1rem; font-weight: 700; color: #fff; }
.modal-header p { font-size: 0.75rem; color: var(--text-muted); }
.modal-box-sm h3 { font-size: 1rem; font-weight: 700; color: #fff; }
.modal-box-sm p { font-size: 0.8rem; color: var(--text-muted); line-height: 1.6; }

.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 2.75rem; }
.pwd-toggle {
    position: absolute;
    top: 50%; right: 0.75rem;
    transform: translateY(-50%);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0.25rem;
}
.pwd-toggle:hover { color: #fff; }
.hint { color: var(--text-dim); font-size: 0.65rem; font-weight: 400; }
.form-message {
    font-size: 0.75rem;
    color: #f87171;
    font-weight: 500;
    padding: 0.65rem 0.85rem;
    background: rgba(127, 29, 29, 0.4);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--bg-900);
    border-top: 1px solid var(--border);
    padding: 1.5rem 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 4rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .col-span-3 { grid-column: span 2; }
    .radio-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid { grid-template-columns: 1fr; }
    .id-details-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .header-inner { height: auto; padding: 1rem 0; }
    .brand-text h1 { font-size: 0.85rem; }
    .grid-3 { grid-template-columns: 1fr; }
    .col-span-2, .col-span-3 { grid-column: span 1; }
    .radio-grid { grid-template-columns: 1fr; }
    .unit-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }
    .id-card { padding: 1.5rem; }
    .id-card-body { flex-direction: column; align-items: center; text-align: center; }
    .id-info { text-align: center; }
    .id-details-grid { grid-template-columns: 1fr; }
    .id-two-cols { grid-template-columns: 1fr; }
    .kv { flex-direction: column; gap: 0.15rem; }
    .kv span:last-child { text-align: left; }
    .photo-row { flex-direction: column; align-items: center; }
    .photo-controls { text-align: center; align-items: center; }
    .btn-row { justify-content: center; }
    .table-toolbar { flex-direction: column; align-items: stretch; }
    .table-filters { flex-direction: column; }
    .table-filters input, .table-filters select { width: 100%; }
    .splash-text h2 { font-size: 1.4rem; }
    .main-content { padding: 1.5rem 0.75rem; }
}

@media (max-width: 480px) {
    .nav-controls { width: 100%; justify-content: flex-start; }
    .btn { font-size: 0.7rem; padding: 0.55rem 0.85rem; }
    .page-header-panel { flex-direction: column; align-items: flex-start; }
    .form-actions { justify-content: stretch; }
    .form-actions .btn { width: 100%; }
    .center-actions { flex-direction: column; }
    .center-actions .btn { width: 100%; }
}

/* ---------- Print Styles ---------- */
@media print {
    body { background: #fff !important; color: #000 !important; }
    .no-print { display: none !important; }
    .site-header, .site-footer { display: none !important; }
    .main-content { padding: 0 !important; }
    .print-container {
        box-shadow: none !important;
        border: 1px solid #cbd5e1 !important;
        background: #fff !important;
        color: #000 !important;
        max-width: 100% !important;
    }
    .id-card { background: #fff !important; border: 2px solid #000 !important; }
    .id-card::before { display: none !important; }
    .id-card-header { border-bottom: 1px solid #999 !important; }
    .id-card-title, .badge-amber, .id-serial { color: #000 !important; }
    .id-info h3 { color: #000 !important; }
    .detail-label, .kv span:first-child { color: #555 !important; }
    .detail-value, .kv span:last-child, .id-occupation span:last-child { color: #000 !important; }
    .id-details-grid, .id-two-cols { background: #f8fafc !important; border-color: #cbd5e1 !important; }
    .id-two-cols h4 { color: #000 !important; border-bottom: 1px solid #999 !important; }
    .records-table, .records-table th, .records-table td { border-color: #cbd5e1 !important; color: #000 !important; }
    .records-table thead { background: #f1f5f9 !important; }
    .stat-card { border: 1px solid #cbd5e1 !important; background: #fff !important; }
    .stat-value, .stat-head { color: #000 !important; }
}