:root {
    --navy: #172B4D;
    --blue: #2563EB;
    --cyan: #38BDF8;
    --yellow: #FACC15;
    --bg: #F4F7FB;
    --white: #FFFFFF;
    --text: #1E293B;
    --muted: #64748B;
    --border: #E2E8F0;
    --green: #16A34A;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--navy);
    color: white;
    padding: 24px 16px;
    flex-shrink: 0;
}

.brand {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 6px;
}

.brand-sub {
    color: #CBD5E1;
    font-size: 12px;
    margin-bottom: 30px;
}

.nav button {
    width: 100%;
    background: transparent;
    color: #CBD5E1;
    border: none;
    padding: 12px;
    text-align: left;
    border-radius: 8px;
    margin-bottom: 5px;
    cursor: pointer;
    font-size: 14px;
}

.nav button:hover,
.nav button.active {
    background: #2563EB;
    color: white;
}

.main {
    flex: 1;
    padding: 28px;
    min-width: 0;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 25px;
}

.header h1 {
    margin: 0;
    font-size: 25px;
}

.header p {
    color: var(--muted);
    margin: 8px 0 0;
}

.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.metric {
    background: white;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.metric-label {
    color: var(--muted);
    font-size: 13px;
}

.metric-value {
    font-size: 30px;
    font-weight: bold;
    margin: 10px 0;
    color: var(--navy);
}

.metric-note {
    font-size: 12px;
    color: var(--green);
}

button.primary {
    background: var(--blue);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
}

button.secondary {
    background: #E2E8F0;
    color: var(--navy);
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
}

button.danger {
    background: #FEE2E2;
    color: #B91C1C;
    border: none;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

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

th {
    background: #F8FAFC;
    color: var(--muted);
}

.table-wrap {
    overflow-x: auto;
}

input, select, textarea {
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 13px;
    max-width: 100%;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.form-row input,
.form-row select {
    flex: 1;
    min-width: 150px;
}

.section-title {
    margin: 0 0 16px;
    font-size: 18px;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.check-item input {
    width: 18px;
    height: 18px;
}

.check-item label {
    font-size: 14px;
}

.progress {
    height: 8px;
    background: #E2E8F0;
    border-radius: 10px;
    overflow: hidden;
    margin: 15px 0;
}

.progress-bar {
    height: 100%;
    background: var(--blue);
    transition: width .3s;
}

.badge {
    display: inline-block;
    padding: 5px 9px;
    background: #DBEAFE;
    color: #1D4ED8;
    border-radius: 20px;
    font-size: 11px;
}

.sop-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 12px;
    background: white;
}

.sop-card summary {
    padding: 16px;
    font-weight: bold;
    cursor: pointer;
    color: var(--navy);
}

.sop-content {
    padding: 0 18px 18px;
    font-size: 14px;
    line-height: 1.8;
}

.sop-content ul {
    padding-left: 22px;
}

.hidden {
    display: none;
}

footer {
    margin-top: 30px;
    color: var(--muted);
    font-size: 12px;
}

@media(max-width:1000px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width:700px) {
    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 16px;
    }

    .nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .main {
        padding: 16px;
    }

    .grid {
        grid-template-columns: 1fr;
    }
}

/* Accessible, responsive refinements for the original navy-and-blue dashboard. */
:root { color-scheme: light; }
body { font-family: Arial, "Myanmar Text", sans-serif; line-height: 1.5; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; box-shadow: 8px 0 24px rgba(15, 35, 70, .08); }
.brand { letter-spacing: -.3px; }
.nav button { font: inherit; transition: background-color .16s ease, color .16s ease, transform .16s ease; }
.nav button:hover { transform: translateX(2px); }
.main { max-width: 1600px; margin: 0 auto; }
.header { padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.header h1 { letter-spacing: -.55px; }
.card, .metric { box-shadow: 0 4px 18px rgba(15, 35, 70, .035); }
.metric { border-top: 3px solid var(--blue); }
.metric-value { letter-spacing: -.75px; }
button, select, input { font: inherit; }
button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid rgba(56, 189, 248, .55); outline-offset: 2px; }
button.primary, button.secondary, button.danger { transition: filter .15s ease, transform .15s ease; }
button.primary:hover, button.secondary:hover, button.danger:hover { filter: brightness(.96); transform: translateY(-1px); }
input, select { background: white; }
.check-item label { cursor: pointer; }
.check-item input { accent-color: var(--blue); }
.app-notice { position: fixed; right: 22px; bottom: 22px; z-index: 10; max-width: min(420px, calc(100vw - 32px)); padding: 13px 16px; border-radius: 10px; background: var(--navy); color: white; box-shadow: 0 10px 32px rgba(15, 35, 70, .24); }
.app-notice[data-tone="warning"] { background: #92400E; }
.app-notice[hidden] { display: none; }
.skip-link { position: fixed; z-index: 20; left: 12px; top: 12px; transform: translateY(-160%); background: white; color: var(--navy); padding: 10px 14px; border-radius: 8px; box-shadow: 0 3px 18px rgba(15, 35, 70, .2); }
.skip-link:focus { transform: translateY(0); }
@media(max-width:700px) {
    .sidebar { position: static; height: auto; overflow: visible; }
    .nav button { text-align: center; font-size: 12px; padding: 10px 7px; }
    .header { align-items: flex-start; }
    .header h1 { font-size: 22px; }
    .card { padding: 16px; }
    .table-wrap { margin-inline: -4px; }
}
@media(prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}


/* Shared team workspace */
.auth-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top right, #dbeafe 0, transparent 38%), var(--bg); }
.auth-gate[hidden], .hidden { display: none !important; }
.auth-panel { width: min(520px, 100%); padding: 36px; border: 1px solid var(--border); border-radius: 18px; background: var(--white); box-shadow: 0 18px 60px rgba(23, 43, 77, .12); }
.auth-brand { color: var(--navy); margin-bottom: 20px; }
.auth-panel h1 { color: var(--navy); font-size: 28px; margin: 0 0 12px; }
.auth-panel p { color: var(--muted); line-height: 1.7; }
.auth-link { display: inline-flex; text-decoration: none; align-items: center; margin-top: 8px; padding: 11px 17px; color: white; background: var(--blue); border-radius: 8px; font-weight: 600; }
.auth-link:hover { filter: brightness(.96); }
.auth-message { min-height: 1.5em; color: #B91C1C !important; }
.sync-status { display: inline-block; margin: 0 8px; padding: 5px 9px; border-radius: 20px; background: #DCFCE7; color: #166534; font-size: 12px; }
.sync-status[data-state="syncing"] { background: #FEF3C7; color: #92400E; }
.sync-status[data-state="offline"], .sync-status[data-state="error"] { background: #FEE2E2; color: #991B1B; }
.logout-button { margin-left: 4px; }
.invite-result { margin: 12px 0 18px; padding: 14px; background: #EFF6FF; border: 1px solid #BFDBFE; border-radius: 8px; overflow-wrap: anywhere; }
.invite-result a { display: block; margin: 5px 0 10px; color: var(--blue); }
#team h3 { margin-top: 22px; color: var(--navy); }
#team .form-row { align-items: center; }
#team button:disabled, button:disabled, select:disabled, input:disabled { opacity: .55; cursor: not-allowed; }
@media(max-width:700px) {
    .auth-panel { padding: 24px; }
    .sync-status { margin: 6px 0; }
    .logout-button { margin-left: 0; }
}


/* Shared public marketing asset library */
.asset-warning { padding: 14px 16px; border: 1px solid #FCD34D; border-radius: 9px; background: #FFFBEB; color: #78350F; line-height: 1.65; }
.asset-controls { align-items: center; }
.asset-picker { color: var(--navy); font-weight: 600; align-self: center; }
.asset-toggle { display: inline-flex; align-items: center; gap: 8px; color: var(--navy); }
.asset-toggle input { accent-color: var(--blue); }
#assetStatus { color: var(--muted); min-height: 1.5em; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.asset-card { overflow: hidden; border: 1px solid var(--border); border-radius: 11px; background: white; box-shadow: 0 4px 16px rgba(15, 35, 70, .045); }
.asset-card[data-status="hidden"], .asset-card[data-status="failed"], .asset-card[data-status="pending"] { border-style: dashed; opacity: .78; }
.asset-preview { display: grid; place-items: center; height: 150px; background: #F1F5F9; text-decoration: none; }
.asset-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.asset-file-badge { display: grid; place-items: center; width: 66px; height: 82px; border: 1px solid #CBD5E1; border-radius: 8px; background: white; color: #B91C1C; font-weight: 700; }
.asset-card-body { padding: 13px; }
.asset-name { display: block; color: var(--navy); font-weight: 700; overflow-wrap: anywhere; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.asset-meta { margin-top: 6px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.asset-actions { margin-top: 12px; }
.asset-empty { grid-column: 1 / -1; padding: 20px; border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); text-align: center; }
@media(max-width:700px) {
    .asset-grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
    .asset-controls > * { width: 100%; }
    .asset-picker { margin-top: 4px; }
    .asset-toggle { justify-content: flex-start; }
}
