/* Go4Health Design System */
:root {
    --g4h-primary: #4A8EC2;
    --g4h-primary-dark: #3874A3;
    --g4h-primary-light: #E8F1F8;
    --g4h-accent: #0e9f6e;
    --g4h-accent-dark: #047857;
    --g4h-bg: #F4F7FA;
    --g4h-card: #FFFFFF;
    --g4h-text: #1E293B;
    --g4h-text-muted: #64748B;
    --g4h-border: #E2E8F0;
    --g4h-radius: 12px;
    --g4h-shadow: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
    --g4h-shadow-lg: 0 4px 6px rgba(0,0,0,.04), 0 10px 24px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--g4h-text);
    background: var(--g4h-bg);
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

/* ── Navbar ── */
.g4h-navbar {
    background: #fff;
    border-bottom: 1px solid var(--g4h-border);
    padding: .6rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.g4h-navbar .g4h-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.g4h-brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    text-decoration: none;
    color: var(--g4h-text);
    font-weight: 700;
    font-size: 1.1rem;
}
.g4h-brand:hover { color: var(--g4h-primary); text-decoration: none; }
.g4h-brand img {
    height: 36px;
    width: 36px;
    border-radius: 8px;
}
.g4h-nav-actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}
.g4h-nav-user {
    color: var(--g4h-text-muted);
    font-size: .875rem;
}

/* ── Auth pages (login, forgot password, etc.) ── */
.g4h-auth-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #E8F1F8 0%, var(--g4h-bg) 50%, #E0F2EC 100%);
    padding: 1.5rem;
}
.g4h-auth-card {
    background: var(--g4h-card);
    border-radius: var(--g4h-radius);
    box-shadow: var(--g4h-shadow-lg);
    width: 100%;
    max-width: 440px;
    padding: 2.5rem 2rem;
    text-align: center;
}
.g4h-auth-card .g4h-logo {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(74,142,194,.15);
}
.g4h-auth-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: .25rem;
    color: var(--g4h-text);
}
.g4h-auth-card .g4h-subtitle {
    color: var(--g4h-text-muted);
    font-size: .95rem;
    margin-bottom: 1.75rem;
}

/* ── Forms ── */
.g4h-form { text-align: left; }
.g4h-form label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--g4h-text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .35rem;
}
.g4h-form input[type="email"],
.g4h-form input[type="password"],
.g4h-form input[type="text"],
.g4h-form textarea,
.g4h-form select {
    width: 100%;
    padding: .65rem .85rem;
    border: 1.5px solid var(--g4h-border);
    border-radius: 8px;
    font-size: .95rem;
    color: var(--g4h-text);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    outline: none;
}
.g4h-form input:focus,
.g4h-form textarea:focus,
.g4h-form select:focus {
    border-color: var(--g4h-primary);
    box-shadow: 0 0 0 3px rgba(74,142,194,.12);
}
.g4h-form .g4h-field { margin-bottom: 1.15rem; }
.g4h-form .g4h-field:last-of-type { margin-bottom: 1.5rem; }

/* ── Buttons ── */
.g4h-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    padding: .6rem 1.25rem;
    border-radius: 8px;
    font-size: .9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background .2s, box-shadow .2s, transform .1s;
    text-decoration: none;
    line-height: 1.4;
}
.g4h-btn:active { transform: scale(.98); }

.g4h-btn-primary {
    background: var(--g4h-primary);
    color: #fff;
}
.g4h-btn-primary:hover {
    background: var(--g4h-primary-dark);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(74,142,194,.25);
}

.g4h-btn-accent {
    background: var(--g4h-accent);
    color: #fff;
}
.g4h-btn-accent:hover {
    background: var(--g4h-accent-dark);
    color: #fff;
    text-decoration: none;
}

.g4h-btn-outline {
    background: transparent;
    color: var(--g4h-text-muted);
    border: 1.5px solid var(--g4h-border);
}
.g4h-btn-outline:hover {
    background: var(--g4h-bg);
    color: var(--g4h-text);
    text-decoration: none;
}

.g4h-btn-sm {
    padding: .35rem .85rem;
    font-size: .8rem;
    border-radius: 6px;
}

.g4h-btn-block { width: 100%; }

.g4h-btn-link {
    background: none;
    border: none;
    color: var(--g4h-primary);
    font-weight: 500;
    padding: 0;
    cursor: pointer;
}
.g4h-btn-link:hover { color: var(--g4h-primary-dark); text-decoration: underline; }

