﻿/* ============================================================
   GLOBAL COLOR SCHEME - deep green | deep blue | black
   Edit these values only; the whole website follows from here.
   ============================================================ */
:root {
    --c-green: #0e6f57;
    --c-green-deep: #0b4d3c;
    --c-green-rgb: 14, 111, 87;
    --c-green-deep-rgb: 10, 77, 60;

    --c-blue: #1e40af;
    --c-blue-deep: #172554;
    --c-blue-soft: #7b97e0;
    --c-blue-rgb: 30, 64, 175;
    --c-blue-soft-rgb: 123, 151, 224;

    --c-black: #0a0a0a;
    --c-black-soft: #171717;
    --c-black-rgb: 10, 10, 10;

    --c-accent: var(--c-green);
    --c-accent-rgb: var(--c-green-rgb);
}

:root {
    --bg: #f4f6fb;
    --surface: #ffffff;
    --surface-muted: #f8fafc;
    --border: #e2e8f0;
    --text: var(--c-black);
    --muted: #64748b;
    --primary: var(--c-blue);
    --primary-strong: var(--c-blue-deep);
    --primary-soft: var(--c-blue-soft);
    --success: var(--c-green);
    --success-soft: #ecfdf5;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --sidebar: var(--surface);
    --radius: 5px;
    --shadow: 0 18px 40px -28px rgba(15, 23, 42, 0.38);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:focus-visible {
    outline: 3px solid rgba(var(--c-blue-rgb), 0.45);
    outline-offset: 2px;
}

.eyebrow {
    display: inline-block;
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.text-muted {
    color: var(--muted);
}

.text-right {
    text-align: right;
}

.link {
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 600;
}

.link:hover {
    text-decoration: underline;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.btn-primary {
    background: linear-gradient(135deg, var(--c-blue), var(--c-blue));
    color: #ffffff;
    box-shadow: 0 12px 24px -14px rgba(79, 70, 229, 0.9);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 16px 28px -14px rgba(79, 70, 229, 0.95);
}

.btn-secondary {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--surface-muted);
    border-color: #cbd5e1;
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--surface-muted);
    color: var(--text);
}

.btn-danger-ghost {
    background: transparent;
    color: var(--danger);
}

.btn-danger-ghost:hover:not(:disabled) {
    background: var(--danger-soft);
}

.btn-sm {
    padding: 7px 10px;
    border-radius: 9px;
    font-size: 0.78rem;
}

.btn-block {
    width: 100%;
    padding: 12px 16px;
}

.icon-button {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    transition: background 160ms ease, color 160ms ease;
}

.icon-button:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.icon-button svg {
    width: 18px;
    height: 18px;
}

.spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.htmx-indicator {
    opacity: 0;
    transition: opacity 150ms ease;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}

.alert {
    padding: 11px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 500;
}

.alert-success {
    background: var(--success-soft);
    border-color: #a7f3d0;
    color: var(--c-green);
}

.alert-danger {
    background: var(--danger-soft);
    border-color: #fecaca;
    color: #b91c1c;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field > span {
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 600;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field textarea {
    min-height: 150px;
    resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder {
    color: #94a3b8;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--c-blue-soft);
    box-shadow: 0 0 0 4px rgba(var(--c-blue-rgb), 0.12);
}

.field input.is-invalid,
.field select.is-invalid,
.field textarea.is-invalid {
    border-color: #fca5a5;
    background: #fffafa;
}

.field-error {
    color: var(--danger);
    font-size: 0.78rem;
    font-weight: 500;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-mark {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(135deg, var(--c-blue), var(--c-green));
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 800;
    box-shadow: 0 12px 22px -14px rgba(129, 140, 248, 0.9);
    transition: transform 160ms ease;
}

.brand:hover .brand-mark {
    transform: translateY(-1px) rotate(-2deg);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-text strong {
    color: #f8fafc;
    font-size: 1rem;
}

.brand-text small {
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.login-body {
    display: grid;
    min-height: 100vh;
    padding: 32px;
    place-items: center;
    background:
        radial-gradient(circle at 12% 18%, rgba(var(--c-blue-rgb), 0.35), transparent 34%),
        radial-gradient(circle at 84% 76%, rgba(var(--c-green-rgb), 0.22), transparent 32%),
        #0b1120;
}

.login-shell {
    display: grid;
    width: min(1080px, 100%);
    min-height: min(680px, calc(100vh - 64px));
    grid-template-columns: 1.05fr 0.95fr;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 28px;
    background: var(--surface);
    box-shadow: 0 40px 90px -40px rgba(2, 6, 23, 0.85);
}

.login-brand {
    position: relative;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    justify-content: space-between;
    padding: 46px;
    background:
        radial-gradient(circle at 88% 10%, rgba(129, 140, 248, 0.35), transparent 30%),
        radial-gradient(circle at 10% 92%, rgba(var(--c-green-rgb), 0.25), transparent 34%),
        linear-gradient(150deg, var(--c-black-soft), #1e1b4b 56%, #312e81);
    color: #e2e8f0;
}

.login-brand::after {
    position: absolute;
    right: -90px;
    bottom: -90px;
    width: 280px;
    height: 280px;
    border: 1px solid rgba(199, 210, 254, 0.16);
    border-radius: 50%;
    content: "";
}

.login-brand .brand {
    position: relative;
    z-index: 1;
}

.login-brand-copy {
    position: relative;
    z-index: 1;
    max-width: 430px;
}

.login-brand .eyebrow {
    color: var(--c-blue-soft);
}

.login-brand-copy h1 {
    margin: 14px 0 16px;
    color: #ffffff;
    font-size: clamp(2rem, 3.2vw, 2.85rem);
    letter-spacing: -0.03em;
    line-height: 1.12;
}

.login-brand-copy > p {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.98rem;
    line-height: 1.7;
}

.login-points {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
    color: #cbd5e1;
    font-size: 0.86rem;
}

.login-points li {
    display: flex;
    align-items: center;
    gap: 10px;
}

.point-check {
    display: grid;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 50%;
    background: rgba(129, 140, 248, 0.18);
    color: var(--c-blue-soft);
}

.point-check svg {
    width: 13px;
    height: 13px;
    stroke-width: 2.5;
}

.login-footnote {
    position: relative;
    z-index: 1;
    margin: 0;
    color: #94a3b8;
    font-size: 0.75rem;
}

.login-panel {
    display: grid;
    padding: 46px;
    place-items: center;
}

.login-panel-inner {
    width: 100%;
    max-width: 400px;
}

.login-heading h2 {
    margin: 8px 0 8px;
    font-size: 1.65rem;
    letter-spacing: -0.025em;
}

.login-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 22px;
}

#login-error .alert {
    margin-bottom: 16px;
}

.login-help {
    margin: 22px 0 0;
    color: var(--muted);
    font-size: 0.78rem;
}

.login-help a {
    display: inline-block;
    margin-left: 4px;
    color: var(--primary);
    font-weight: 600;
}

.login-help a:hover {
    text-decoration: underline;
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    width: 280px;
    height: 100vh;
    flex: 0 0 280px;
      flex-direction: column;
      gap: 10px;
      padding: 12px 14px 14px;
    background:
        radial-gradient(circle at 16% 0%, rgba(var(--c-blue-rgb), 0.06), transparent 35%),
        radial-gradient(circle at 110% 90%, rgba(var(--c-green-rgb), 0.06), transparent 42%),
        linear-gradient(180deg, var(--surface) 0%, var(--surface-muted) 100%);
    color: var(--muted);
    box-shadow: inset -1px 0 0 var(--border);
    overflow: hidden;
}

  .admin-sidebar .brand {
      padding: 4px 8px 10px;
      border-bottom: 1px solid var(--border);
  }

.admin-sidebar .brand-mark {
    box-shadow: 0 12px 24px -14px rgba(129, 140, 248, 0.95);
}

.admin-nav {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    padding: 2px 6px 8px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, 0.22) transparent;
    overscroll-behavior: contain;
}

.admin-nav::-webkit-scrollbar {
    width: 5px;
}

.admin-nav::-webkit-scrollbar-track {
    background: transparent;
}

.admin-nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.18);
}

.admin-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.32);
}

