/* ===== TSCF Registry - Complete CSS (matching React theme exactly) ===== */
:root {
    --background: hsl(210, 20%, 98%);
    --foreground: hsl(215, 25%, 15%);
    --card: hsl(0, 0%, 100%);
    --card-foreground: hsl(215, 25%, 15%);
    --primary: hsl(174, 62%, 35%);
    --primary-foreground: hsl(0, 0%, 100%);
    --secondary: hsl(215, 25%, 93%);
    --secondary-foreground: hsl(215, 25%, 15%);
    --muted: hsl(210, 15%, 95%);
    --muted-foreground: hsl(215, 15%, 50%);
    --accent: hsl(174, 40%, 92%);
    --accent-foreground: hsl(174, 62%, 25%);
    --destructive: hsl(0, 72%, 51%);
    --destructive-foreground: hsl(0, 0%, 100%);
    --border: hsl(214, 20%, 90%);
    --input: hsl(214, 20%, 90%);
    --ring: hsl(174, 62%, 35%);
    --radius: 0.625rem;
    --success: hsl(152, 60%, 40%);
    --success-foreground: hsl(0, 0%, 100%);
    --warning: hsl(38, 92%, 50%);
    --warning-foreground: hsl(0, 0%, 100%);
    --info: hsl(210, 80%, 55%);
    --info-foreground: hsl(0, 0%, 100%);
    --sidebar-bg: hsl(215, 30%, 12%);
    --sidebar-fg: hsl(210, 15%, 85%);
    --sidebar-active: hsl(174, 62%, 35%);
    --sidebar-hover: hsl(215, 25%, 18%);
    --sidebar-border: hsl(215, 25%, 20%);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--background);
    color: var(--foreground);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}
h1,h2,h3,h4,h5,h6 { font-family: 'Plus Jakarta Sans', sans-serif; }
a { color: inherit; text-decoration: none; }

/* ===== Layout ===== */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
    width: 256px;
    background: linear-gradient(180deg, var(--sidebar-bg) 0%, hsl(215, 30%, 8%) 100%);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
    z-index: 50;
}
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* Sidebar Logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--sidebar-hover);
}
.sidebar-logo-icon {
    width: 36px; height: 36px;
    border-radius: 8px;
    background: var(--sidebar-active);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sidebar-logo-icon i, .sidebar-logo-icon svg { width: 20px; height: 20px; color: var(--primary-foreground); }
.sidebar-logo-text h1 { font-size: 14px; font-weight: 700; color: var(--primary-foreground); letter-spacing: -0.025em; line-height: 1.2; }
.sidebar-logo-text p { font-size: 11px; color: rgba(210, 215, 225, 0.6); }

/* Sidebar Nav */
.sidebar-nav { flex: 1; padding: 16px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 8px;
    font-size: 14px; font-weight: 500;
    color: rgba(210, 215, 225, 0.7);
    transition: all 0.15s;
}
.nav-link:hover { background: var(--sidebar-hover); color: var(--sidebar-fg); }
.nav-link.active { background: rgba(45, 166, 153, 0.15); color: var(--sidebar-active); }
.nav-link i, .nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Sidebar User */
.sidebar-user {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 16px;
    border-top: 1px solid var(--sidebar-hover);
}
.sidebar-user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(45, 166, 153, 0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: var(--sidebar-active);
    flex-shrink: 0;
}
.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-name { font-size: 12px; font-weight: 600; color: var(--sidebar-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 10px; color: rgba(210, 215, 225, 0.5); }
.sidebar-logout {
    padding: 6px; border-radius: 6px; color: rgba(210, 215, 225, 0.4);
    transition: all 0.15s; cursor: pointer; background: none; border: none;
}
.sidebar-logout:hover { color: var(--sidebar-fg); background: var(--sidebar-hover); }
.sidebar-logout i, .sidebar-logout svg { width: 16px; height: 16px; }

/* Top Bar */
.top-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 24px;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 30;
}
.top-bar-left { display: flex; align-items: center; gap: 12px; flex: 1; max-width: 400px; }
.search-bar { display: flex; align-items: center; gap: 8px; flex: 1; }
.search-bar i, .search-bar svg { width: 16px; height: 16px; color: var(--muted-foreground); }
.search-bar input { flex: 1; background: none; border: none; outline: none; font-size: 14px; color: var(--foreground); }
.search-bar input::placeholder { color: var(--muted-foreground); }
.notification-btn { position: relative; padding: 8px; border-radius: 8px; background: none; border: none; cursor: pointer; transition: background 0.15s; }
.notification-btn:hover { background: var(--muted); }
.notification-btn i, .notification-btn svg { width: 16px; height: 16px; color: var(--muted-foreground); }
.notification-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; background: var(--destructive); border-radius: 50%; }
.mobile-menu-btn { display: none; padding: 8px; margin-left: -8px; border-radius: 8px; background: none; border: none; cursor: pointer; }
.mobile-menu-btn i, .mobile-menu-btn svg { width: 20px; height: 20px; }

