/* ──────────────────────────────────────────────────────────────
   OHS-EHR — Shared Styles
   Clinical system: clean, high-contrast, accessible.
   No external dependencies.
   ────────────────────────────────────────────────────────────── */

:root {
    /* Kupa Health & Technology brand teal (2026-05-12) */
    --color-primary: #1F8B95;
    --color-primary-light: #2BA8B5;
    --color-primary-dark: #15616A;
    --color-accent-green: #9CCC65;
    --color-success: #27ae60;
    --color-danger: #c0392b;
    --color-warning: #f39c12;
    --color-bg: #f5f7fa;
    --color-surface: #ffffff;
    --color-text: #2c3e50;
    --color-text-muted: #7f8c8d;
    --color-border: #dce1e6;
    --radius: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--color-text);
    background: var(--color-bg);
}

/* ── Layout ───────────────────────────────────────────────────── */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.page-header {
    background: var(--color-primary);
    color: white;
    padding: 8px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-header h1 {
    font-size: 18px;
    font-weight: 600;
}

/* ── Brand block (used in page-header) ───────────────────────────── */

.brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    text-decoration: none;
}
.brand-icon {
    height: 26px;
    width: 26px;
    flex: 0 0 auto;
}
.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.brand-name {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.brand-product {
    font-size: 9px;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ── Live clock in the page-header ───────────────────────────── */
.header-clock {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.header-clock .clock-time {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.header-clock .clock-date {
    font-size: 10px;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
@media (max-width: 720px) {
    .header-clock .clock-date { display: none; }
}

.page-header .user-info {
    font-size: 13px;
    opacity: 0.9;
}

.page-header .user-info a {
    color: white;
    text-decoration: underline;
    cursor: pointer;
}

.page-content {
    padding: 24px 0;
}

/* ── Cards ────────────────────────────────────────────────────── */

.card {
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--color-border);
    padding: 24px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--color-primary);
}

/* ── Forms ────────────────────────────────────────────────────── */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 13px;
    color: var(--color-text);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.15s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.15);
}

/* ── Buttons ──────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-dark);
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

/* ── Tables ───────────────────────────────────────────────────── */

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
    font-size: 13px;
}

.data-table tr:hover td {
    background: #f0f4f8;
}

/* ── Toolbar (search + filters above table) ───────────────────── */

.toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.toolbar .search-box {
    flex: 1;
    min-width: 200px;
}

/* ── Status Badges ────────────────────────────────────────────── */

.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.badge-active   { background: #d4efdf; color: #1e8449; }
.badge-inactive { background: #fadbd8; color: #922b21; }
.badge-warning  { background: #fdebd0; color: #b9770e; }

/* ── Login Page ───────────────────────────────────────────────── */

.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary-light));
}

.login-card {
    width: 400px;
    padding: 40px;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.login-card h1 {
    text-align: center;
    color: var(--color-primary);
    margin-bottom: 8px;
    font-size: 22px;
}

.login-card .subtitle {
    text-align: center;
    color: var(--color-text-muted);
    margin-bottom: 24px;
    font-size: 13px;
}

/* ── Alerts ───────────────────────────────────────────────────── */

.alert {
    padding: 10px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
}

.alert-error {
    background: #fdedec;
    color: var(--color-danger);
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4efdf;
    color: #1e8449;
    border: 1px solid #a9dfbf;
}

/* ── Pagination ───────────────────────────────────────────────── */

.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ── Spinner ──────────────────────────────────────────────────── */

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Utility ──────────────────────────────────────────────────── */

.text-muted { color: var(--color-text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.hidden { display: none !important; }