/* ── Cards ── */
.g4h-card {
    background: var(--g4h-card);
    border-radius: var(--g4h-radius);
    box-shadow: var(--g4h-shadow);
    border: 1px solid var(--g4h-border);
    overflow: hidden;
}
.g4h-card-body { padding: 1.5rem; }
.g4h-card-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 1rem;
    color: var(--g4h-text);
}

/* ── Tables ── */
.g4h-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}
.g4h-table th {
    text-align: left;
    padding: .75rem 1rem;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--g4h-text-muted);
    background: var(--g4h-bg);
    border-bottom: 1px solid var(--g4h-border);
}
.g4h-table td {
    padding: .75rem 1rem;
    border-bottom: 1px solid var(--g4h-border);
    vertical-align: middle;
}
.g4h-table tbody tr:last-child td { border-bottom: none; }
.g4h-table tbody tr:hover { background: var(--g4h-primary-light); }

/* ── Alerts ── */
.g4h-alert {
    padding: .75rem 1rem;
    border-radius: 8px;
    font-size: .9rem;
    margin-bottom: 1.25rem;
    text-align: left;
}
.g4h-alert-error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}
.g4h-alert-success {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}
.g4h-alert-info {
    background: var(--g4h-primary-light);
    color: var(--g4h-primary-dark);
    border: 1px solid #BFDBFE;
}

/* ── Badges ── */
.g4h-badge {
    display: inline-block;
    padding: .2rem .6rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
}
.g4h-badge-active { background: #DCFCE7; color: #166534; }
.g4h-badge-inactive { background: #FEF3C7; color: #92400E; }

/* ── Page header ── */
.g4h-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: .75rem;
}
.g4h-page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

/* ── Stats row ── */
.g4h-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.g4h-stat {
    background: var(--g4h-card);
    border-radius: var(--g4h-radius);
    box-shadow: var(--g4h-shadow);
    border: 1px solid var(--g4h-border);
    padding: 1.25rem 1.5rem;
}
.g4h-stat-label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--g4h-text-muted);
    margin-bottom: .25rem;
}
.g4h-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--g4h-text);
}

/* ── Description list ── */
.g4h-dl { margin: 0; }
.g4h-dl dt {
    font-size: .8rem;
    font-weight: 600;
    color: var(--g4h-text-muted);
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: .15rem;
}
.g4h-dl dd {
    margin: 0 0 .85rem;
    font-size: .95rem;
    color: var(--g4h-text);
}
.g4h-dl dd:last-child { margin-bottom: 0; }

/* ── Message pages (success, sent, etc.) ── */
.g4h-message-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.g4h-message-icon-success {
    background: #DCFCE7;
    color: #16A34A;
}
.g4h-message-icon-info {
    background: var(--g4h-primary-light);
    color: var(--g4h-primary);
}
.g4h-message-icon-error {
    background: #FEF2F2;
    color: #DC2626;
}

/* ── Utility ── */
.g4h-container { max-width: 1080px; margin: 0 auto; padding: 0 1rem; }
.g4h-py { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.g4h-mb { margin-bottom: 1.5rem; }
.g4h-text-muted { color: var(--g4h-text-muted); }
.g4h-text-sm { font-size: .85rem; }
.g4h-text-center { text-align: center; }
.g4h-back-link {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: var(--g4h-text-muted);
    font-size: .875rem;
    text-decoration: none;
    margin-bottom: 1rem;
}
.g4h-back-link:hover { color: var(--g4h-primary); }

.g4h-grid {
    display: grid;
    gap: 1rem;
}
.g4h-grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* ── Details/Summary ── */
details summary {
    cursor: pointer;
    user-select: none;
}
details[open] summary { margin-bottom: .75rem; }

/* ── Checkbox list ── */
.g4h-check-list { margin-top: .5rem; }
.g4h-check-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .35rem 0;
    font-size: .9rem;
}
.g4h-check-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--g4h-primary);
}

/* ── Spinner ── */
.g4h-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: g4h-spin .6s linear infinite;
}
@keyframes g4h-spin { to { transform: rotate(360deg); } }

