/* ============================================================
   Peptoids — shared stylesheet
   Light clinical lab aesthetic with a dark slate-navy header
   and an indigo accent. System fonts only (no external deps).
   ============================================================ */

:root {
    /* Palette */
    --navy:        #0f172a;   /* dark header/nav base */
    --navy-light:  #1e293b;   /* nav item hover / dropdown bg */
    --navy-border: #334155;   /* nav dropdown border */
    --indigo:      #6366f1;   /* primary accent */
    --indigo-dark: #4f46e5;   /* accent hover */
    --indigo-deep: #4338ca;   /* deep accent (card outline) */
    --indigo-soft: #eef2ff;   /* accent tint (active bg) */

    --body-bg:     #f4f5f7;   /* page canvas */
    --card-bg:     #ffffff;   /* cards / panels */
    --text:        #1f2937;   /* primary text */
    --text-mut:    #6b7280;   /* muted/secondary text */
    --border:      #e5e7eb;   /* hairline borders */
    --header-bg:   #f8fafc;   /* table header bg */

    /* Status colors */
    --success:     #10b981;
    --info:        #3b82f6;
    --warn:        #f59e0b;
    --danger:      #ef4444;

    /* Elevation */
    --shadow-sm:   0 1px 2px rgba(15,23,42,.06);
    --shadow:      0 4px 12px rgba(15,23,42,.08);

    /* Shape & rhythm */
    --radius:      8px;
    --radius-sm:   5px;
    --space:       1.5rem;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
    font-family: var(--font);
    background-color: var(--body-bg);
    margin: 0;
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ---------- Header / Nav ---------- */
.site-nav {
    background-color: var(--navy);
    color: #e2e8f0;
    box-shadow: 0 2px 6px rgba(15,23,42,.35);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-nav__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.5rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: nowrap;
}
.site-nav__brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    text-decoration: none;
    color: #f8fafc;
    padding: 0.7rem 0;
    white-space: nowrap;
}
.site-nav__brand:hover { color: #ffffff; }
.site-nav__brand img {
    height: 80px;
    width: 80px;
    border-radius: 8px;
}
.site-nav__brand h1 {
    font-size: 1.25rem;
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.site-nav__menu {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Nav links & dropdown triggers */
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: #e2e8f0;
    text-decoration: none;
    padding: 0.9rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 500;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    white-space: nowrap;
}
.nav-link:hover { background-color: var(--navy-light); color: #ffffff; }
.nav-link.active { background-color: var(--navy-light); color: var(--indigo-soft); }
.nav-link.active::after {
    content: "";
    display: block;
    height: 2px;
    background: var(--indigo);
    border-radius: 2px;
    margin-top: 2px;
}
.nav-link__arrow {
    font-size: 0.7em;
    transition: transform .15s ease;
}
.nav-dropdown.open .nav-link__arrow { transform: rotate(180deg); }

/* Dropdown panels */
.nav-dropdown { position: relative; }
.nav-dropdown__menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 200px;
    background: var(--navy-light);
    border: 1px solid var(--navy-border);
    border-radius: var(--radius);
    box-shadow: 0 12px 28px rgba(15,23,42,.45);
    padding: 0.35rem;
    display: none;
    z-index: 200;
}
.nav-dropdown.open .nav-dropdown__menu { display: block; }
.nav-dropdown__menu a {
    display: block;
    color: #e2e8f0;
    text-decoration: none;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}
.nav-dropdown__menu a:hover { background-color: var(--navy); color: #ffffff; }
.nav-dropdown__menu .dropdown-sep {
    height: 1px;
    background: var(--navy-border);
    margin: 0.3rem 0.5rem;
}

/* Right-aligned logout button */
.site-nav__actions { display: flex; align-items: center; }
.logout-btn {
    color: #fda4af;
    text-decoration: none;
    padding: 0.9rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    font-weight: 500;
    white-space: nowrap;
}
.logout-btn:hover { background-color: var(--navy-light); color: #fecdd3; }

/* ---------- Layout ---------- */
.container {
    padding: 2rem 1.25rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Contextual secondary breadcrumb under nav */
.page-context {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.25rem;
}
.page-context .back-link {
    display: inline-block;
    text-decoration: none;
    color: var(--text-mut);
    font-size: 0.85rem;
    padding: 0.25rem 0;
}
.page-context .back-link:hover { color: var(--indigo); }
.page-context .btn { margin: 0.4rem 1.25rem 0 0; }

/* ---------- Cards & tables ---------- */
.form-container, .table-container {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 2px solid var(--indigo-deep);
    margin-bottom: 2rem;
}
h2, h3 {
    margin-top: 0;
    font-weight: 600;
    color: var(--text);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }

table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
th { background-color: var(--header-bg); font-weight: 600; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background-color: #fafbfc; }
.no-data { text-align: center; color: var(--text-mut); padding: 2rem; }
.clickable-row { cursor: pointer; }
.clickable-row:hover { background-color: #f8fafc; }

/* ---------- Forms & buttons ---------- */
label { font-weight: 600; margin-bottom: 0.5rem; display: block; }
input, select, textarea {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    color: var(--text);
    font-family: inherit;
}
input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--indigo);
    outline-offset: -1px;
    border-color: var(--indigo);
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.1rem;
    color: #fff;
    background-color: var(--indigo);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    width: auto;
}
.btn:hover { background-color: var(--indigo-dark); }
.btn[type="submit"], button.btn { width: auto; }
.btn--small { padding: 0.35rem 0.7rem; font-size: 0.82rem; }
.btn--block { width: 100%; display: block; text-align: center; }
.btn--ghost { background: transparent; color: var(--indigo); border: 1px solid var(--indigo); }
.btn--ghost:hover { background: var(--indigo-soft); }
.btn--danger { background-color: var(--danger); }
.btn--danger:hover { background-color: #dc2626; }

.concentration { font-size: 0.9em; color: var(--text-mut); }

/* Status badges (dose taken/destroyed; cycle active/planned/completed) */
.status-badge {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: capitalize;
    background: var(--header-bg);
    color: var(--text);
    border: 1px solid var(--border);
}
.status-taken, .status-active   { background: #ecfdf5; color: #0f9d63; border-color: #a7f3d0; }
.status-completed, .status-empty { background: var(--header-bg); color: var(--text-mut); border-color: var(--border); }
.status-destroyed, .status-discarded { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.status-planned { background: var(--indigo-soft); color: var(--indigo-dark); border-color: #c7d2fe; }

.muted { color: var(--text-mut); }

/* Vial detail header summary */
.detail-header {
    background: var(--card-bg);
    padding: 1.5rem 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    border: 2px solid var(--indigo-deep);
    margin-bottom: 2rem;
}
.detail-header h2 { border-bottom: none; margin-bottom: 0.75rem; }
.detail-summary { display: flex; gap: 2rem; flex-wrap: wrap; }
.detail-summary > div { display: flex; flex-direction: column; }
.detail-summary span { color: var(--text-mut); font-size: 0.9em; }
.detail-summary strong { font-size: 1.2em; }

/* ---------- Responsive (keep light — mainly wrapping) ---------- */
@media (max-width: 820px) {
    .site-nav__inner {
        flex-wrap: wrap;
        padding: 0.4rem 0.9rem;
    }
    .site-nav__menu { width: 100%; }
    .site-nav__brand img { height: 64px; width: 64px; }
    .container { padding: 1.25rem 0.9rem; }
    th, td { padding: 8px 10px; font-size: 0.9em; }

    /* Existing responsive-table card mode */
    .responsive-table table, .responsive-table thead,
    .responsive-table tbody, .responsive-table th,
    .responsive-table td, .responsive-table tr { display: block; }
    .responsive-table thead tr { position: absolute; top: -9999px; left: -9999px; }
    .responsive-table tr { border: 1px solid var(--border); margin-bottom: 1rem; }
    .responsive-table td {
        border: none;
        border-bottom: 1px solid var(--border);
        position: relative;
        padding-left: 50%;
    }
    .responsive-table td:before {
        position: absolute;
        top: 6px; left: 6px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
    }
}