@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=DM+Mono:ital,wght@0,400;0,500;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,500,1,0');

:root {
    --bg: #f4f7fb;
    --surface: #E0E2D2;
    --surface2: #c0bfbf;
    --surface3: #E0E2D2;
    --border: rgba(33, 48, 77, 0.15);
    --border-light: rgba(33, 48, 77, 0.25);

    --accent: #1f5fa8;
    --accent-dim: rgba(31, 95, 168, 0.12);
    --accent-glow: rgba(31, 95, 168, 0.22);
    --accent2: #f9a31e;
    --bg-buttons: #f9a31e;
    --bg-buttons-hover: #f9a31e;
    --btn-shadow: 0 4px 6px rgba(33, 48, 77, 0.18);
    --btn-shadow-hover: 0 7px 14px rgba(33, 48, 77, 0.24);
    --btn-shadow-hover-accent: 0 7px 14px rgba(249, 163, 30, 0.35);

    --success: #16a34a;
    --success-bg: rgba(22, 163, 74, 0.12);
    --warning: #d918068e;
    --info: #00b4fcfa;
    --warning-bg: rgba(217, 119, 6, 0.12);
    --error: #dc2626;
    --error-bg: rgba(220, 38, 38, 0.12);

    --text: #1f2f4d;
    --text-muted: grey;
    --text-dim: #9aa9c3;

    --sidebar-w: 240px;
    --topbar-h: 64px;
    --radius: 10px;
    --radius-sm: 7px;
    --radius-lg: 14px;

    --shadow-sm: 0 2px 8px rgba(33, 48, 77, 0.12);
    --shadow: 0 4px 20px rgba(33, 48, 77, 0.16);
    --shadow-lg: 0 8px 40px rgba(33, 48, 77, 0.2);
    --border: rgba(33, 48, 77, 0.15);
    --shadow-soft: 0 20px 45px rgba(33, 48, 77, 0.12);
    --shadow-card: 0 18px 40px rgba(33, 48, 77, 0.14);

    /* Typography */
    --font: 'Atkinson Hyperlegible', 'Segoe UI', Arial, sans-serif;
    --font-mono: 'DM Mono', Consolas, monospace;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: var(--font);
    cursor: pointer;
}