.nav-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 10px 6px;
    color: #64748b;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.nav-label::after {
    height: 1px;
    flex: 1;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.2), transparent);
    content: "";
}

.nav-label:first-child {
    margin-top: 2px;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    color: #64748b;
    font-size: 0.84rem;
    font-weight: 500;
    transition: background 160ms ease, color 160ms ease;
}

.nav-link > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-link svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.nav-link > svg:not(.nav-group-chevron) {
    box-sizing: content-box;
    width: 16px;
    height: 16px;
    padding: 5px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.06);
    color: #64748b;
    transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.nav-link:hover {
    background: rgba(15, 23, 42, 0.05);
    color: #0f172a;
}

.nav-link:hover > svg:not(.nav-group-chevron) {
    background: rgba(var(--c-blue-rgb), 0.18);
    color: var(--c-blue-soft);
}

.nav-link.is-active {
    background: linear-gradient(90deg, rgba(var(--c-blue-rgb), 0.14), rgba(var(--c-blue-rgb), 0.05));
    color: var(--c-blue-deep);
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.28);
}

.admin-nav > .nav-link.is-active::before {
    position: absolute;
    left: -1px;
    top: 50%;
    width: 3px;
    height: 20px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--c-blue-soft), var(--c-green));
    box-shadow: 0 0 12px rgba(129, 140, 248, 0.7);
    transform: translateY(-50%);
    content: "";
}