/* Content */
.content { flex: 1; padding: 24px; }
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 24px; font-weight: 700; color: var(--foreground); }
.page-header p { font-size: 14px; color: var(--muted-foreground); margin-top: 4px; }

/* ===== Cards ===== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
}
.card-title { font-size: 14px; font-weight: 600; color: var(--card-foreground); margin-bottom: 16px; }

/* Stats Cards */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); padding: 20px; }
.stat-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.stat-card-label { font-size: 11px; font-weight: 500; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card-value { font-size: 30px; font-weight: 700; margin-top: 8px; color: var(--card-foreground); font-family: 'Plus Jakarta Sans', sans-serif; }
.stat-card-trend { font-size: 12px; color: var(--success); font-weight: 500; margin-top: 4px; }
.stat-icon { padding: 10px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.stat-icon i, .stat-icon svg { width: 20px; height: 20px; }
.stat-icon-primary { background: rgba(45,166,153,0.1); color: var(--primary); }
.stat-icon-warning { background: rgba(234,155,17,0.1); color: var(--warning); }
.stat-icon-info { background: rgba(59,130,246,0.1); color: var(--info); }
.stat-icon-success { background: rgba(34,153,84,0.1); color: var(--success); }

/* ===== Tables ===== */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead tr { background: var(--muted); }
th { text-align: left; padding: 12px 16px; font-size: 11px; font-weight: 600; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.05em; }
td { padding: 12px 16px; border-top: 1px solid rgba(214,220,230,0.5); }
tr:hover { background: rgba(210,215,225,0.1); }

/* Badges */
.badge { display: inline-flex; padding: 2px 8px; border-radius: 9999px; font-size: 12px; font-weight: 600; }
.badge-ss { background: rgba(239,68,68,0.1); color: var(--destructive); }
.badge-as { background: rgba(234,155,17,0.1); color: var(--warning); }
.badge-aa { background: rgba(34,153,84,0.1); color: var(--success); }
.badge-unknown { background: var(--muted); color: var(--muted-foreground); }
.badge-active { background: rgba(34,153,84,0.1); color: var(--success); }
.badge-monitoring { background: rgba(59,130,246,0.1); color: var(--info); }
.badge-discharged { background: var(--muted); color: var(--muted-foreground); }
.badge-deceased { background: rgba(239,68,68,0.1); color: var(--destructive); }
.badge-carrier { background: rgba(234,155,17,0.1); color: var(--warning); }
.badge-non-carrier { background: rgba(34,153,84,0.1); color: var(--success); }
.badge-affected { background: rgba(239,68,68,0.1); color: var(--destructive); }
.badge-outline { background: transparent; border: 1px solid var(--border); color: var(--muted-foreground); font-size: 10px; padding: 1px 6px; }
.badge-role-super_admin { background: rgba(239,68,68,0.1); color: var(--destructive); }
.badge-role-regional_officer { background: rgba(45,166,153,0.1); color: var(--primary); }
.badge-role-data_entry { background: var(--accent); color: var(--accent-foreground); }

/* ===== Forms ===== */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-group { display: flex; flex-direction: column; }
.form-group.full { grid-column: 1 / -1; }
.form-label { font-size: 11px; font-weight: 600; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 6px; }
.form-input, .form-select {
    width: 100%; background: var(--background); border: 1px solid var(--input); border-radius: 8px;
    padding: 10px 12px; font-size: 14px; outline: none; transition: all 0.15s;
    color: var(--foreground); font-family: 'Inter', sans-serif;
}
.form-input:focus, .form-select:focus { border-color: var(--ring); box-shadow: 0 0 0 2px rgba(45,166,153,0.2); }
.form-input::placeholder { color: var(--muted-foreground); }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600;
    border: none; cursor: pointer; transition: all 0.15s; font-family: 'Inter', sans-serif;
}
.btn i, .btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { opacity: 0.9; }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn-secondary:hover { opacity: 0.8; }
.btn-destructive { background: var(--destructive); color: var(--destructive-foreground); }
.btn-destructive:hover { opacity: 0.9; }
.btn-success { background: var(--success); color: var(--success-foreground); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 6px; border-radius: 6px; background: none; border: none; cursor: pointer; color: var(--muted-foreground); transition: all 0.15s; }
.btn-icon:hover { background: var(--muted); color: var(--foreground); }

/* ===== Filters ===== */
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.filter-search {
    display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--border);
    border-radius: 8px; padding: 8px 12px; flex: 1; min-width: 220px;
}
.filter-search i, .filter-search svg { width: 16px; height: 16px; color: var(--muted-foreground); }
.filter-search input { flex: 1; background: none; border: none; outline: none; font-size: 14px; color: var(--foreground); }
.filter-select {
    background: var(--card); border: 1px solid var(--border); border-radius: 8px;
    padding: 8px 12px; font-size: 14px; outline: none; color: var(--foreground);
    font-family: 'Inter', sans-serif;
}

