:root {
    --navy-950: #06152d;
    --navy-900: #0a2144;
    --navy-800: #10315e;
    --blue-600: #176bdb;
    --blue-500: #2586f0;
    --cyan-400: #28c7de;
    --gold-400: #f4c24f;
    --red-500: #e84557;
    --ink-900: #17243a;
    --ink-700: #435069;
    --ink-500: #718099;
    --surface: #ffffff;
    --canvas: #f4f7fb;
    --line: #e6ebf2;
    --success: #1f9d74;
    --shadow-sm: 0 6px 22px rgba(15, 35, 66, .07);
    --shadow-lg: 0 24px 70px rgba(4, 22, 51, .16);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 26px;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink-900);
    background: var(--canvas);
    font-family: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }
button, input, select, textarea { font: inherit; }

/* Application shell */
.app-shell { display: flex; min-height: 100vh; }

.app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1030;
    display: flex;
    width: 278px;
    flex-direction: column;
    overflow: hidden;
    color: #d9e7fa;
    background:
        radial-gradient(circle at 0 100%, rgba(37, 134, 240, .2), transparent 35%),
        linear-gradient(165deg, var(--navy-950), #0b2851 62%, #0d3261);
    transition: width .28s cubic-bezier(.2, .8, .2, 1), transform .28s cubic-bezier(.2, .8, .2, 1);
}

.app-sidebar::before {
    position: absolute;
    top: -110px;
    right: -90px;
    width: 230px;
    height: 230px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 50%;
    box-shadow: 0 0 0 35px rgba(255,255,255,.025), 0 0 0 70px rgba(255,255,255,.018);
    content: "";
}