.nav-link.is-active > svg:not(.nav-group-chevron) {
    background: linear-gradient(135deg, var(--c-blue), var(--c-green));
    color: #ffffff;
    box-shadow: 0 8px 16px -8px rgba(var(--c-blue-rgb), 0.9);
}

.nav-link:focus-visible,
.nav-sublink:focus-visible {
    outline: 2px solid rgba(129, 140, 248, 0.65);
    outline-offset: 2px;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-group-toggle {
    width: 100%;
    gap: 9px;
    padding: 8px 10px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 0.81rem;
    text-align: left;
    cursor: pointer;
}

.nav-group.is-current > .nav-group-toggle {
    background: rgba(var(--c-blue-rgb), 0.08);
    color: var(--c-blue-deep);
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.2);
}

.nav-group.is-current > .nav-group-toggle > svg:not(.nav-group-chevron) {
    background: rgba(var(--c-blue-rgb), 0.22);
    color: var(--c-blue-soft);
}

.nav-link .nav-group-chevron {
    margin-left: auto;
    width: 15px;
    height: 15px;
    color: #64748b;
    transition: transform 200ms ease, color 160ms ease;
}

.nav-group.is-current .nav-group-chevron {
    color: var(--c-blue-soft);
}

.nav-group-toggle[aria-expanded="true"] .nav-group-chevron {
    transform: rotate(180deg);
    color: var(--c-blue-soft);
}

.nav-submenu {
    display: none;
    flex-direction: column;
    gap: 1px;
    margin: 3px 0 6px 21px;
    padding: 3px 0 3px 13px;
    border-left: 1px solid rgba(129, 140, 248, 0.22);
    border-radius: 0;
    background: transparent;
}

.nav-submenu.is-open {
    display: flex;
    animation: navReveal 180ms ease both;
}

@keyframes navReveal {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-sublink {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.785rem;
    font-weight: 500;
    transition: background 160ms ease, color 160ms ease;
}

.nav-sublink::before {
    position: absolute;
    left: -16px;
    top: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.16);
    transform: translateY(-50%);
    content: "";
    transition: background 160ms ease, box-shadow 160ms ease, left 160ms ease, width 160ms ease, height 160ms ease;
}

.nav-sublink:hover {
    background: rgba(15, 23, 42, 0.05);
    color: #0f172a;
}

.nav-sublink:hover::before {
    background: var(--c-blue-soft);
}