/* ===== Patient Detail ===== */
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 24px; }
.info-row { display: flex; align-items: flex-start; gap: 12px; padding: 8px 0; }
.info-row i, .info-row svg { width: 16px; height: 16px; color: var(--muted-foreground); margin-top: 2px; flex-shrink: 0; }
.info-label { font-size: 12px; color: var(--muted-foreground); }
.info-value { font-size: 14px; font-weight: 500; color: var(--foreground); }

.relative-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.relative-card { border-radius: 8px; border: 1px solid var(--border); padding: 16px; background: var(--background); }
.relative-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.relative-card-name { font-size: 14px; font-weight: 600; }
.relative-card-detail { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted-foreground); padding: 2px 0; }

/* ===== Auth Page ===== */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--background), var(--muted)); padding: 16px; }
.auth-container { width: 100%; max-width: 420px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 32px; }
.auth-logo img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; box-shadow: 0 4px 12px rgba(0,0,0,0.1); border: 2px solid rgba(45,166,153,0.2); margin-bottom: 16px; }
.auth-logo h1 { font-size: 20px; font-weight: 700; }
.auth-logo p { font-size: 14px; color: var(--muted-foreground); margin-top: 4px; }
.auth-card { background: var(--card); border-radius: 16px; border: 1px solid var(--border); box-shadow: 0 4px 24px rgba(45,166,153,0.05); padding: 32px; }
.auth-tabs { display: flex; background: var(--muted); border-radius: 12px; padding: 4px; margin-bottom: 24px; }
.auth-tab { flex: 1; padding: 10px; border-radius: 8px; text-align: center; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.2s; color: var(--muted-foreground); background: none; border: none; font-family: 'Inter', sans-serif; }
.auth-tab.active { background: var(--background); color: var(--foreground); box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.auth-input-wrapper {
    display: flex; align-items: center; gap: 10px; border: 1px solid var(--border);
    border-radius: 12px; padding: 12px 14px; transition: all 0.2s; background: rgba(210,215,225,0.15);
}
.auth-input-wrapper:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(45,166,153,0.2); background: var(--background); }
.auth-input-wrapper i, .auth-input-wrapper svg { width: 16px; height: 16px; color: var(--muted-foreground); flex-shrink: 0; }
.auth-input-wrapper input { flex: 1; background: none; border: none; outline: none; font-size: 14px; color: var(--foreground); font-family: 'Inter', sans-serif; }
.auth-input-wrapper input::placeholder { color: var(--muted-foreground); }
.auth-submit {
    width: 100%; padding: 12px; border-radius: 12px; font-size: 14px; font-weight: 600;
    background: var(--primary); color: var(--primary-foreground); border: none; cursor: pointer;
    transition: all 0.2s; box-shadow: 0 4px 12px rgba(45,166,153,0.2); font-family: 'Inter', sans-serif;
}
.auth-submit:hover { opacity: 0.9; }
.auth-footer { text-align: center; font-size: 12px; color: var(--muted-foreground); margin-top: 24px; }
.toggle-password { background: none; border: none; cursor: pointer; padding: 2px; color: var(--muted-foreground); transition: color 0.15s; }
.toggle-password:hover { color: var(--foreground); }

