/* =====================================================================
   Clinic Management System — shared styles
   Palette: cool clinical neutrals + deep teal primary + amber for alerts
   ===================================================================== */

:root {
    --bg:        #F5F8F7;
    --surface:   #FFFFFF;
    --ink:       #1A2321;
    --ink-soft:  #55655F;
    --line:      #DCE5E2;
    --teal:      #0E6B5C;
    --teal-dark: #0A4F44;
    --teal-tint: #E4F2EF;
    --amber:     #C97A1A;
    --amber-tint:#FBEEDD;
    --red:       #B3261E;
    --red-tint:  #FBEAE9;
    --radius:    10px;
    --shadow:    0 1px 2px rgba(20, 30, 27, 0.06), 0 4px 12px rgba(20, 30, 27, 0.05);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 0.5em; font-weight: 600; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }

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

.sidebar {
    width: 240px;
    background: var(--teal-dark);
    color: #EAF3F0;
    padding: 24px 16px;
    flex-shrink: 0;
}
.sidebar .brand { font-weight: 700; font-size: 1.1rem; margin-bottom: 28px; color: #fff; }
.sidebar nav a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: #CFE6E0;
    margin-bottom: 4px;
    font-size: 0.92rem;
}
.sidebar nav a:hover, .sidebar nav a.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
}
.sidebar .submenu { margin: 0 0 8px 12px; padding-left: 10px; border-left: 1px solid rgba(255,255,255,0.15); }
.sidebar .submenu a { font-size: 0.85rem; padding: 7px 10px; color: #A9CFC5; }
.sidebar .submenu a:hover, .sidebar .submenu a.active { background: rgba(255,255,255,0.08); color: #fff; }

.main { flex: 1; padding: 28px 36px; max-width: 1200px; }

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.topbar .user-chip {
    font-size: 0.88rem;
    color: var(--ink-soft);
}
.topbar .user-chip strong { color: var(--ink); }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }

.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 800px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }

.stat-card { padding: 18px 20px; }
.stat-card .label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink-soft); }
.stat-card .value { font-size: 1.7rem; font-weight: 700; margin-top: 4px; }

/* ---------- Forms ---------- */
label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; color: var(--ink); }
.field { margin-bottom: 16px; }
.field .hint { font-size: 0.78rem; color: var(--ink-soft); margin-top: 3px; }

input[type=text], input[type=password], input[type=email], input[type=tel],
input[type=date], input[type=number], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--surface);
    color: var(--ink);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-tint);
}

.password-field { position: relative; }
.password-field input { padding-right: 40px; }
.password-toggle {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; color: var(--ink-soft); font-size: 0.85rem;
    padding: 4px;
}

.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--ink-soft); }
.checkbox-row input { width: auto; }

.search-prominent {
    background: var(--teal-tint);
    border: 1px solid var(--teal);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
}
.search-prominent label { color: var(--teal-dark); font-size: 0.9rem; }
.search-prominent input[type=text] {
    font-size: 1.05rem;
    padding: 12px 14px;
    border-color: var(--teal);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: var(--teal);
    color: #fff;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    text-align: center;
}
.btn:hover { background: var(--teal-dark); text-decoration: none; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #8f1e18; }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-block { width: 100%; }

/* ---------- Table ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { color: var(--ink-soft); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.02em; }
tr:hover td { background: var(--teal-tint); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; }
.badge-active { background: var(--teal-tint); color: var(--teal-dark); }
.badge-blocked { background: var(--red-tint); color: var(--red); }
.badge-low-stock { background: var(--red-tint); color: var(--red); font-weight: 700; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; }
.alert-error { background: var(--red-tint); color: var(--red); }
.alert-success { background: var(--teal-tint); color: var(--teal-dark); }

/* ---------- Login page ---------- */
.login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--teal-dark) 0%, var(--teal) 55%, #12806E 100%);
}
.login-card {
    background: var(--surface);
    border-radius: 14px;
    padding: 40px 36px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(10, 40, 35, 0.35);
 
}
.login-card .brand-mark {
    height: 100px;
    padding: 0 24px;          /* replaces fixed width — grows with text */
    border-radius: 15px;
    background: var(--teal);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    margin-bottom: 0;         /* let the header row control spacing */
    font-size: 1.25rem;       /* optional — adjust to taste */
    letter-spacing: 0.5px;    /* optional */
}
.brand-header {
    display: flex;
    align-items: center;
    gap: 12px; /* adjust spacing as needed */
    margin-bottom: 16px; /* optional spacing below the header row */
}