.nav-sublink.is-active {
    background: linear-gradient(90deg, rgba(var(--c-blue-rgb), 0.14), rgba(var(--c-blue-rgb), 0.04));
    color: var(--c-blue-deep);
    box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.24);
}

.nav-sublink.is-active::before {
    left: -17px;
    width: 7px;
    height: 7px;
    background: var(--c-blue-soft);
    box-shadow: 0 0 0 3px rgba(var(--c-blue-rgb), 0.18);
    transform: translateY(-50%);
}

.nav-sublink svg {
    width: 16px;
    height: 16px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 2px;
    padding: 10px 11px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(var(--c-blue-rgb), 0.06), #ffffff);
    box-shadow: 0 16px 30px -28px rgba(15, 23, 42, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.avatar {
    position: relative;
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(199, 210, 254, 0.4);
    border-radius: 12px;
    background: linear-gradient(135deg, var(--c-blue), var(--c-green));
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 10px 20px -12px rgba(var(--c-blue-rgb), 0.55);
}

.avatar::after {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 9px;
    height: 9px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #22c55e;
    content: "";
}

.sidebar-user-info {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.sidebar-user-info strong {
    overflow: hidden;
    color: #0f172a;
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-info small {
    overflow: hidden;
    color: #64748b;
    font-size: 0.7rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-form {
    margin-left: auto;
}

.logout-form .icon-button {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    color: #64748b;
    transition: background 160ms ease, color 160ms ease;
}

.logout-form .icon-button:hover {
    background: rgba(248, 113, 113, 0.1);
    color: #dc2626;
}

.admin-main {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 32px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(244, 246, 251, 0.86);
    backdrop-filter: blur(14px);
}

.topbar-title h1 {
    margin: 0;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}

.topbar-title p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: var(--muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.topbar-user strong {
    color: var(--text);
}

.pulse {
    position: relative;
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--c-green);
}

.pulse::after {
    position: absolute;
    inset: -3px;
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: 50%;
    content: "";
    animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.8;
        transform: scale(0.8);
    }
    70%,
    100% {
        opacity: 0;
        transform: scale(1.6);
    }
}

.admin-content {
    flex: 1;
    padding: 28px 32px 42px;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.page-head-copy h2 {
    margin: 5px 0 6px;
    font-size: 1.55rem;
    letter-spacing: -0.025em;
}

.page-head-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 0.87rem;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.stat-icon {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 14px;
}

.stat-icon svg {
    width: 22px;
    height: 22px;
}

.stat-icon-primary {
    background: var(--primary-soft);
    color: var(--primary);
}

.stat-icon-success {
    background: var(--success-soft);
    color: var(--success);
}

.stat-icon-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.stats-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-icon-warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.stat-icon-indigo {
    background: var(--c-blue-soft);
    color: var(--c-blue-deep);
}

.stat-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.stat-copy span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 500;
}

.stat-copy strong {
    color: var(--text);
    font-size: 1.55rem;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.9fr);
    gap: 18px;
    align-items: start;
}

.dashboard-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px 0;
}

.card-header h2 {
    margin: 0;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.card-header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.table-wrap {
    overflow-x: auto;
    padding: 10px 10px 8px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

.data-table th {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.data-table td {
    padding: 13px 12px;
    border-bottom: 1px solid #eef2f7;
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

.table-title {
    color: var(--text);
    font-weight: 600;
}

.table-sub {
    max-width: 360px;
    margin-top: 2px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.77rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table-empty {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 30px 12px;
    color: var(--muted);
    text-align: center;
}

.table-empty strong {
    color: var(--text);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.71rem;
    font-weight: 600;
}

.badge::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.badge-success {
    background: var(--success-soft);
    color: var(--success);
}

.badge-muted {
    background: #f1f5f9;
    color: #64748b;
}

.badge-info {
    background: var(--c-blue-soft);
    color: var(--c-blue-deep);
}

.badge-warning {
    background: var(--warning-soft);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.chip {
    display: inline-flex;
    padding: 4px 9px;
    border-radius: 8px;
    background: #f1f5f9;
    color: #475569;
    font-size: 0.71rem;
    font-weight: 600;
}

.breakdown {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px 22px 22px;
}

.breakdown-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.8rem;
}

.breakdown-meta span {
    color: var(--muted);
}

.progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #eef2f7;
}

.progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--c-blue), var(--c-green));
}

.empty-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

.quick-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px 18px;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    transition: background 150ms ease, border-color 150ms ease;
}

.quick-link:hover {
    border-color: var(--border);
    background: var(--surface-muted);
}

.quick-icon {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
}

.quick-icon svg {
    width: 17px;
    height: 17px;
}

.quick-link > span:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.quick-link strong {
    font-size: 0.84rem;
}

.quick-link small {
    color: var(--muted);
    font-size: 0.75rem;
}

.content-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
    gap: 18px;
    align-items: start;
}

.content-table-card {
    min-width: 0;
}

.content-form-card {
    position: sticky;
    top: 92px;
    padding: 20px;
}

.table-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
}