/* ── Modal ── */
.g4h-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.g4h-overlay.active { display: flex; }
.g4h-modal {
    background: var(--g4h-card);
    border-radius: var(--g4h-radius);
    box-shadow: var(--g4h-shadow-lg);
    width: 100%;
    max-width: 480px;
    padding: 1.75rem;
    margin: 1rem;
}
.g4h-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
.g4h-modal-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}
.g4h-modal-close {
    background: none;
    border: none;
    font-size: 1.3rem;
    color: var(--g4h-text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}
.g4h-modal-close:hover { color: var(--g4h-text); }

/* ── Admin toolbar ── */
.g4h-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    margin-bottom: 1rem;
}
.g4h-search-wrap {
    flex: 1;
    min-width: 200px;
    position: relative;
}
.g4h-search {
    width: 100%;
    padding: .55rem .75rem .55rem 2.2rem;
    border: 1.5px solid var(--g4h-border);
    border-radius: 8px;
    font-size: .875rem;
    color: var(--g4h-text);
    background: #fff;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.g4h-search:focus {
    border-color: var(--g4h-primary);
    box-shadow: 0 0 0 3px rgba(74,142,194,.12);
}
.g4h-search-icon {
    position: absolute;
    left: .7rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--g4h-text-muted);
    font-size: .85rem;
    pointer-events: none;
}
.g4h-search-hint {
    position: absolute;
    right: .6rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--g4h-bg);
    border: 1px solid var(--g4h-border);
    border-radius: 4px;
    padding: 0 .35rem;
    font-size: .65rem;
    color: var(--g4h-text-muted);
    line-height: 1.6;
    pointer-events: none;
}
.g4h-search:focus ~ .g4h-search-hint { display: none; }

.g4h-toolbar select {
    padding: .55rem .75rem;
    border: 1.5px solid var(--g4h-border);
    border-radius: 8px;
    font-size: .875rem;
    background: #fff;
    color: var(--g4h-text);
    cursor: pointer;
    outline: none;
}
.g4h-toolbar select:focus {
    border-color: var(--g4h-primary);
    box-shadow: 0 0 0 3px rgba(74,142,194,.12);
}
.g4h-counter {
    font-size: .8rem;
    color: var(--g4h-text-muted);
    white-space: nowrap;
}
.g4h-toolbar .g4h-counter { margin-left: auto; }

/* ── Pagination ── */
.g4h-pag {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    padding: .75rem 0;
}
.g4h-pag-btn {
    min-width: 2rem;
    height: 2rem;
    padding: 0 .5rem;
    border: 1px solid var(--g4h-border);
    border-radius: 6px;
    background: #fff;
    font-size: .8rem;
    color: var(--g4h-text);
    cursor: pointer;
    transition: all .15s;
}
.g4h-pag-btn:hover:not(:disabled):not(.active) {
    border-color: var(--g4h-primary);
    color: var(--g4h-primary);
}
.g4h-pag-btn.active {
    background: var(--g4h-primary);
    border-color: var(--g4h-primary);
    color: #fff;
}
.g4h-pag-btn:disabled {
    opacity: .35;
    cursor: default;
}
.g4h-pag-dots {
    padding: 0 .25rem;
    color: var(--g4h-text-muted);
    font-size: .8rem;
}

/* ── Sort indicators ── */
th[data-sort] {
    cursor: pointer;
    position: relative;
    padding-right: 1.3rem !important;
    user-select: none;
    transition: color .15s;
}
th[data-sort]:hover { color: var(--g4h-primary); }
th[data-sort]::after {
    content: '\2195';
    position: absolute;
    right: .3rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: .25;
    font-size: .7rem;
}
th.sort-asc::after { content: '\2191'; opacity: .8; color: var(--g4h-primary); }
th.sort-desc::after { content: '\2193'; opacity: .8; color: var(--g4h-primary); }

/* ── Export button ── */
.g4h-btn-export {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .45rem .85rem;
    font-size: .8rem;
    font-weight: 500;
    border: 1.5px solid var(--g4h-border);
    border-radius: 8px;
    background: #fff;
    color: var(--g4h-text-muted);
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.g4h-btn-export:hover {
    border-color: var(--g4h-primary);
    color: var(--g4h-primary);
}

/* ── Empty state ── */
.g4h-empty-cell {
    text-align: center;
    padding: 2.5rem 1rem !important;
    color: var(--g4h-text-muted);
    font-style: italic;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .g4h-nav-actions {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        scrollbar-width: none;
    }
    .g4h-nav-actions::-webkit-scrollbar { display: none; }
    .g4h-toolbar { gap: .5rem; }
    .g4h-search-wrap { min-width: 100%; }
    .g4h-search-hint { display: none; }
}
@media (max-width: 640px) {
    .g4h-auth-card { padding: 2rem 1.25rem; }
    .g4h-card-body { padding: 1rem; }
    .g4h-page-header { flex-direction: column; align-items: flex-start; }
    .g4h-table { font-size: .8rem; }
    .g4h-table th, .g4h-table td { padding: .6rem .5rem; }
    .g4h-pag { flex-wrap: wrap; }
}