input,
select,
textarea {
    font-family: var(--font);
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

/*side nav*/
.sidebar {
    width: var(--sidebar-w);
    background: #21304d;
    border-right: 1px solid var(--border);
    color: #f5f8ff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 22px 18px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.logo-inner {
    display: flex;
    align-items: center;
    gap: 11px;
}

.logo-bubble {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
    box-shadow: 0 2px 12px var(--accent-glow);
    overflow: hidden;
}

.logo-bubble img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar .logo-inner {
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.sidebar .logo-bubble {
    width: 200px;
    height: 80px;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.logo-name {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.4px;
    line-height: 1.1;
}

.logo-label {
    font-size: 9.5px;
    letter-spacing: 2px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    text-transform: uppercase;
}

.sidebar-nav {
    padding: 14px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-group-label {
    font-size: 9.5px;
    font-family: var(--font-mono);
    color: rgba(245, 247, 255, 0.55);
    letter-spacing: 1.8px;
    text-transform: uppercase;
    padding: 12px 10px 5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    position: relative;
    color: #ffffff;
    font-weight: 600;
    line-height: 1.2;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.12);
}

.nav-item.active {
    background: rgba(249, 163, 30, 0.16);
    color: #f9a31e;
    border-color: rgba(249, 163, 30, 0.35);
}

.nav-item.active .nav-icon img {
    filter: brightness(0) saturate(100%) invert(69%) sepia(89%) saturate(1149%) hue-rotate(346deg) brightness(101%) contrast(95%);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: #f9a31e;
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    width: 30px;
    height: 30px;
    text-align: center;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-icon img {
    width: 22px;
    height: 22px;
    display: block;
    filter: brightness(0) invert(1);
}

.nav-badge {
    margin-left: auto;
    background: rgba(249, 163, 30, 0.2);
    color: #f9a31e;
    font-size: 10px;
    font-family: var(--font-mono);
    padding: 1px 7px;
    border-radius: 99px;
}

.sidebar-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar .btn-logout {
    color: rgba(245, 247, 255, 0.7);
    border-color: rgba(255, 255, 255, 0.18);
}

.sidebar .btn-logout:hover {
    border-color: #f9a31e;
    color: #f9a31e;
    background: rgba(249, 163, 30, 0.12);
}

.admin-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-av {
    width: 34px;
    height: 34px;
    background: linear-gradient(135deg, #9f4812 0%, #e89e30 170%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.admin-av img {
    width: 18px;
    height: 18px;
    display: block;
    filter: brightness(0) invert(1);
}

.btn-logout svg,
.topbar-back svg {
    width: 18px;
    height: 18px;
}

.admin-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.admin-role {
    font-size: 10.5px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.sidebar .admin-name {
    color: #f5f8ff;
}

.sidebar .admin-role {
    color: rgba(245, 247, 255, 0.6);
}

.main-wrap {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/*topbar*/
.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.topbar,
.topbar-title {
    color: var(--text);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 9px;
    line-height: 1.25;
    min-width: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.flash-banner {
    margin: 12px 28px 0;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.flash-error {
    border-color: rgba(220, 38, 38, 0.25);
    background: var(--error-bg);
    color: var(--error);
}

.flash-info {
    border-color: rgba(31, 95, 168, 0.22);
    background: var(--accent-dim);
    color: var(--accent);
}

.admin-menu {
    position: relative;
}

.admin-menu summary {
    list-style: none;
}

.admin-menu summary::-webkit-details-marker {
    display: none;
}

.admin-row--menu {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 8px 12px;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    gap: 12px;
}

.admin-row--menu:hover {
    border-color: rgba(15, 23, 42, 0.2);
}

.admin-row--menu .admin-av {
    width: 32px;
    height: 32px;
}

.topbar .admin-name {
    color: var(--text);
}

.topbar .admin-role {
    color: var(--text-muted);
}

.admin-caret {
    color: var(--text-muted);
    margin-left: 6px;
}

.admin-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 210px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    box-shadow: var(--shadow-soft);
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 250;
}

.admin-menu[open] .admin-dropdown {
    display: flex;
}

.dropdown-item {
    border: none;
    background: transparent;
    text-align: left;
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    font-family: var(--font);
    transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-item:hover {
    background: var(--accent-dim);
    color: var(--accent);
}

.page-content {
    padding: 28px;
    flex: 1;
}

/*breadcrumbs navigation*/
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 22px;
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.breadcrumb .icon {
    font-size: 14px;
}

.breadcrumb a {
    color: var(--accent);
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.bc-sep {
    color: var(--text-dim);
}

.grid {
    display: grid;
    gap: 18px;
}

.g-2 {
    grid-template-columns: repeat(2, 1fr);
}

.g-3 {
    grid-template-columns: repeat(3, 1fr);
}

.g-4 {
    grid-template-columns: repeat(4, 1fr);
}

.g-5 {
    grid-template-columns: repeat(5, 1fr);
}

.g-1-2 {
    grid-template-columns: 1fr 2fr;
}

.g-2-1 {
    grid-template-columns: 2fr 1fr;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px;
    
}

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

.card-title {
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title .icon {
    font-size: 14px;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-accent {
    position: relative;
}

.card-accent::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--accent) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.card-accent:hover::after {
    opacity: 1;
}

.stat-tile {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 0;
}

.stat-tile:hover {
    border-color: var(--border-light);
    box-shadow: 0 0 0 1px var(--border-light), var(--shadow-sm);
}

.stat-tile-icon {
    font-size: 20px;
    margin-bottom: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.stat-tile-label {
    font-size: 15px;
    font-family: var(--font-mono);
    font-weight: 300;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.stat-tile-value {
    font-size: 38px;
    font-weight: 900;
    color: #000;
    letter-spacing: -1px;
    line-height: 1;
}

.stat-tile-sub {
    font-size: 12px;
    color: #000;
    margin-top: 2px;
    line-height: 1.35;
}

.stat-tile-glow {
    position: absolute;
    right: -20px;
    top: -20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--accent-dim);
    filter: blur(20px);
    pointer-events: none;
}
/*d-rows*/
.detail-list {
    display: flex;
    flex-direction: column;
}

.detail-row {
    display: grid;
    grid-template-columns: minmax(112px, 0.42fr) minmax(0, 1fr);
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
    gap: 16px;
    min-height: 44px;
}

.detail-row:last-child {
    border-bottom: none;
}

.dl-label {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.dl-value {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    min-width: 0;
    overflow-wrap: anywhere;
}

.dl-mono {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}


.profile-hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 22px;
    position: relative;
    overflow: hidden;
    margin-bottom: 22px;
}

.profile-hero::before {
    content: '';
    position: absolute;
    right: -60px;
    top: -60px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}

.ph-avatar {
    width: 76px;
    height: 76px;
    background: var(--surface3);
    border: 2px solid var(--border-light);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    flex-shrink: 0;
}

.ph-avatar .icon {
    font-size: 34px;
}

.ph-info {
    flex: 1;
    min-width: 0;
}

.ph-name {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.6px;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ph-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.ph-meta-item-1 {
    font-size: 12px;
    font-family: var(--font-mono);
    color: rgb(18, 16, 16);
    display: flex;
    align-items: center;
    gap: 5px;
}
.ph-meta-item-2 {
    font-size: 12px;
    color: grey;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ph-meta-item {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
}

.ph-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.ph-actions .btn {
    min-width: 124px;
}

/*tables*/
.table-wrap {
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    padding: 13px 16px;
    text-align: left;
    font-size: 12px;
    font-family: var(--font);
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    font-weight: 700;
}

tbody td {
    padding: 14px 16px;
    font-size: 14px;
    color: #000;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-weight: 500;
}

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

tbody tr {
    transition: background 0.1s;
}

tbody tr:hover {
    background: var(--surface2);
}

.td-mono {
    font-family: var(--font);
    font-size: 13.5px;
    color: #000;
}

.td-link {
    color: #1d4ed8;
    font-weight: 700;
    font-size: 14px;
}

.td-link:hover {
    color: #1e3a8a;
    text-decoration: underline;
}

.td-name {
    font-weight: 700;
    color: #000;
}

.td-last-access {
    color: #667085;
    font-family: var(--font-mono);
    font-size: 12.5px;
    font-weight: 500;
}

.td-avatar {
    display: flex;
    align-items: center;
    gap: 9px;
}

.table-wrap .badge {
    font-size: 13px;
    padding: 5px 11px;
}

.table-wrap .badge-neutral {
    color: #000;
    background: rgba(0, 0, 0, 0.06);
}

.table-wrap .text-success,
.table-wrap .text-error {
    font-size: 14px;
    font-weight: 700;
}

/*log rows*/
.log-list {
    display: flex;
    flex-direction: column;
}

.log-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.log-row:last-child {
    border-bottom: none;
}

.log-date {
    font-family: var(--font-mono);
    color: var(--text-dim);
    white-space: nowrap;
    font-size: 11px;
    min-width: 90px;
}

.log-content {
    flex: 1;
    color: var(--text);
}

.log-by {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 11px;
    white-space: nowrap;
}

.log-empty {
    padding: 18px 20px;
    font-size: 12px;
    color: var(--text-dim);
    font-family: var(--font-mono);
    font-style: italic;
}

.grid.logs-page-grid {
    align-items: start;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.child-link-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
}

.child-link-card:last-child {
    border-bottom: none;
}

.child-link-card:hover {
    background: var(--surface2);
}

.clc-avatar {
    font-size: 24px;
}

.clc-avatar .icon {
    font-size: 20px;
}

.clc-info {
    flex: 1;
}

.clc-name {
    font-weight: 600;
    font-size: 13px;
}

.clc-meta {
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    margin-top: 1px;
}

.clc-arrow {
    color: var(--text-dim);
}

/*search space */
.search-box-wrap {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.search-type-tabs {
    display: flex;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px;
    width: fit-content;
    gap: 2px;
}

.stab {
    padding: 8px 22px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.15s;
}

.stab.active {
    background: #21304d;
    color: #fff;
    box-shadow: 0 2px 10px var(--accent-glow);
}

.search-input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.input-wrap {
    position: relative;
    flex: 1;
    max-width: 520px;
    flex: 1;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;

}

.input-ico {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    font-size: 15px;
    pointer-events: none;
}

.search-box-wrap .text-input {
    background: #fff;
    color: var(--text);
    border-color: rgba(33, 48, 77, 0.2);
    box-shadow: 0 6px 16px rgba(33, 48, 77, 0.12);
    padding-left: 14px;
}

.search-box-wrap .text-input::placeholder {
    color: var(--text-dim);
}

.search-box-wrap .text-input:focus {
    box-shadow: 0 0 0 3px rgba(249, 163, 30, 0.18), 0 10px 22px rgba(33, 48, 77, 0.15);
    border-color: #f9a31e;
}

.text-input {
    width: 100%;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px 10px 38px;
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.text-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.text-input::placeholder {
    color: var(--text-dim);
}

.registry-card .card-header {
    align-items: center;
}

.registry-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.registry-add {
    min-width: 96px;
    min-height: 34px;
    justify-content: center;
}

.registry-card .btn::after {
    display: none;
}

.registry-toolbar {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}

.filter-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.filter-search {
    flex: 1 1 300px;
    max-width: 360px;
    min-width: 240px;
}

.filter-search .text-input {
    min-height: 38px;
    padding-left: 14px;
}

.filter-form .filter-select {
    flex: 0 0 150px;
    width: auto;
    min-height: 38px;
    padding-right: 34px;
    background:
        linear-gradient(45deg, transparent 50%, #667085 50%) calc(100% - 17px) 52% / 5px 5px no-repeat,
        linear-gradient(135deg, #667085 50%, transparent 50%) calc(100% - 12px) 52% / 5px 5px no-repeat,
        #fff;
    box-shadow: 0 1px 0 rgba(33, 48, 77, 0.04);
}

.filter-form .filter-select:hover,
.filter-search .text-input:hover {
    border-color: rgba(33, 48, 77, 0.28);
}

.filter-form .filter-submit {
    min-height: 38px;
    min-width: 74px;
    justify-content: center;
}

/*search results*/
.result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 20px;
    border-bottom: 1px solid var(--border);
    transition: background 0.1s;
    cursor: pointer;
}

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

.result-item:hover {
    background: var(--surface2);
}

.ri-avatar {
    width: 42px;
    height: 42px;
    background: var(--surface3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    flex-shrink: 0;
}

.ri-info {
    flex: 1;
    min-width: 0;
}

.ri-name {
    font-weight: 600;
    font-size: 14px;
}

.ri-meta {
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
}

.ri-arrow {
    color: var(--text-dim);
    font-size: 16px;
}

.ri-link {
    color: var(--accent);
    font-weight: 600;
}

.ri-link:hover {
    text-decoration: underline;
}

/*blank state */
.empty-state {
    text-align: center;
    padding: 48px 20px;
}

.es-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
}

.es-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.es-desc {
    font-size: 13px;
    color: var(--text-muted);
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-up {
    animation: fadeUp 0.3s ease both;
}

.d1 {
    animation-delay: 0.04s;
}

.d2 {
    animation-delay: 0.08s;
}

.d3 {
    animation-delay: 0.12s;
}

.d4 {
    animation-delay: 0.16s;
}

.icon {
    font-family: 'Material Symbols Rounded';
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    vertical-align: middle;
}

.icon--xs {
    font-size: 14px;
}

.icon--sm {
    font-size: 16px;
}

.icon--md {
    font-size: 18px;
}

.icon--lg {
    font-size: 22px;
}

.icon--xl {
    font-size: 28px;
}

.icon--gap {
    margin-right: 6px;
}

.mb-4 {
    margin-bottom: 4px;
}

.mb-8 {
    margin-bottom: 8px;
}

.mb-16 {
    margin-bottom: 16px;
}

.mb-22 {
    margin-bottom: 22px;
}

.mt-8 {
    margin-top: 8px;
}

.mt-16 {
    margin-top: 16px;
}

.gap-8 {
    gap: 8px;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.w-full {
    width: 100%;
}

.text-muted {
    color: var(--text-muted);
}

.text-mono {
    font-family: var(--font-mono);
}

.text-sm {
    font-size: 12px;
}

.fw-600 {
    font-weight: 600;
}

.text-success {
    color: var(--success);
}

.text-error {
    color: var(--error);
}

.text-warning {
    color: var(--warning);
}


::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--text-primary);
    font-size: 13px;
    font-family: var(--font-family-sans-serif);
    cursor: pointer;
    transition: background 0.15s;
}
.pg-btn:hover:not(:disabled) {
    background: var(--light);
}
.pg-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.pg-btn.pg-active {
    background: #21304D;
    color: #fff;
    border-color: #21304D;
    font-weight: 500;
}
.pg-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 13px;
    color: var(--text-secondary);
}

.rel-tag{
    display: block;
    margin-bottom: 4%;
}
@media (max-width: 900px) {
    .responsive-table,
    .responsive-table thead,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table th,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table {
        min-width: 0;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table-wrap {
        overflow-x: visible;
    }

    .responsive-table tbody {
        display: grid;
        gap: 12px;
        padding: 12px;
    }

    .responsive-table tbody tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 14px;
        row-gap: 2px;
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        background: rgba(255, 255, 255, 0.35);
    }

    .responsive-table tbody tr:hover {
        background: rgba(255, 255, 255, 0.58);
    }

    .responsive-table tbody td {
        min-width: 0;
        padding: 7px 0;
        border-bottom: none;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        font-size: 14px;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .responsive-table tbody td::before {
        content: attr(data-label);
        font-family: var(--font-mono);
        font-size: 10px;
        font-weight: 700;
        letter-spacing: 0.8px;
        text-transform: uppercase;
        color: var(--text-muted);
    }

    .responsive-table tbody td:first-child,
    .responsive-table tbody td[data-label="Email"],
    .responsive-table tbody td[data-label="M-Pesa Numbers"],
    .responsive-table tbody td[data-label="School"],
    .responsive-table tbody td[data-label="M-Pesa Receipt"],
    .responsive-table tbody td[data-label="Merchant Request ID"],
    .responsive-table tbody td[data-label="Callback Response"],
    .responsive-table tbody td[data-label="Last Access"],
    .responsive-table tbody td[data-label="Action"] {
        grid-column: 1 / -1;
    }

    .responsive-table tbody td:first-child {
        padding-bottom: 10px;
        border-bottom: 1px solid var(--border);
        font-size: 16px;
    }

    .responsive-table tbody td[data-label="Action"] {
        padding-top: 12px;
        margin-top: 4px;
        border-top: 1px solid var(--border);
    }

    .responsive-table .td-avatar,
    .responsive-table .btn-table-action {
        width: 100%;
    }

    .responsive-table .btn-table-action {
        min-height: 38px;
    }
}

@media (max-width: 1100px) {
    .g-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 800px) {

    .grid {
        gap: 12px;
    }

    .g-2,
    .g-3,
    .g-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .g-1-2,
    .g-2-1 {
        grid-template-columns: 1fr;
    }

    .g-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-tile {
        min-height: 128px;
        padding: 14px;
    }

    .stat-tile-label {
        font-size: 11.5px;
        letter-spacing: 0.9px;
        line-height: 1.25;
    }

    .stat-tile-value {
        font-size: 30px;
        letter-spacing: 0;
    }

    .stat-tile-sub {
        font-size: 11px;
    }
}

@media (max-width: 640px) {
    :root {
        --sidebar-w: 0px;
        --topbar-h: 58px;
    }

    .sidebar {
        top: auto;
        right: 0;
        bottom: 0;
        width: 100%;
        height: calc(78px + env(safe-area-inset-bottom));
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.14);
        overflow-x: auto;
        overflow-y: hidden;
        box-shadow: 0 -10px 28px rgba(33, 48, 77, 0.18);
    }

    .sidebar-logo,
    .sidebar-footer,
    .nav-group-label {
        display: none;
    }

    .sidebar-nav {
        height: 100%;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
        flex-direction: row;
        align-items: stretch;
        gap: 6px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-item {
        flex: 1 0 78px;
        min-width: 78px;
        max-width: 120px;
        justify-content: center;
        flex-direction: column;
        gap: 4px;
        padding: 7px 8px;
        font-size: 11.5px;
        font-weight: 700;
        text-align: center;
        line-height: 1.15;
        white-space: normal;
    }

    .nav-item.active::before {
        left: 18%;
        right: 18%;
        top: auto;
        bottom: -1px;
        width: auto;
        height: 3px;
        border-radius: 3px 3px 0 0;
    }

    .nav-icon {
        width: 34px;
        height: 28px;
    }

    .nav-icon img {
        width: 24px;
        height: 24px;
    }

    .main-wrap {
        width: 100%;
        margin-left: 0;
        padding-bottom: calc(78px + env(safe-area-inset-bottom));
    }

    .page-content {
        padding: 14px;
    }

    .topbar {
        padding: 0 12px;
        gap: 10px;
    }

    .flash-banner {
        margin: 10px 14px 0;
    }

    .topbar-left {
        min-width: 0;
        gap: 10px;
    }

    .topbar-title {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 15px;
    }

    .topbar-right {
        flex-shrink: 0;
        gap: 6px;
    }

    .admin-row--menu {
        padding: 7px 8px;
        gap: 8px;
    }

    .admin-caret {
        margin-left: 0;
    }

    .ph-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        justify-content: stretch;
        width: 100%;
    }

    .ph-actions .btn {
        width: 100%;
        flex: none;
        min-width: 0;
    }

    .ph-actions .btn:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .profile-hero {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 18px;
    }

    .ph-name {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        line-height: 1.15;
    }

    .mobile-stack-grid {
        grid-template-columns: 1fr;
    }

    .grid.logs-page-grid {
        grid-template-columns: 1fr;
    }

    .log-row {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 5px 10px;
    }

    .log-date {
        min-width: auto;
    }

    .log-content {
        flex: 1 1 calc(100% - 110px);
        min-width: 0;
        overflow-wrap: anywhere;
    }

    .log-by {
        width: 100%;
        white-space: normal;
    }

    .search-input-row {
        align-items: stretch;
        flex-direction: column;
    }

    .input-wrap {
        max-width: none;
    }

    .registry-card .card-header {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
        padding: 14px 12px;
    }

    .registry-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        justify-content: stretch;
        gap: 8px;
        width: 100%;
    }

    .registry-actions .badge,
    .registry-actions .btn {
        min-height: 36px;
        justify-content: center;
    }

    .registry-actions .badge {
        justify-self: end;
    }

    .registry-actions .clear-filters {
        grid-column: 1 / -1;
    }

    .registry-toolbar {
        padding: 12px;
    }

    .filter-form {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .filter-search {
        grid-column: 1 / -1;
        min-width: 0;
        max-width: none;
    }

    .filter-form .filter-select {
        width: 100%;
        min-width: 0;
        flex: none;
    }

    .filter-form .filter-submit {
        grid-column: 1 / -1;
        width: 100%;
        min-height: 40px;
    }

    .search-type-tabs {
        width: 100%;
    }

    .stab {
        flex: 1;
        justify-content: center;
        padding: 9px 12px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .topbar .admin-meta {
        display: none;
    }

    .admin-row--menu .admin-av {
        width: 34px;
        height: 34px;
    }

    .admin-dropdown {
        right: -2px;
        min-width: 180px;
    }

    .g-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .g-2,
    .g-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mobile-stack-grid {
        grid-template-columns: 1fr;
    }

    .stat-tile {
        min-height: 118px;
        padding: 12px;
    }

    .filter-form {
        grid-template-columns: 1fr;
    }

    .responsive-table tbody {
        padding: 10px;
    }

    .responsive-table tbody tr {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 12px;
        padding: 12px;
    }
}