.search-form {
    position: relative;
    display: flex;
    max-width: 480px;
    flex: 1 1 320px;
    align-items: center;
    gap: 8px;
}

.search-form input {
    width: 100%;
    padding: 9px 12px 9px 38px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-muted);
    color: var(--text);
    font-size: 0.84rem;
    outline: none;
    transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.search-form input::placeholder {
    color: #94a3b8;
}

.search-form input:focus {
    border-color: var(--c-blue-soft);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(var(--c-blue-rgb), 0.1);
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    color: #94a3b8;
    pointer-events: none;
    transform: translateY(-50%);
}

.search-icon svg {
    width: 16px;
    height: 16px;
}

.search-form .spinner {
    color: var(--primary);
}

.result-count {
    color: var(--muted);
    font-size: 0.77rem;
    white-space: nowrap;
}

.filter-select {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.84rem;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.filter-select:focus {
    border-color: var(--c-blue-soft);
    box-shadow: 0 0 0 4px rgba(var(--c-blue-rgb), 0.1);
}

.content-table {
    min-width: 660px;
}

.data-table .row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}

.row-actions form {
    display: inline-flex;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid var(--border);
}

.pagination-info {
    color: var(--muted);
    font-size: 0.77rem;
}

.form-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.form-header h2 {
    margin: 4px 0 0;
    font-size: 1.1rem;
    letter-spacing: -0.015em;
}

.content-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.content-form-card > .alert {
    margin-bottom: 14px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.panel-placeholder {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 18px 4px;
}

.placeholder-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border-radius: 16px;
    background: var(--primary-soft);
    color: var(--primary);
}

.placeholder-icon svg {
    width: 24px;
    height: 24px;
}

.panel-placeholder h3 {
    margin: 6px 0 0;
    font-size: 1.05rem;
}

.panel-placeholder p {
    margin: 0;
    color: var(--muted);
    font-size: 0.84rem;
}

.panel-placeholder .alert {
    width: 100%;
}

@media (max-width: 1180px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-grid.stats-grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-grid,
    .content-layout {
        grid-template-columns: 1fr;
    }

    .content-form-card {
        position: static;
    }
}

@media (max-width: 980px) {
    .admin-shell {
        flex-direction: column;
    }

    .admin-sidebar {
        position: static;
        width: 100%;
        height: auto;
        flex: 0 0 auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px 16px;
        padding: 16px;
        overflow: visible;
    }

    .admin-sidebar .brand {
        padding: 0;
        border-bottom: 0;
    }

    .admin-nav {
        order: 3;
        flex: 1 1 100%;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px;
        margin-left: 0;
        padding: 0;
        overflow: visible;
    }

    .nav-group:has(.nav-submenu.is-open) {
        flex: 1 1 100%;
    }

    .nav-group:has(.nav-submenu.is-open) .nav-submenu {
        margin-left: 18px;
    }

    .nav-label {
        display: none;
    }

    .sidebar-user {
        order: 2;
        margin: 0 0 0 auto;
        padding: 6px 10px;
    }

    .sidebar-user-info {
        display: none;
    }

    .admin-topbar {
        padding: 18px 22px;
    }

    .admin-content {
        padding: 22px;
    }
}

