/* ============================================================
   anota app portal — design system
   Brand: teal→green (from the anota wordmark), blue-hued neutrals.
   Quality bar: Jotform or better. No Bootstrap-template look.
   ============================================================ */

:root {
    /* Brand */
    --an-teal: #1B9AAA;
    --an-green: #7DC242;
    --an-primary: #16A385;
    --an-primary-dark: #0F8A70;
    --an-primary-subtle: #E9F7F3;
    --an-gradient: linear-gradient(90deg, #1B9AAA, #7DC242);

    /* Neutrals — blue-hued, never pure gray */
    --an-ink: #0B1929;
    --an-slate-800: #1E3A5F;
    --an-slate-600: #475B73;
    --an-slate-500: #64748B;
    --an-slate-400: #94A3B8;
    --an-slate-300: #CBD5E1;
    --an-slate-200: #E2E8F0;
    --an-slate-100: #F1F5F9;
    --an-slate-50: #F8FAFC;

    /* Semantic */
    --an-success: #2E7D32;
    --an-warning: #B45309;
    --an-error: #C62828;

    /* Shadows */
    --an-shadow-sm: 0 1px 3px rgba(11, 25, 41, .08), 0 1px 2px rgba(11, 25, 41, .04);
    --an-shadow-md: 0 4px 6px rgba(11, 25, 41, .06), 0 2px 4px rgba(11, 25, 41, .04);
    --an-shadow-lg: 0 10px 24px rgba(11, 25, 41, .08), 0 4px 8px rgba(11, 25, 41, .04);
    --an-shadow-glow: 0 0 0 1px rgba(22, 163, 133, .10), 0 4px 16px rgba(22, 163, 133, .14);

    --an-font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html, body {
    font-family: var(--an-font);
    color: var(--an-ink);
    background: var(--an-slate-50);
    margin: 0;
}

h1:focus { outline: none; }

a { color: var(--an-primary); }
a:hover { color: var(--an-primary-dark); }

/* ---------- shell ---------- */
.an-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.an-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--an-slate-200);
}

.an-topbar-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.an-brand { display: flex; align-items: center; }
.an-brand img { height: 26px; display: block; }

.an-nav { display: flex; gap: 6px; }

.an-nav-link {
    font-size: .875rem;
    font-weight: 600;
    color: var(--an-slate-600);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    background: none;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
}

.an-nav-link:hover { background: var(--an-slate-100); color: var(--an-ink); }
.an-nav-link.active { color: var(--an-primary); background: var(--an-primary-subtle); }

.an-topbar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.an-user {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--an-slate-600);
    font-size: .875rem;
    padding: 5px 10px 5px 5px;
    border-radius: 999px;
    transition: background 150ms ease;
}

.an-user:hover { background: var(--an-slate-100); color: var(--an-ink); }

.an-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--an-gradient);
    color: #fff;
    font-weight: 700;
    font-size: .8125rem;
    display: grid;
    place-items: center;
}

.an-user-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.an-logout { margin: 0; }
.an-logout-btn { color: var(--an-slate-500); }

.an-main { flex: 1; }

/* ---------- page scaffolding ---------- */
.an-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.an-page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
}

.an-page-title {
    font-size: 2rem;
    font-weight: 600;
    line-height: 1.1;
    margin: 0;
    color: var(--an-ink);
}

.an-page-sub {
    margin: 6px 0 0;
    color: var(--an-slate-500);
    font-size: 1rem;
}

/* ---------- buttons ---------- */
.an-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--an-primary);
    color: #fff !important;
    font-weight: 600;
    font-size: .875rem;
    padding: 10px 22px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 150ms ease, transform 100ms ease, box-shadow 200ms ease;
}

.an-btn-primary:hover { background: var(--an-primary-dark); box-shadow: var(--an-shadow-md); }
.an-btn-primary:active { transform: scale(.98); }
.an-btn-primary:disabled { opacity: .5; cursor: default; }

.an-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: var(--an-slate-600);
    font-weight: 600;
    font-size: .875rem;
    padding: 10px 22px;
    border-radius: 6px;
    border: 1px solid var(--an-slate-300);
    cursor: pointer;
    text-decoration: none;
    transition: background 150ms ease, border-color 150ms ease;
}

.an-btn-secondary:hover { background: var(--an-slate-50); border-color: var(--an-slate-400); color: var(--an-ink); }

/* ---------- cards & tables ---------- */
.an-card {
    background: #fff;
    border: 1px solid var(--an-slate-200);
    border-radius: 8px;
    box-shadow: var(--an-shadow-sm);
}

.an-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9375rem;
}

.an-table th {
    text-align: left;
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--an-slate-500);
    padding: 14px 20px;
    border-bottom: 1px solid var(--an-slate-200);
}

.an-table td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--an-slate-100);
    color: var(--an-slate-600);
    vertical-align: middle;
}

.an-table tbody tr { transition: background 120ms ease; }
.an-table tbody tr:hover { background: var(--an-slate-50); }
.an-table tbody tr:last-child td { border-bottom: none; }

.an-table .an-cell-title a {
    color: var(--an-ink);
    font-weight: 600;
    text-decoration: none;
}

.an-table .an-cell-title a:hover { color: var(--an-primary); }

/* ---------- status pills ---------- */
.an-pill {
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 3px 12px;
}

.an-pill-published { background: #E7F5E9; color: var(--an-success); }
.an-pill-draft { background: var(--an-slate-100); color: var(--an-slate-500); }
.an-pill-archived { background: var(--an-slate-50); color: var(--an-slate-400); }

/* ---------- empty state ---------- */
.an-empty {
    text-align: center;
    padding: 96px 24px;
}

.an-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 16px;
    background: var(--an-primary-subtle);
    display: grid;
    place-items: center;
    font-size: 28px;
}

.an-empty h2 { font-size: 1.25rem; font-weight: 600; margin: 0 0 8px; color: var(--an-ink); }
.an-empty p { color: var(--an-slate-500); margin: 0 0 24px; }

/* ---------- alerts ---------- */
.an-alert {
    border-left: 3px solid var(--an-warning);
    background: #FFF8EB;
    color: #7C4A03;
    padding: 12px 16px;
    border-radius: 0 6px 6px 0;
    font-size: .875rem;
    margin-bottom: 20px;
}

/* ---------- focus & a11y ---------- */
:focus-visible { outline: 2px solid var(--an-primary); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

@media (max-width: 640px) {
    .an-user-name { display: none; }
    .an-topbar-inner { gap: 12px; }
    .an-page { padding: 24px 16px 60px; }
}

/* ============================================================
   Template plumbing (Identity pages, validation, error UI)
   ============================================================ */

.valid.modified:not([type=checkbox]) { outline: 1px solid #26b050; }
.invalid { outline: 1px solid var(--an-error); }
.validation-message { color: var(--an-error); font-size: .8125rem; }

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
    border-radius: 6px;
}

.blazor-error-boundary::after { content: "An error has occurred."; }

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
