/* ============================================================
   SevaSetu - Global Stylesheet (style.css)
   Shared base styles for all pages.
   Preserves the exact colour theme, layout and design tokens
   used across the research prototype.
   ============================================================ */

:root {
    /* App (CIP) theme */
    --bg: #ffffff;
    --surface: #f8f9fa;
    --border: #dee2e6;
    --text: #1a1a1a;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --success: #198754;
    --warning: #ffc107;
    --danger: #dc3545;
    --purple: #6f42c1;
    --radius: 6px;
    --radius-lg: 10px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.10);
    --font: 'Inter', 'Noto Sans Devanagari', system-ui, sans-serif;
    --sidebar-w: 240px;
    --header-h: 56px;

    /* Dashboard/Segoe theme */
    --sidebar-bg: #0f1a2e;
    --sidebar-hover: #1a2d47;
    --sidebar-active: #2563eb;
    --accent: #3b82f6;
    --accent-light: #dbeafe;
    --card-bg: #ffffff;
    --radius-sm: 8px;
    --radius-full: 12px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

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

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

input, select, textarea {
    font-family: var(--font);
    font-size: 0.9rem;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    background: #fff;
    color: var(--text);
    width: 100%;
    transition: border 0.2s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover { text-decoration: none; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.btn-primary:hover {
    background: var(--primary-dark);
    color: #fff;
}

.btn-outline {
    background: #fff;
    color: var(--primary);
    border-color: var(--primary);
}

.btn-outline:hover {
    background: #e7f1ff;
    color: var(--primary);
}

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.btn-success:hover { background: #157347; color: #fff; }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}

.btn-danger:hover { background: #bb2d3b; color: #fff; }

.btn-sm {
    padding: 6px 14px;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

/* ============ BADGES ============ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-primary { background: #e7f1ff; color: var(--primary); }
.badge-success { background: #d1e7dd; color: var(--success); }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-danger  { background: #f8d7da; color: var(--danger); }
.badge-info    { background: #cff4fc; color: #055160; }
.badge-purple  { background: #f3e8ff; color: #6f42c1; }

/* ============ CARDS ============ */
.card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin-bottom: 18px;
    box-shadow: var(--shadow);
}

.card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

.card .card-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

/* ============ STATS ============ */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}

.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-card .stat-num {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
}

.stat-card .stat-lbl {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-card.accent { border-left: 4px solid var(--primary); }
.stat-card.success { border-left: 4px solid var(--success); }
.stat-card.warning { border-left: 4px solid var(--warning); }
.stat-card.danger { border-left: 4px solid var(--danger); }

/* ============ TABLES ============ */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

table th, table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

table th {
    background: #f8f9fa;
    font-weight: 700;
    color: var(--text);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

table tbody tr:hover { background: #f8f9fa; }

/* ============ UTILITIES ============ */
.hidden { display: none !important; }
.mt-2 { margin-top: 10px; }
.mb-2 { margin-bottom: 10px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); font-size: 0.75rem; }
.gap-2 { display: flex; gap: 8px; flex-wrap: wrap; }
.gap-3 { display: flex; gap: 16px; flex-wrap: wrap; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.w-100 { width: 100%; }

/* ============ TOAST ============ */
#toastContainer {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.toast {
    background: #1a1a1a;
    color: #fff;
    padding: 10px 20px;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    animation: toastIn 0.3s ease;
    pointer-events: auto;
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ PROTO BANNER ============ */
.proto-banner {
    background: #fff3cd;
    color: #664d03;
    text-align: center;
    padding: 6px 16px;
    font-size: 0.72rem;
    font-weight: 600;
    border-bottom: 1px solid #ffc107;
    letter-spacing: 0.02em;
}

.proto-banner .proto-tag {
    background: #664d03;
    color: #fff3cd;
    padding: 2px 10px;
    border-radius: 99px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: 8px;
    letter-spacing: 0.05em;
}