.brand {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    height: 92px;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.brand-flag {
    display: block;
    width: 54px;
    aspect-ratio: 3 / 2;
    flex: 0 0 auto;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 10px 26px rgba(0,0,0,.24);
}

.brand strong { display: block; color: white; font-size: 1.13rem; letter-spacing: -.02em; }
.brand strong span { color: #63d9eb; }
.brand small { display: block; margin-top: 2px; color: #91a8c7; font-size: .68rem; letter-spacing: .05em; text-transform: uppercase; }

.sidebar-context {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 20px 18px 8px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    background: rgba(255,255,255,.055);
}

.context-dot { width: 8px; height: 8px; margin-top: 5px; flex: 0 0 auto; border-radius: 50%; background: #43d7ae; box-shadow: 0 0 0 4px rgba(67,215,174,.12); }
.context-collapsed-icon { display: none; color: #8edbc8; font-size: 1.05rem; }
.sidebar-context small, .sidebar-context strong { display: block; }
.sidebar-context small { margin-bottom: 3px; color: #88a1c2; font-size: .65rem; text-transform: uppercase; }
.sidebar-context strong { color: #f3f7fd; font-size: .76rem; font-weight: 600; line-height: 1.45; }

.sidebar-nav { position: relative; padding: 8px 14px; overflow-y: auto; }
.nav-section { display: block; margin: 20px 12px 8px; color: #7089ab; font-size: .64rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.sidebar-link {
    display: flex;
    min-height: 46px;
    align-items: center;
    gap: 13px;
    margin: 4px 0;
    padding: 0 13px;
    border-radius: 12px;
    color: #b5c8e2;
    font-size: .83rem;
    font-weight: 600;
    transition: color .18s ease, background .18s ease, transform .18s ease;
}

.sidebar-link i { width: 22px; color: #7d98bb; font-size: 1.05rem; text-align: center; transition: color .18s ease; }
.sidebar-link span { flex: 1; }
.sidebar-link small { padding: 3px 6px; border-radius: 6px; color: #778eac; background: rgba(255,255,255,.05); font-size: .56rem; text-transform: uppercase; }
.sidebar-link:not(.is-disabled):hover { color: white; background: rgba(255,255,255,.065); transform: translateX(2px); }
.sidebar-link:not(.is-disabled):hover i { color: #60d8eb; }
.sidebar-link.active { color: white; background: linear-gradient(100deg, rgba(37,134,240,.28), rgba(40,199,222,.1)); box-shadow: inset 3px 0 0 #36c9e1; }
.sidebar-link.active i { color: #5dd9eb; }
.sidebar-link.is-disabled { cursor: default; opacity: .56; }

.sidebar-footer { margin-top: auto; padding: 18px; }
.security-pill { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid rgba(255,255,255,.07); border-radius: 12px; color: #8edbc8; background: rgba(0,0,0,.09); }
.security-pill i { font-size: 1.1rem; }
.security-pill span { color: #c9d8eb; font-size: .7rem; font-weight: 600; }
.security-pill small { display: block; color: #758dac; font-size: .6rem; font-weight: 500; }
.version { display: block; margin-top: 14px; color: #587394; font-size: .6rem; text-align: center; }

.app-workspace { width: calc(100% - 278px); min-width: 0; margin-left: 278px; transition: width .28s cubic-bezier(.2, .8, .2, 1), margin-left .28s cubic-bezier(.2, .8, .2, 1); }

html.sidebar-collapsed .app-sidebar { width: 88px; }
html.sidebar-collapsed .app-workspace { width: calc(100% - 88px); margin-left: 88px; }
html.sidebar-collapsed .brand { justify-content: center; padding: 0 14px; }
html.sidebar-collapsed .brand-flag { width: 48px; }
html.sidebar-collapsed .brand > span,
html.sidebar-collapsed .sidebar-context > span,
html.sidebar-collapsed .sidebar-link span,
html.sidebar-collapsed .sidebar-link small,
html.sidebar-collapsed .security-pill span,
html.sidebar-collapsed .version { display: none; }
html.sidebar-collapsed .sidebar-context { align-items: center; justify-content: center; margin: 20px 14px 8px; padding: 14px 8px; }
html.sidebar-collapsed .sidebar-context .context-dot { margin: 0; }
html.sidebar-collapsed .context-collapsed-icon { display: block; }
html.sidebar-collapsed .sidebar-nav { padding-inline: 13px; overflow-x: hidden; }
html.sidebar-collapsed .nav-section { height: 1px; margin: 22px 10px 12px; overflow: hidden; background: rgba(255,255,255,.1); color: transparent; font-size: 0; }
html.sidebar-collapsed .sidebar-link { justify-content: center; gap: 0; padding: 0; }
html.sidebar-collapsed .sidebar-link i { width: auto; font-size: 1.16rem; }
html.sidebar-collapsed .sidebar-link:not(.is-disabled):hover { transform: translateY(-1px); }
html.sidebar-collapsed .sidebar-footer { padding: 18px 14px; }
html.sidebar-collapsed .security-pill { justify-content: center; padding: 11px; }

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    height: 82px;
    align-items: center;
    justify-content: space-between;
    padding: 0 34px;
    border-bottom: 1px solid rgba(224,230,239,.85);
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(18px);
}

.topbar-leading, .topbar-actions, .user-menu { display: flex; align-items: center; }
.topbar-leading { gap: 14px; }
.topbar-title small, .topbar-title strong { display: block; }
.topbar-title small { margin-bottom: 3px; color: var(--ink-500); font-size: .64rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.topbar-title strong { color: var(--navy-900); font-size: .86rem; }

.topbar-actions { gap: 14px; }
.icon-button { display: grid; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-700); background: white; transition: transform .18s ease, box-shadow .18s ease; }
.icon-button:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.menu-toggle { display: grid; }
.notification-button { position: relative; }
.notification-button span { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border: 2px solid white; border-radius: 50%; background: var(--red-500); }

.user-menu { gap: 10px; padding-left: 4px; }
.user-avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: white; background: linear-gradient(145deg, var(--blue-600), var(--cyan-400)); box-shadow: 0 7px 18px rgba(23,107,219,.2); font-size: .75rem; font-weight: 800; }
.user-copy { min-width: 130px; }
.user-copy strong, .user-copy small { display: block; }
.user-copy strong { overflow: hidden; max-width: 175px; color: var(--ink-900); font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.user-copy small { margin-top: 2px; color: var(--ink-500); font-size: .64rem; }
.user-actions { display: flex; gap: 3px; padding-left: 5px; border-left: 1px solid var(--line); }
.user-actions a { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; color: var(--ink-500); transition: .18s ease; }
.user-actions a:hover { color: var(--blue-600); background: #edf5ff; }

.app-main { min-height: calc(100vh - 82px); padding: 34px; }
.page-enter { animation: pageEnter .5s cubic-bezier(.2,.8,.2,1) both; }

/* Reusable surfaces */
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 8px; color: var(--blue-600); font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.eyebrow::before { width: 18px; height: 2px; border-radius: 2px; background: var(--cyan-400); content: ""; }
.page-heading h1 { margin: 0; color: var(--navy-900); font-size: clamp(1.55rem, 2.4vw, 2.15rem); font-weight: 800; letter-spacing: -.04em; }
.page-heading p { max-width: 650px; margin: 8px 0 0; color: var(--ink-500); font-size: .84rem; line-height: 1.65; }

.surface-card {
    border: 1px solid rgba(222,229,239,.9);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.btn { border-radius: 11px; font-size: .78rem; font-weight: 700; }
.btn-primary { border-color: var(--blue-600); background: var(--blue-600); box-shadow: 0 8px 18px rgba(23,107,219,.16); }
.btn-primary:hover, .btn-primary:focus { border-color: #115dc2; background: #115dc2; transform: translateY(-1px); }
.btn-soft { border: 1px solid #dbe8f8; color: var(--blue-600); background: #f0f6fe; }
.btn-soft:hover { color: #0d56b4; background: #e4f0fd; }
.btn-light { border: 1px solid var(--line); background: white; }

.app-alert { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; padding: 13px 15px; border: 1px solid #cfeede; border-radius: 13px; color: #176c52; background: #edfbf5; box-shadow: var(--shadow-sm); font-size: .78rem; animation: alertIn .35s ease both; }
.app-alert > span { flex: 1; }
.app-alert button { border: 0; color: inherit; background: transparent; }
.app-alert-error, .app-alert-danger { border-color: #f5ced3; color: #9c3040; background: #fff2f4; }

/* Dashboard */
.welcome-panel {
    position: relative;
    display: grid;
    min-height: 220px;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr);
    overflow: hidden;
    border-radius: var(--radius-lg);
    color: white;
    background:
        radial-gradient(circle at 80% 20%, rgba(40,199,222,.22), transparent 23%),
        linear-gradient(125deg, #09234a 0%, #0d3970 58%, #0d5996 100%);
    box-shadow: 0 25px 60px rgba(7,32,67,.2);
}

.welcome-panel::before, .welcome-panel::after { position: absolute; border: 1px solid rgba(255,255,255,.09); border-radius: 50%; content: ""; }
.welcome-panel::before { right: -100px; bottom: -170px; width: 410px; height: 410px; box-shadow: 0 0 0 45px rgba(255,255,255,.025), 0 0 0 90px rgba(255,255,255,.018); }
.welcome-panel::after { top: 30px; right: 32%; width: 9px; height: 9px; border: 0; background: var(--gold-400); box-shadow: 0 0 25px rgba(244,194,79,.75); animation: pulse 2.5s ease-in-out infinite; }
.welcome-copy { position: relative; z-index: 1; align-self: center; padding: 38px 42px; }
.welcome-kicker { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 15px; color: #8ddfec; font-size: .68rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.welcome-kicker::before { width: 7px; height: 7px; border-radius: 50%; background: #4ee0b5; box-shadow: 0 0 0 5px rgba(78,224,181,.12); content: ""; }
.welcome-copy h1 { max-width: 690px; margin: 0; font-size: clamp(1.75rem, 3vw, 2.65rem); font-weight: 800; letter-spacing: -.045em; }
.welcome-copy p { max-width: 580px; margin: 14px 0 0; color: #b9cce6; font-size: .83rem; line-height: 1.7; }
.welcome-meta { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; padding: 32px 34px; }
.live-time { text-align: right; }
.live-time strong { display: block; color: white; font-size: 1.5rem; font-weight: 700; letter-spacing: .03em; }
.live-time span { color: #94b1d3; font-size: .68rem; text-transform: capitalize; }
.availability { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.11); border-radius: 10px; color: #c8dbef; background: rgba(255,255,255,.06); font-size: .65rem; }
.availability i { color: #50dcae; }

.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; margin-top: 22px; }
.metric-card { position: relative; display: flex; min-height: 132px; align-items: flex-start; gap: 15px; overflow: hidden; padding: 22px; transition: transform .2s ease, box-shadow .2s ease; }
.metric-card:hover { transform: translateY(-4px); box-shadow: 0 16px 38px rgba(15,35,66,.11); }
.metric-icon { display: grid; width: 46px; height: 46px; flex: 0 0 auto; place-items: center; border-radius: 14px; color: var(--blue-600); background: #ebf3ff; font-size: 1.15rem; }
.metric-card:nth-child(2) .metric-icon { color: #1a9774; background: #eaf9f4; }
.metric-card:nth-child(3) .metric-icon { color: #a97114; background: #fff6df; }
.metric-card:nth-child(4) .metric-icon { color: #9b4fc3; background: #f7edfc; }
.metric-card small { display: block; color: var(--ink-500); font-size: .68rem; font-weight: 700; }
.metric-card strong { display: block; margin-top: 5px; color: var(--navy-900); font-size: 1.8rem; font-weight: 800; letter-spacing: -.04em; }
.metric-card .trend { margin-top: 5px; color: #789; font-size: .62rem; }
.metric-card .trend.good { color: var(--success); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(290px, .55fr); gap: 22px; margin-top: 22px; }
.section-card { padding: 24px; }
.section-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 21px; }
.section-card-header h2 { margin: 0; color: var(--navy-900); font-size: .98rem; font-weight: 800; }
.section-card-header p { margin: 4px 0 0; color: var(--ink-500); font-size: .67rem; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 8px; color: #187353; background: #eaf9f3; font-size: .6rem; font-weight: 800; text-transform: uppercase; }
.status-badge::before { width: 6px; height: 6px; border-radius: 50%; background: #31bd88; content: ""; }

.coverage-row { display: grid; grid-template-columns: 40px minmax(100px, 1fr) 1.7fr 45px; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid #edf0f5; }
.coverage-row:last-child { border: 0; }
.coverage-code { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; color: var(--blue-600); background: #eef5ff; font-size: .62rem; font-weight: 800; }
.coverage-copy strong, .coverage-copy small { display: block; }
.coverage-copy strong { font-size: .76rem; }
.coverage-copy small { margin-top: 2px; color: var(--ink-500); font-size: .61rem; }
.progress-track { height: 7px; overflow: hidden; border-radius: 10px; background: #edf1f6; }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue-600), var(--cyan-400)); animation: progressIn .9s .25s ease both; transform-origin: left; }
.coverage-value { color: var(--ink-700); font-size: .67rem; font-weight: 800; text-align: right; }

.quick-actions { display: grid; gap: 10px; }
.quick-action { display: flex; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink-700); background: #fbfcfe; transition: .18s ease; }
.quick-action:hover { border-color: #bad6f6; color: var(--blue-600); background: #f3f8ff; transform: translateX(3px); }
.quick-action i { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; color: var(--blue-600); background: #e9f2fe; }
.quick-action span { flex: 1; font-size: .72rem; font-weight: 700; }
.quick-action > .bi-chevron-right { width: auto; color: #9aa7b8; background: none; font-size: .65rem; }

/* Data tables and forms */
.table-card { overflow: hidden; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.table-toolbar strong { color: var(--navy-900); font-size: .78rem; }
.table-toolbar small { margin-left: 7px; color: var(--ink-500); font-size: .64rem; }
.search-shell { position: relative; width: min(280px, 100%); }
.search-shell i { position: absolute; top: 50%; left: 13px; color: #8a99ae; transform: translateY(-50%); }
.search-shell input { width: 100%; height: 39px; padding: 0 12px 0 38px; border: 1px solid var(--line); border-radius: 10px; outline: none; background: #f9fbfd; font-size: .7rem; }
.search-shell input:focus { border-color: #9dc5f2; box-shadow: 0 0 0 3px rgba(37,134,240,.1); }

.app-table { width: 100%; margin: 0; }
.app-table thead th { padding: 13px 18px; border: 0; color: #77869b; background: #f8fafc; font-size: .61rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.app-table tbody td { padding: 15px 18px; border-color: #edf1f5; color: var(--ink-700); font-size: .72rem; vertical-align: middle; }
.app-table tbody tr { transition: background .15s ease; }
.app-table tbody tr:hover { background: #f9fbfe; }
.entity-name { color: var(--ink-900); font-weight: 750; }
.code-chip { display: inline-flex; padding: 5px 8px; border: 1px solid #dce8f6; border-radius: 8px; color: #2861a6; background: #f2f7fd; font-size: .62rem; font-weight: 800; }
.state-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px; color: #187354; background: #eaf8f2; font-size: .59rem; font-weight: 800; }
.state-chip::before { width: 5px; height: 5px; border-radius: 50%; background: #35bd8b; content: ""; }
.state-chip.inactive { color: #69778b; background: #eef1f5; }
.state-chip.inactive::before { background: #8d99aa; }
.empty-state { padding: 52px 20px !important; color: var(--ink-500) !important; text-align: center; }
.empty-state i { display: block; margin-bottom: 8px; color: #a8bad0; font-size: 1.5rem; }

.form-card { max-width: 900px; padding: 28px; }
.form-card .form-label { margin-bottom: 7px; color: var(--ink-700); font-size: .7rem; font-weight: 700; }
.form-card .form-control, .form-card .form-select { min-height: 46px; border-color: #dfe5ee; border-radius: 11px; color: var(--ink-900); background-color: #fbfcfe; font-size: .76rem; }
.form-card .form-control:focus, .form-card .form-select:focus { border-color: #72abeb; background: white; box-shadow: 0 0 0 4px rgba(37,134,240,.1); }
.form-card .form-check-input:checked { border-color: var(--blue-600); background-color: var(--blue-600); }
.form-actions { display: flex; gap: 9px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-actions .btn { min-height: 43px; padding-inline: 18px; }

/* Login */
.auth-body { overflow-x: hidden; background: var(--navy-950); }
.login-page { position: relative; display: grid; min-height: 100vh; grid-template-columns: minmax(0, 1.08fr) minmax(440px, .92fr); }
.login-visual { position: relative; display: flex; min-height: 100vh; flex-direction: column; justify-content: space-between; overflow: hidden; padding: 50px clamp(38px, 6vw, 90px); color: white; background:
    radial-gradient(circle at 80% 70%, rgba(35,139,217,.32), transparent 28%),
    linear-gradient(142deg, #06152d 0%, #092b57 55%, #0b4d81 100%);
}
.login-visual::before { position: absolute; top: 10%; right: -180px; width: 530px; height: 530px; border: 1px solid rgba(255,255,255,.08); border-radius: 50%; box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.015); content: ""; animation: orbit 18s linear infinite; }
.login-visual::after { position: absolute; right: 21%; bottom: 22%; width: 10px; height: 10px; border-radius: 50%; background: var(--gold-400); box-shadow: 0 0 30px 6px rgba(244,194,79,.35); content: ""; animation: float 4s ease-in-out infinite; }
.login-brand { position: relative; z-index: 2; display: flex; align-items: center; gap: 14px; }
.login-brand .brand-flag { width: 64px; }
.login-brand strong { display: block; font-size: 1.25rem; font-weight: 800; }
.login-brand strong span { color: #64dae9; }
.login-brand small { color: #91a8c7; font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; }

.login-message { position: relative; z-index: 2; max-width: 660px; padding: 70px 0; }
.login-label { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 24px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; color: #80dcec; background: rgba(255,255,255,.055); font-size: .63rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.login-label i { color: var(--gold-400); }
.login-message h1 { max-width: 630px; margin: 0; font-size: clamp(2.25rem, 5vw, 4.65rem); font-weight: 800; letter-spacing: -.06em; line-height: 1.02; }
.login-message h1 span { color: #68d9ea; }
.login-message p { max-width: 560px; margin: 24px 0 0; color: #afc5df; font-size: clamp(.85rem, 1.2vw, 1rem); line-height: 1.85; }
.institution-points { display: flex; flex-wrap: wrap; gap: 18px 28px; margin-top: 35px; }
.institution-points span { display: flex; align-items: center; gap: 8px; color: #ccdaeb; font-size: .68rem; font-weight: 600; }
.institution-points i { color: #52d9b1; }
.login-footer { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; color: #6f88a8; font-size: .61rem; }
.footer-flag { display: block; width: 54px; aspect-ratio: 3 / 2; border: 1px solid rgba(255,255,255,.15); border-radius: 5px; object-fit: cover; box-shadow: 0 5px 16px rgba(0,0,0,.18); }

.login-form-side { position: relative; display: grid; min-height: 100vh; place-items: center; padding: 45px clamp(30px, 6vw, 88px); background: #fbfcfe; }
.login-form-side::before { position: absolute; inset: 0; opacity: .45; background-image: radial-gradient(#d7e1ee 1px, transparent 1px); background-size: 22px 22px; content: ""; mask-image: linear-gradient(to bottom, black, transparent 58%); }
.login-card { position: relative; z-index: 1; width: 100%; max-width: 440px; animation: loginCardIn .7s .12s cubic-bezier(.2,.8,.2,1) both; }
.mobile-brand { display: none; margin-bottom: 35px; color: var(--navy-900); }
.login-card-head { margin-bottom: 34px; }
.login-card-head .eyebrow { margin-bottom: 12px; }
.login-card-head h2 { margin: 0; color: var(--navy-900); font-size: 2rem; font-weight: 800; letter-spacing: -.045em; }
.login-card-head p { margin: 10px 0 0; color: var(--ink-500); font-size: .78rem; line-height: 1.7; }
.login-alert { display: flex; gap: 10px; margin-bottom: 20px; padding: 12px 14px; border: 1px solid #f2ccd2; border-radius: 11px; color: #a23445; background: #fff2f4; font-size: .72rem; }
.field-group { margin-bottom: 18px; }
.field-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: var(--ink-700); font-size: .69rem; font-weight: 700; }
.field-wrap { position: relative; }
.field-wrap > i { position: absolute; top: 50%; left: 16px; color: #8899af; transform: translateY(-50%); }
.login-input { width: 100%; height: 52px; padding: 0 48px 0 46px; border: 1px solid #dce3ec; border-radius: 13px; outline: none; color: var(--ink-900); background: white; box-shadow: 0 4px 14px rgba(15,35,66,.025); font-size: .77rem; transition: .18s ease; }
.login-input:focus { border-color: #65a3e9; box-shadow: 0 0 0 4px rgba(37,134,240,.1), 0 8px 20px rgba(15,35,66,.06); }
.password-toggle { position: absolute; top: 50%; right: 9px; display: grid; width: 36px; height: 36px; place-items: center; border: 0; border-radius: 9px; color: #8292a7; background: transparent; transform: translateY(-50%); }
.password-toggle:hover { color: var(--blue-600); background: #eef5fd; }
.login-options { display: flex; align-items: center; justify-content: space-between; margin: 7px 0 24px; color: var(--ink-500); font-size: .65rem; }
.login-options label { display: flex; align-items: center; gap: 7px; }
.login-options input { accent-color: var(--blue-600); }
.login-button { position: relative; width: 100%; height: 52px; overflow: hidden; border: 0; border-radius: 13px; color: white; background: linear-gradient(105deg, #125fc6, #1a82e7); box-shadow: 0 13px 28px rgba(23,107,219,.24); font-size: .77rem; font-weight: 800; transition: transform .18s ease, box-shadow .18s ease; }
.login-button::after { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.2) 48%, transparent 75%); content: ""; transform: translateX(-110%); transition: transform .65s ease; }
.login-button:hover { transform: translateY(-2px); box-shadow: 0 17px 32px rgba(23,107,219,.3); }
.login-button:hover::after { transform: translateX(110%); }
.login-button span { position: relative; z-index: 1; }
.login-button i { margin-left: 8px; }
.login-security { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 23px; color: #8997aa; font-size: .62rem; }
.login-security i { color: #33a77f; }

/* Civil registry modules */
.record-form { max-width: 1040px; }
.form-section { padding: 5px 0 28px; }
.form-section + .form-section { padding-top: 27px; border-top: 1px solid var(--line); }
.form-section-title { display: flex; align-items: center; gap: 12px; margin-bottom: 21px; }
.form-section-title > span { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: var(--blue-600); background: #eaf3ff; font-size: .62rem; font-weight: 800; }
.form-section-title strong, .form-section-title small { display: block; }
.form-section-title strong { color: var(--navy-900); font-size: .8rem; }
.form-section-title small { margin-top: 2px; color: var(--ink-500); font-size: .62rem; font-weight: 500; }
.invalid-feedback, .form-error-message { display: block; margin-top: 6px; color: #c9344c; font-size: .64rem; font-weight: 700; line-height: 1.45; }
.form-control.is-invalid, .form-select.is-invalid, .form-check-input.is-invalid { border-color: #dc3545; box-shadow: 0 0 0 3px rgba(220,53,69,.08); }
.origin-fields-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 17px; border: 1px solid #dce6f0; border-radius: 14px; background: #f8fbfe; }
[data-national-origin][hidden], [data-foreign-origin][hidden] { display: none !important; }

.person-autocomplete { position: relative; }
.person-autocomplete [hidden], .person-preview [hidden] { display: none !important; }
.person-autocomplete-input { position: relative; }
.person-autocomplete-input > i { position: absolute; top: 50%; left: 15px; z-index: 1; color: #71839a; transform: translateY(-50%); }
.person-autocomplete-input input { width: 100%; height: 48px; padding: 0 48px 0 43px; border: 1px solid #d9e2ed; border-radius: 12px; outline: none; color: var(--ink-900); background: #fbfdff; font-size: .72rem; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.person-autocomplete-input input:focus { border-color: #70a9e8; background: white; box-shadow: 0 0 0 4px rgba(37,134,240,.1); }
.person-autocomplete-spinner { position: absolute; top: 16px; right: 16px; width: 16px; height: 16px; border: 2px solid #dbe8f6; border-top-color: var(--blue-600); border-radius: 50%; animation: autocompleteSpin .7s linear infinite; }
.person-autocomplete-results { position: absolute; top: calc(100% + 7px); left: 0; z-index: 100; width: 100%; max-height: 310px; margin: 0; padding: 6px; overflow-y: auto; border: 1px solid #dce5ef; border-radius: 14px; background: white; box-shadow: 0 18px 45px rgba(15,35,66,.16); list-style: none; animation: autocompleteIn .16s ease both; }
.person-autocomplete-results li + li { border-top: 1px solid #eef2f6; }
.person-autocomplete-results button { display: grid; width: 100%; grid-template-columns: 38px minmax(0, 1fr) 20px; align-items: center; gap: 10px; padding: 10px; border: 0; border-radius: 9px; color: var(--ink-700); background: transparent; text-align: left; transition: background .15s ease, transform .15s ease; }
.person-autocomplete-results button:hover, .person-autocomplete-results button.is-active { background: #eef6ff; transform: translateX(2px); }
.person-autocomplete-results button.is-deceased { background: #fff6f7; }
.person-autocomplete-results button.is-deceased:hover, .person-autocomplete-results button.is-deceased.is-active { background: #ffecee; }
.result-avatar { display: grid; width: 38px; height: 46px; overflow: hidden; place-items: center; border: 2px solid white; border-radius: 10px; color: var(--blue-600); background: #e7f2ff; box-shadow: 0 4px 10px rgba(15,35,66,.1); font-size: .55rem; font-weight: 850; }
.result-avatar [hidden], .person-autocomplete-avatar [hidden] { display: none !important; }
.result-avatar img, .person-autocomplete-avatar img { width: 100%; height: 100%; object-fit: cover; }
.result-avatar > span, .person-autocomplete-avatar > span { display: grid; width: 100%; height: 100%; place-items: center; }
.result-identity { min-width: 0; }
.result-identity strong, .result-identity span, .result-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-identity strong { color: var(--navy-900); font-size: .7rem; }
.result-identity span { margin-top: 2px; color: var(--blue-600); font-size: .61rem; font-weight: 750; }
.result-identity small { margin-top: 3px; color: var(--ink-500); font-size: .57rem; }
.result-identity .result-vital-alert { display: block; margin-top: 4px; overflow: hidden; color: #bd3047; font-size: .56rem; font-style: normal; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.result-identity .result-vital-alert[hidden] { display: none !important; }
.result-arrow { color: #9bacbf; font-size: .7rem; }
.person-autocomplete-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 7px; color: var(--ink-500); font-size: .58rem; }
.person-autocomplete-hint a { color: var(--blue-600); font-weight: 750; text-decoration: none; white-space: nowrap; }
.person-autocomplete-hint a:hover { text-decoration: underline; }
.person-autocomplete-selection { display: flex; min-height: 62px; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #bcdccf; border-radius: 13px; background: linear-gradient(135deg, #f6fffb, #eefaf5); }
.person-autocomplete-avatar { display: grid; width: 48px; height: 58px; flex: 0 0 auto; overflow: hidden; place-items: center; border: 2px solid white; border-radius: 11px; color: #17805e; background: #daf3e9; box-shadow: 0 5px 12px rgba(15,35,66,.1); font-size: .58rem; font-weight: 850; }
.person-autocomplete-identity { min-width: 0; flex: 1; }
.person-autocomplete-identity strong, .person-autocomplete-identity span, .person-autocomplete-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-autocomplete-identity strong { color: var(--navy-900); font-size: .72rem; }
.person-autocomplete-identity span { margin-top: 2px; color: #177356; font-size: .61rem; font-weight: 750; }
.person-autocomplete-identity small { margin-top: 3px; color: var(--ink-500); font-size: .57rem; }
.person-autocomplete-actions { display: flex; gap: 4px; }
.person-autocomplete-actions button { border: 1px solid #d4e1ec; border-radius: 8px; color: var(--ink-600); background: white; font-size: .59rem; font-weight: 700; }
.person-autocomplete-actions button { display: inline-flex; height: 31px; align-items: center; gap: 5px; padding: 0 9px; }
.person-autocomplete-actions button:hover { border-color: #9ec3eb; color: var(--blue-600); background: #f4f9ff; }

.live-person-field { position: relative; }
.live-person-field [hidden] { display: none !important; }
.live-person-field > i { position: absolute; top: 50%; left: 15px; z-index: 1; color: #71839a; transform: translateY(-50%); pointer-events: none; }
.live-person-field input[type="text"] { width: 100%; height: 48px; padding: 0 48px 0 43px; border: 1px solid #d9e2ed; border-radius: 12px; outline: none; color: var(--ink-900); background: #fbfdff; font-size: .72rem; transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
.live-person-field input[type="text"]:focus { border-color: #70a9e8; background: white; box-shadow: 0 0 0 4px rgba(37,134,240,.1); }
.live-person-field.has-selection input[type="text"] { border-color: #94cfb8; color: #176b51; background: #f3fcf8; font-weight: 700; }
.live-person-field.has-selection > i { color: #20805f; }
.live-person-spinner { position: absolute; top: 16px; right: 16px; width: 16px; height: 16px; border: 2px solid #dbe8f6; border-top-color: var(--blue-600); border-radius: 50%; animation: autocompleteSpin .7s linear infinite; }
.live-person-help { display: block; min-height: 17px; margin-top: 7px; color: var(--ink-500); font-size: .58rem; transition: color .18s ease; }
.live-person-help[data-state="selected"] { color: #187052; font-weight: 700; }
.live-person-help[data-state="empty"], .live-person-help[data-state="error"], .live-person-help[data-state="deceased"] { color: #b82f46; font-weight: 750; }
.marriage-spouse-selection { display: grid; min-height: 102px; grid-template-columns: 66px minmax(0, 1fr) 20px; align-items: center; gap: 13px; margin-top: 12px; padding: 12px; border: 1px solid #bcdccf; border-radius: 15px; background: linear-gradient(135deg, #f7fffb, #edf9f4); box-shadow: 0 9px 22px rgba(22,112,82,.08); animation: autocompleteIn .2s ease both; }
.marriage-spouse-selection[hidden] { display: none !important; }
.marriage-spouse-photo { display: grid; width: 64px; height: 78px; overflow: hidden; place-items: center; border: 3px solid white; border-radius: 13px; color: #1d7257; background: linear-gradient(145deg, #dff3ea, #ccebdd); box-shadow: 0 8px 18px rgba(15,35,66,.12); font-size: .72rem; font-weight: 850; }
.marriage-spouse-photo [hidden] { display: none !important; }
.marriage-spouse-photo img { width: 100%; height: 100%; object-fit: cover; }
.marriage-spouse-copy { min-width: 0; }
.marriage-spouse-copy small, .marriage-spouse-copy strong, .marriage-spouse-copy span, .marriage-spouse-copy em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.marriage-spouse-copy small { margin-bottom: 4px; color: #20805f; font-size: .53rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.marriage-spouse-copy strong { color: var(--navy-900); font-size: .73rem; }
.marriage-spouse-copy span { margin-top: 3px; color: var(--blue-600); font-size: .6rem; font-weight: 750; }
.marriage-spouse-copy em { margin-top: 5px; color: var(--ink-500); font-size: .56rem; font-style: normal; }
.marriage-spouse-selection > i { align-self: start; margin-top: 4px; color: #29a77d; font-size: .82rem; }
.marriage-spouse-selection.is-deceased { border-color: #edb8c0; background: linear-gradient(135deg, #fffafb, #fff0f2); box-shadow: 0 9px 22px rgba(184,47,70,.08); }
.marriage-spouse-selection.is-deceased > i { color: #cf3e55; }
.marriage-spouse-selection.is-deceased .marriage-spouse-photo { color: #a83b4d; background: #f8dfe3; }
.spouse-vital-alert { margin-top: 7px !important; color: #bd3047 !important; font-size: .57rem !important; font-weight: 850 !important; }
.spouse-vital-alert[hidden] { display: none !important; }
.spouse-deceased-banner { margin-bottom: 24px; }

.person-form-identity-grid { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 28px; align-items: start; }
.person-photo-uploader { display: flex; align-items: center; flex-direction: column; padding: 18px 14px; border: 1px solid #dce6f0; border-radius: 16px; background: linear-gradient(145deg, #f9fbfe, #f2f7fc); text-align: center; }
.person-photo-preview { position: relative; display: grid; width: 132px; height: 160px; overflow: hidden; place-items: center; border: 4px solid white; border-radius: 18px; color: #56708f; background: linear-gradient(145deg, #e7eef6, #dce7f2); box-shadow: 0 12px 28px rgba(15,35,66,.13); }
.person-photo-preview [hidden] { display: none !important; }
.person-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.person-photo-preview > span:not(.person-photo-overlay) { font-size: 1.35rem; font-weight: 850; letter-spacing: .04em; }
.person-photo-preview > span i { font-size: 2.15rem; }
.person-photo-overlay { position: absolute; inset: auto 8px 8px auto; display: grid; width: 31px; height: 31px; place-items: center; border: 2px solid white; border-radius: 10px; color: white; background: var(--blue-600); box-shadow: 0 6px 14px rgba(22,99,202,.28); font-size: .75rem; transition: transform .18s ease; }
.person-photo-uploader:hover .person-photo-overlay { transform: translateY(-2px) rotate(-4deg); }
.person-photo-button { width: 100%; margin: 15px 0 7px; cursor: pointer; }
.person-photo-uploader > small { color: var(--ink-500); font-size: .56rem; line-height: 1.5; }
.person-photo-uploader .invalid-feedback { display: block; margin-top: 7px; }
.person-photo-remove { display: flex; align-items: center; gap: 7px; margin-top: 12px; color: #8b5260; font-size: .59rem; }
.person-photo-remove label { margin: 0; cursor: pointer; }
.person-photo-uploader.is-removing .person-photo-preview { border-color: #f6d9df; opacity: .76; }
.person-heading-identity { display: flex; align-items: center; gap: 18px; }
.person-photo-large { display: grid; width: 82px; height: 98px; flex: 0 0 auto; overflow: hidden; place-items: center; border: 4px solid white; border-radius: 20px; color: #365f91; background: linear-gradient(145deg, #e8f1fa, #d8e7f5); box-shadow: 0 12px 27px rgba(15,35,66,.15); font-size: 1rem; font-weight: 850; }
.person-photo-large img { width: 100%; height: 100%; object-fit: cover; }
.person-table-identity { display: inline-flex; align-items: center; gap: 10px; }
.person-table-avatar { display: grid; width: 34px; height: 39px; flex: 0 0 auto; overflow: hidden; place-items: center; border-radius: 10px; color: #35689f; background: #e8f2fc; font-size: .57rem; font-weight: 850; }
.person-table-avatar img { width: 100%; height: 100%; object-fit: cover; }

.parent-step-card { max-width: 1120px; padding: 0; overflow: visible; }
.parent-step-card form { padding: 28px; }
.parent-step-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(360px, 1.08fr); gap: 26px; align-items: stretch; }
.parent-search-panel { min-width: 0; padding: 10px 4px; }
.parent-search-note { display: flex; align-items: flex-start; gap: 9px; margin-top: 18px; padding: 12px; border-radius: 10px; color: var(--ink-500); background: #f5f8fc; font-size: .61rem; line-height: 1.55; }
.parent-search-note i { color: #25936f; font-size: .8rem; }
.person-preview { min-height: 300px; overflow: hidden; border: 1px solid #dce6f0; border-radius: 18px; background: linear-gradient(145deg, #f9fbfe, #f2f7fc); }
.person-preview-empty { display: flex; min-height: 300px; align-items: center; flex-direction: column; justify-content: center; padding: 35px; color: var(--ink-500); text-align: center; }
.person-preview-empty > span { display: grid; width: 64px; height: 64px; margin-bottom: 16px; place-items: center; border-radius: 20px; color: #7890ac; background: #e6edf5; font-size: 1.65rem; }
.person-preview-empty strong { color: var(--navy-900); font-size: .8rem; }
.person-preview-empty p { max-width: 300px; margin: 8px 0 0; font-size: .64rem; line-height: 1.6; }
.person-preview-content { min-height: 300px; padding: 24px; background: white; }
.person-preview-header { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.person-preview-avatar { display: grid; width: 74px; height: 90px; flex: 0 0 auto; overflow: hidden; place-items: center; border: 3px solid white; border-radius: 16px; color: #16805e; background: #def5eb; box-shadow: 0 9px 20px rgba(15,35,66,.12); font-size: .82rem; font-weight: 850; }
.person-preview-avatar [hidden] { display: none !important; }
.person-preview-avatar img { width: 100%; height: 100%; object-fit: cover; }
.person-preview-avatar > span { display: grid; width: 100%; height: 100%; place-items: center; }
.person-preview-avatar > span i { font-size: 1.35rem; }
.person-preview-header div { min-width: 0; }
.person-preview-header small, .person-preview-header strong, .person-preview-header div > span { display: block; }
.person-preview-header small { margin-bottom: 3px; color: var(--ink-500); font-size: .55rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.person-preview-header strong { overflow: hidden; color: var(--navy-900); font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.person-preview-header div > span { margin-top: 4px; color: var(--blue-600); font-size: .64rem; font-weight: 750; }
.person-preview dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 20px; margin: 20px 0 0; }
.person-preview dt { margin-bottom: 4px; color: var(--ink-500); font-size: .54rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.person-preview dd { margin: 0; overflow-wrap: anywhere; color: var(--ink-800); font-size: .67rem; font-weight: 650; }
.parent-step-actions { margin-top: 28px; padding-top: 21px; border-top: 1px solid var(--line); }

.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.detail-card { padding: 24px; }
.detail-card-wide { grid-column: 1 / -1; }
.detail-card > header { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.detail-card > header i { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; color: var(--blue-600); background: #edf5ff; }
.detail-card h2 { margin: 0; color: var(--navy-900); font-size: .88rem; font-weight: 800; }
.detail-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; margin: 0; }
.detail-card dl div { min-width: 0; }
.detail-card dt { margin-bottom: 4px; color: var(--ink-500); font-size: .59rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.detail-card dd { margin: 0; overflow-wrap: anywhere; color: var(--ink-900); font-size: .75rem; font-weight: 650; }

.record-status { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 8px; font-size: .58rem; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.record-status::before { width: 6px; height: 6px; border-radius: 50%; content: ""; }
.status-draft { color: #68758a; background: #eef1f5; }
.status-draft::before { background: #8794a7; }
.status-validated { color: #187052; background: #e8f8f1; }
.status-validated::before { background: #2bb889; }
.status-cancelled { color: #696f79; background: #eceef1; }
.status-cancelled::before { background: #777f8c; }

.filter-toolbar { flex-wrap: wrap; }
.filter-group { display: flex; align-items: center; gap: 8px; }
.filter-select { height: 39px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 10px; outline: none; color: var(--ink-700); background: #f9fbfd; font-size: .7rem; }
.filter-select:focus { border-color: #9dc5f2; box-shadow: 0 0 0 3px rgba(37,134,240,.1); }
.page-heading-actions, .table-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.table-actions { justify-content: flex-end; }
.table-actions form { margin: 0; }
.reference-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.role-choice-grid > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.role-choice-grid .form-check { margin: 0; padding: 13px 14px 13px 38px; border: 1px solid var(--line); border-radius: 11px; background: #f9fbfd; }
.role-choice-grid .form-check:has(input:checked) { border-color: #9ec8f4; background: #eff7ff; }
.account-switches { display: flex; justify-content: center; flex-direction: column; gap: 3px; padding-top: 22px; }
.audit-filters { display: grid; grid-template-columns: minmax(220px, 1.5fr) minmax(180px, .8fr) auto auto auto; gap: 9px; align-items: end; padding-bottom: 18px; }
.date-filter span { display: block; margin-bottom: 4px; color: var(--ink-500); font-size: .56rem; font-weight: 800; text-transform: uppercase; }
.audit-action { display: inline-flex; padding: 5px 8px; border-radius: 7px; color: #56657a; background: #edf1f5; font-size: .55rem; font-weight: 800; white-space: nowrap; }
.audit-action.audit-login { color: #245f9e; background: #eaf4ff; }
.audit-action.audit-success { color: #167052; background: #e7f8f0; }
.audit-details summary { color: var(--blue-600); cursor: pointer; font-size: .6rem; font-weight: 750; }
.audit-details pre { max-width: 340px; max-height: 180px; margin: 7px 0 0; padding: 9px; overflow: auto; border-radius: 8px; color: #d9e7f7; background: #10233d; font-size: .55rem; white-space: pre-wrap; }
.table-limit-note { margin: 14px 0 0; color: var(--ink-500); font-size: .61rem; }
.profile-grid { display: grid; grid-template-columns: minmax(250px, .38fr) minmax(0, 1fr); gap: 20px; }
.profile-identity-card { display: flex; min-height: 310px; align-items: center; flex-direction: column; justify-content: center; padding: 32px; text-align: center; }
.profile-avatar-large { display: grid; width: 82px; height: 82px; margin-bottom: 18px; place-items: center; border-radius: 25px; color: white; background: linear-gradient(145deg, var(--blue-600), #1456a8); box-shadow: 0 14px 30px rgba(37,134,240,.24); font-size: 1.35rem; font-weight: 800; }
.profile-identity-card h2 { margin: 0; color: var(--navy-900); font-size: 1.08rem; font-weight: 800; }
.profile-identity-card p { margin: 7px 0 16px; color: var(--ink-500); font-size: .68rem; }

.record-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; padding: 25px 28px; border: 1px solid var(--line); border-radius: var(--radius-md); background: linear-gradient(135deg, #fff, #f5f9fe); box-shadow: var(--shadow-sm); }
.record-title-row { display: flex; align-items: center; gap: 13px; }
.record-title-row h1 { margin: 0; color: var(--navy-900); font-size: clamp(1.35rem, 2.4vw, 2rem); font-weight: 800; letter-spacing: -.035em; }
.record-hero p { margin: 8px 0 0; color: var(--ink-500); font-size: .7rem; }
.record-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.record-actions form { margin: 0; }
.record-actions .btn { min-height: 40px; }
.btn-success { border-color: #18815f; background: #18815f; box-shadow: 0 8px 18px rgba(24,129,95,.17); }

.observation-box { margin-top: 22px; padding: 14px; border-radius: 11px; color: var(--ink-700); background: #f7f9fc; }
.observation-box strong { font-size: .66rem; text-transform: uppercase; }
.observation-box p { margin: 5px 0 0; font-size: .72rem; line-height: 1.6; }

.verification-page { display: flex; min-height: 100vh; align-items: center; flex-direction: column; justify-content: center; padding: 35px 20px; background: radial-gradient(circle at top, #e8f3ff, #f7f9fc 45%, #eef2f7); }
.verification-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }
.verification-brand .brand-flag { width: 52px; border-color: rgba(10,33,68,.12); box-shadow: 0 8px 20px rgba(15,35,66,.14); }
.verification-brand strong, .verification-brand small { display: block; }
.verification-brand strong { color: var(--navy-900); font-size: .9rem; font-weight: 800; }
.verification-brand small { color: var(--ink-500); font-size: .58rem; text-transform: uppercase; }
.verification-card { width: min(100%, 590px); padding: 38px; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: var(--shadow-lg); text-align: center; animation: loginCardIn .55s ease both; }
.verification-icon { display: grid; width: 68px; height: 68px; margin: 0 auto 20px; place-items: center; border-radius: 22px; color: #1c9871; background: #e8f8f1; font-size: 1.9rem; }
.verification-card.is-invalid .verification-icon { color: #c74356; background: #fff0f2; }
.verification-card .eyebrow { justify-content: center; }
.verification-card h1 { margin: 4px 0 9px; color: var(--navy-900); font-size: 1.55rem; font-weight: 800; letter-spacing: -.035em; }
.verification-card > p { max-width: 440px; margin: 0 auto 24px; color: var(--ink-500); font-size: .72rem; line-height: 1.7; }
.verification-card dl { margin: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-align: left; }
.verification-card dl div { display: grid; grid-template-columns: 42% 58%; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.verification-card dl div:last-child { border: 0; }
.verification-card dt { color: var(--ink-500); font-size: .62rem; }
.verification-card dd { margin: 0; color: var(--ink-900); font-size: .68rem; font-weight: 700; }
.verification-page > footer { margin-top: 20px; color: #7e8ca0; font-size: .6rem; }

/* Responsive */
.sidebar-overlay { display: none; }

@media (max-width: 1199px) {
    .metric-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 991px) {
    .app-sidebar { transform: translateX(-100%); box-shadow: 20px 0 50px rgba(4,18,39,.2); }
    .sidebar-open .app-sidebar { transform: translateX(0); }
    .sidebar-overlay { position: fixed; inset: 0; z-index: 1025; display: block; visibility: hidden; border: 0; opacity: 0; background: rgba(4,18,39,.5); transition: .25s ease; }
    .sidebar-open .sidebar-overlay { visibility: visible; opacity: 1; }
    .app-workspace { width: 100%; margin-left: 0; }
    .menu-toggle { display: grid; }
    .login-page { grid-template-columns: 1fr; }
    .login-visual { display: none; }
    .mobile-brand { display: flex; align-items: center; gap: 12px; }
    .parent-step-grid { grid-template-columns: 1fr; }
    .reference-grid { grid-template-columns: 1fr; }
    .audit-filters { grid-template-columns: 1fr 1fr; }
    .profile-grid { grid-template-columns: 1fr; }
    .origin-fields-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .app-topbar { height: 70px; padding: 0 16px; }
    .topbar-title, .user-copy, .notification-button { display: none; }
    .user-menu { gap: 7px; }
    .app-main { min-height: calc(100vh - 70px); padding: 22px 15px 35px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .page-heading .btn { width: 100%; }
    .welcome-panel { min-height: auto; grid-template-columns: 1fr; }
    .welcome-copy { padding: 30px 25px 18px; }
    .welcome-meta { align-items: flex-start; flex-direction: row; padding: 0 25px 27px; }
    .live-time { text-align: left; }
    .metric-grid { grid-template-columns: 1fr; gap: 12px; }
    .metric-card { min-height: 110px; }
    .dashboard-grid { gap: 14px; }
    .section-card { padding: 19px; }
    .coverage-row { grid-template-columns: 38px 1fr 40px; }
    .coverage-row .progress-track { grid-column: 2 / 4; }
    .table-toolbar { align-items: stretch; flex-direction: column; }
    .search-shell { width: 100%; }
    .filter-group { align-items: stretch; flex-direction: column; }
    .filter-select { width: 100%; }
    .page-heading-actions { width: 100%; }
    .page-heading-actions .btn { flex: 1; }
    .role-choice-grid > div { grid-template-columns: 1fr; }
    .audit-filters { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-card-wide { grid-column: auto; }
    .detail-card dl { grid-template-columns: 1fr; }
    .origin-fields-grid { grid-template-columns: 1fr; }
    .record-hero { align-items: flex-start; flex-direction: column; }
    .record-title-row { align-items: flex-start; flex-direction: column; }
    .record-actions { width: 100%; justify-content: flex-start; }
    .person-preview dl { grid-template-columns: 1fr; }
    .parent-step-card form { padding: 20px 16px; }
    .person-form-identity-grid { grid-template-columns: 1fr; }
    .person-photo-uploader { width: 100%; max-width: 270px; margin: 0 auto; }
    .person-heading-identity { align-items: flex-start; }
    .login-form-side { padding: 30px 22px; }
    .login-card-head h2 { font-size: 1.7rem; }
}

@keyframes pageEnter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes loginCardIn { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes alertIn { from { opacity: 0; transform: translateY(-7px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 50% { opacity: .4; transform: scale(.8); } }
@keyframes float { 50% { transform: translateY(-14px); } }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes progressIn { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes autocompleteSpin { to { transform: rotate(360deg); } }
@keyframes autocompleteIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