@media (max-width: 720px) {
    .login-body {
        padding: 18px;
    }

    .login-shell {
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .login-brand {
        gap: 24px;
        padding: 26px;
    }

    .login-brand-copy h1 {
        font-size: 1.7rem;
    }

    .login-points {
        display: none;
    }

    .login-panel {
        padding: 30px 22px;
    }

    .page-head {
        flex-direction: column;
        align-items: stretch;
    }

    .action-row {
        justify-content: flex-start;
    }

    .stats-grid,
    .stats-grid-3 {
        grid-template-columns: 1fr;
    }

    .stats-grid.stats-grid-3 {
        grid-template-columns: 1fr;
    }

    .field-row {
        grid-template-columns: 1fr;
    }

    .topbar-user-text {
        display: none;
    }

    .admin-topbar {
        align-items: center;
        padding: 16px 18px;
    }

    .admin-content {
        padding: 20px 16px 32px;
    }

    .search-form {
        max-width: none;
    }

    .content-form-card {
        padding: 16px;
    }
}

@media (max-width: 520px) {
    .admin-sidebar {
        padding: 14px;
    }

    .nav-link {
        padding: 7px 8px;
        font-size: 0.8rem;
    }

    .nav-link > svg:not(.nav-group-chevron) {
        padding: 4px;
    }

    .brand-text small {
        display: none;
    }

    .login-brand-copy > p {
        display: none;
    }

    .page-head-copy h2 {
        font-size: 1.35rem;
    }

    .stat-card {
        padding: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ------------------------------------------------------------
   Category list Ã¢â‚¬â€ section-wise, 4 products per category
   ------------------------------------------------------------ */

.cat-sections {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-bottom: 8px;
}

.cat-section {
    padding: 20px 22px 22px;
}

.cat-section-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--border);
}

.cat-section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-weight: 700;
    font-size: 0.85rem;
}

.cat-section-title {
    flex: 1 1 auto;
    min-width: 150px;
}

.cat-section-title h3 {
    margin: 0;
    font-size: 0.98rem;
    letter-spacing: -0.01em;
}

.cat-section-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
}

.cat-section-actions {
    margin-left: auto;
    gap: 8px;
}

.cat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.cat-product {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    overflow: hidden;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.cat-product:hover {
    transform: translateY(-2px);
    border-color: var(--c-blue-soft);
    box-shadow: 0 16px 30px -20px rgba(79, 70, 229, 0.55);
}

.cat-thumb {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--surface-muted);
    overflow: hidden;
}

.cat-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cat-thumb-ph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--muted);
    font-size: 1.7rem;
    font-weight: 700;
}

.cat-flag {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.cat-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    padding: 11px 12px 13px;
}

.cat-name {
    margin: 0;
    max-width: 100%;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.cat-sale {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.cat-cur {
    margin-right: 1px;
    font-size: 0.78em;
    color: var(--muted);
}

.cat-regular {
    color: var(--muted);
    font-size: 0.76rem;
}

.cat-empty {
    grid-column: 1 / -1;
    padding: 24px 20px;
    border: 1px dashed var(--border);
    border-radius: 14px;
    background: var(--surface-muted);
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
}

.cat-empty strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-size: 0.88rem;
}

@media (max-width: 1080px) {
    .cat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .cat-grid {
        grid-template-columns: 1fr;
    }

    .cat-section {
        padding: 16px;
    }

    .cat-section-actions {
        margin-left: 0;
        width: 100%;
    }
}

/* --- Login page: big create-account CTA --- */
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 26px 0 16px;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.login-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: 1.5px solid var(--primary);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(var(--c-accent-rgb, 14, 111, 87), 1) 0%, var(--primary-strong) 100%);
    color: #fff;
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.login-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px -8px rgba(var(--c-black-rgb), 0.35);
    filter: saturate(1.1);
    text-decoration: none;
}

