/* ═══════════════════════════════════════════════════════════
   Global — NocodePharmaCare Premium Design System
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;0,14..32,900&display=swap');

/* ── CSS Variables ────────────────────────────────────────── */
:root {
    --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --blue-dark:  #0a1f6e;
    --blue-mid:   #1246c8;
    --blue-light: #0e7fc4;
    --teal:       #06d4a8;
    --green:      #0f7a3a;
    --red:        #d03030;
    --text-dark:  #0d1b3e;
    --text-mid:   #2a3a5e;
    --text-muted: #6b7a99;
    --bg-page:    #eef1f8;
    --bg-card:    #ffffff;
    --border:     #e0e8f5;
    --shadow-sm:  0 2px 8px rgba(18,70,200,0.07);
    --shadow-md:  0 4px 20px rgba(18,70,200,0.1);
    --shadow-lg:  0 8px 32px rgba(18,70,200,0.14);
    --radius:     10px;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font);
    font-weight: 450;
    color: var(--text-mid);
    background: var(--bg-page);
    line-height: 1.6;
    margin: 0;
}

/* ── Typography ───────────────────────────────────────────── */
h1 { font-size: 1.65rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1.05rem; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font);
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: -0.3px;
    line-height: 1.3;
    margin: 0;
}

p { margin: 0; }

a {
    color: var(--blue-mid);
    text-decoration: none;
    transition: color 0.15s;
}
a:hover { color: var(--blue-dark); }

/* ── All elements use Inter ───────────────────────────────── */
input, select, textarea, button, label, td, th, span, div {
    font-family: var(--font);
}

input, select, textarea {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
}

button {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.2px;
}

label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-muted);
}

th {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: #3a4a6a;
}

td {
    font-size: 0.9rem;
    font-weight: 500;
}

/* ── Layout ───────────────────────────────────────────────── */
.content {
    padding: 0;
    margin: 0;
}

/* ── Bootstrap overrides ──────────────────────────────────── */
.btn:focus,
.btn:active:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(18,70,200,0.15) !important;
    outline: none;
}

.form-control {
    font-family: var(--font);
    font-size: 0.92rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    padding: 0.5rem 0.85rem;
    color: var(--text-dark);
    background: #f7f9fd;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
    border-color: var(--blue-mid);
    background: #fff;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f0f4fb; }
::-webkit-scrollbar-thumb {
    background: #c0cce8;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: #a0b0d8; }

/* ── Selection ────────────────────────────────────────────── */
::selection {
    background: rgba(18,70,200,0.15);
    color: var(--text-dark);
}

/* ── Blazor error ─────────────────────────────────────────── */
#blazor-error-ui {
    background: #fff3cd;
    bottom: 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.1);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    font-size: 0.88rem;
    font-weight: 600;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: #fff5f5;
    border-left: 4px solid var(--red);
    padding: 1rem 1rem 1rem 1.5rem;
    color: var(--red);
    font-weight: 600;
    border-radius: 8px;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* ── Validation ───────────────────────────────────────────── */
.valid.modified:not([type=checkbox]) { outline: 2px solid #26b050; border-radius: 4px; }
.invalid { outline: 2px solid var(--red); border-radius: 4px; }
.validation-message { color: var(--red); font-size: 0.8rem; font-weight: 600; margin-top: 3px; }

/* ── Login Page ───────────────────────────────────────────── */
.login-overlay {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue-mid) 60%, var(--blue-light) 100%);
}
.login-box {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.login-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--blue-dark);
    margin-bottom: 0.25rem;
}
.login-brand span:first-child { font-size: 1.6rem; }
.login-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}
.login-error {
    background: #fff0f0;
    border: 1px solid #f5c0c0;
    color: var(--red);
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 500;
}
.login-btn {
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.75rem;
    font-size: 1rem;
}
.dashboard-page { padding: 1.5rem; }
.tenant-badge {
    background: var(--blue-mid);
    color: #fff;
    border-radius: 20px;
    padding: 0.3rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}
.dash-welcome {
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 1rem;
}