/* ===== Toast ===== */
.toast { position: fixed; top: 16px; right: 16px; padding: 12px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; z-index: 100; transition: opacity 0.3s; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.toast-success { background: var(--success); color: var(--success-foreground); }
.toast-error { background: var(--destructive); color: var(--destructive-foreground); }

/* ===== Charts placeholder ===== */
.charts-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; margin-bottom: 24px; }

/* ===== Reports ===== */
.reports-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.report-card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--border); padding: 20px; transition: box-shadow 0.2s; }
.report-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.report-card h3 { font-size: 14px; font-weight: 600; color: var(--card-foreground); }
.report-card p { font-size: 12px; color: var(--muted-foreground); margin: 4px 0 16px; }
.report-buttons { display: flex; gap: 8px; }

/* ===== Regions ===== */
.region-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.region-tag { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 9999px; font-size: 12px; font-weight: 500; background: rgba(45,166,153,0.1); color: var(--primary); }
.region-tag button { background: none; border: none; cursor: pointer; color: inherit; padding: 0; margin-left: 4px; transition: color 0.15s; }
.region-tag button:hover { color: var(--destructive); }
.region-tag button i, .region-tag button svg { width: 12px; height: 12px; }

/* ===== Flex utilities ===== */
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-mono { font-family: monospace; font-size: 12px; color: var(--primary); }
.text-center { text-align: center; }
.text-muted { color: var(--muted-foreground); font-size: 14px; }

/* ===== Confirm dialog ===== */
.confirm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 60; display: flex; align-items: center; justify-content: center; }
.confirm-dialog { background: var(--card); border-radius: 12px; border: 1px solid var(--border); padding: 24px; max-width: 420px; width: 90%; }
.confirm-dialog h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.confirm-dialog p { font-size: 14px; color: var(--muted-foreground); margin-bottom: 20px; }
.confirm-buttons { display: flex; justify-content: flex-end; gap: 8px; }

/* Download link */
.download-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; background: var(--secondary); color: var(--secondary-foreground); transition: opacity 0.15s; }
.download-link:hover { opacity: 0.8; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar { position: fixed; top: 0; left: 0; transform: translateX(-100%); transition: transform 0.3s; z-index: 50; }
    .sidebar.open { transform: translateX(0); }
    .mobile-menu-btn { display: block; }
    .search-bar { display: none; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .charts-grid, .detail-grid, .relative-cards, .reports-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .content { padding: 16px; }
    .top-bar { padding: 12px 16px; }
}
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}