.login-cta-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.18);
}

.login-cta-icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.login-cta-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    line-height: 1.25;
}

.login-cta-text strong {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.login-cta-text small {
    font-size: 0.76rem;
    opacity: 0.85;
}

.login-cta-arrow {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 160ms ease;
}

.login-cta:hover .login-cta-arrow {
    transform: translateX(4px);
}

.login-back-link {
    display: inline-block;
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
}

.login-back-link:hover {
    color: var(--primary);
}

/* --- Admin topbar: logout button top-right --- */
.topbar-logout {
    display: inline-flex;
    margin-left: 6px;
    padding-left: 12px;
    border-left: 1px solid var(--border);
}

.topbar-logout .icon-button {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    color: var(--danger);
    background: var(--danger-soft);
}

.topbar-logout .icon-button:hover {
    background: #fde8e8;
    color: #b91c1c;
}

.ov-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid rgba(var(--c-green-rgb), 0.3);
    background: var(--success-soft);
    color: var(--success);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.ov-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(var(--c-green-rgb), 0.16);
    animation: ov-pulse 1.8s infinite ease;
}

@keyframes ov-pulse {
    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 4px rgba(var(--c-green-rgb), 0.16);
    }
    50% {
        opacity: 0.55;
        box-shadow: 0 0 0 6px rgba(var(--c-green-rgb), 0.1);
    }
}

.ov-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--ov-tint) 0%, var(--surface) 70%);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.ov-card::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, var(--ov-c) 0%, transparent 78%);
    opacity: 0.85;
}

.ov-card:hover {
    transform: translateY(-3px);
    border-color: var(--ov-c);
    box-shadow: 0 24px 46px -30px rgba(15, 23, 42, 0.5);
}

.ov-ico {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    flex: 0 0 auto;
    border-radius: 15px;
    background: var(--ov-tint);
    border: 1px solid rgba(15, 23, 42, 0.06);
    color: var(--ov-c);
    transition: background 0.18s ease, color 0.18s ease;
}

.ov-card:hover .ov-ico {
    background: var(--ov-c);
    color: #ffffff;
}

.ov-ico svg {
    width: 23px;
    height: 23px;
}

.ov-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ov-copy small {
    color: var(--muted);
    font-size: 0.71rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.ov-copy strong {
    font-size: 1.62rem;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: var(--c-black);
}

.ov-copy em {
    font-style: normal;
    color: var(--muted);
    font-size: 0.74rem;
}

.ov-green {
    --ov-c: var(--success);
    --ov-tint: rgba(var(--c-green-rgb), 0.1);
}

.ov-blue {
    --ov-c: var(--primary);
    --ov-tint: rgba(var(--c-blue-rgb), 0.09);
}

.ov-warning {
    --ov-c: var(--warning);
    --ov-tint: rgba(217, 119, 6, 0.11);
}

.ov-delivered {
    --ov-c: var(--c-green-deep);
    --ov-tint: rgba(var(--c-green-rgb), 0.11);
}

.ov-indigo {
    --ov-c: var(--c-blue-deep);
    --ov-tint: rgba(var(--c-blue-soft-rgb), 0.18);
}

.ov-danger {
    --ov-c: var(--danger);
    --ov-tint: rgba(220, 38, 38, 0.09);
}

.page-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.page-tab-btn {
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    border-radius: 999px;
    padding: 9px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.page-tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.page-tab-btn.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}


/* HTMX Progress & Feedback */
#htmx-progress { position: fixed; top: 0; left: 0; height: 3px; background: #0e6f57; z-index: 999999; width: 0; opacity: 0; pointer-events: none; transition: width 250ms ease, opacity 150ms ease; }
body.htmx-request #htmx-progress, .htmx-request#htmx-progress { opacity: 1; width: 80%; }
#product-table-wrap.htmx-request, .table-wrap.htmx-request { opacity: 0.6; pointer-events: none; transition: opacity 120ms ease; }
