:root {
    --navy: #0D1B2A;
    --navy-2: #162234;
    --slate: #1E3A5F;

    --accent: #E8A020;
    --accent-2: #F5C45E;

    --muted: #8FA3B8;
    --surface: #F4F7FA;
    --white: #FFFFFF;

    --border: rgba(255,255,255,0.08);
    --border-soft: #E2EAF0;
    --border-light: #F0F5F9;

    --radius: 12px;

    --ff-head: 'Syne', sans-serif;
    --ff-body: 'DM Sans', sans-serif;
}

/* ──────────────────────────────────────────────
   Base
────────────────────────────────────────────── */

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

body {
    margin: 0;
    background: var(--surface);
    color: var(--navy);
    font-family: var(--ff-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

a {
    text-decoration: none;
}

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

.text-accent {
    color: var(--accent);
}

/* ──────────────────────────────────────────────
   Navbar
────────────────────────────────────────────── */

.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;

    height: 64px;
    padding: 0 2rem;

    background: var(--navy);
    border-bottom: 1px solid var(--border);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;

    color: var(--white) !important;
    font-family: var(--ff-head);
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.brand-icon {
    width: 32px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 8px;

    background: var(--accent);
    color: var(--navy);
}

.brand-sub {
    display: block;

    margin-top: 1px;

    color: var(--muted);

    font-size: 0.65rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    line-height: 1;
    text-transform: uppercase;
}

.navbar-nav > .nav-item > .nav-link {
    display: flex;
    align-items: center;
    gap: 6px;

    padding: 0.35rem 0.9rem !important;

    border-radius: 6px;

    color: var(--muted) !important;

    transition:
        color 0.2s,
        background 0.2s;
}

.navbar-nav > .nav-item > .nav-link.active,
.nav-link.active,
.nav-tabs > .nav-item > .nav-link.active {
    color: var(--accent) !important;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,0.07);
    color: var(--white) !important;
}

.navbar-toggler {
    border: 1px solid var(--border);
}

.avatar-circle {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    margin-left: 4px;

    border: 2px solid rgba(255,255,255,0.15);
    border-radius: 50%;

    background: var(--slate);
    color: var(--muted);

    font-size: 0.8rem;
    font-weight: 600;

    cursor: pointer;
}

/* ──────────────────────────────────────────────
   Hero
────────────────────────────────────────────── */

.hero {
    position: relative;
    overflow: hidden;

    padding: 6rem 0 5rem;

    background: var(--navy);
}

.hero::before {
    content: '';

    position: absolute;
    top: -80px;
    right: -80px;

    width: 500px;
    height: 500px;

    background:
        radial-gradient(
            circle,
            rgba(232,160,32,0.12) 0%,
            transparent 70%
        );
}

.hero-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    margin-bottom: 1.5rem;
    padding: 0.35rem 0.9rem;

    border: 1px solid rgba(232,160,32,0.25);
    border-radius: 100px;

    background: rgba(232,160,32,0.12);
    color: var(--accent);

    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero h1 {
    margin-bottom: 1.25rem;

    color: var(--white);

    font-family: var(--ff-head);
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
}

.hero h1 span {
    color: var(--accent);
}

.hero p.lead {
    max-width: 480px;
    margin-bottom: 2rem;

    color: var(--muted);

    font-size: 1.05rem;
    font-weight: 300;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.hero-stats {
    display: flex;
    gap: 2rem;

    margin-top: 3rem;
    padding-top: 2rem;

    border-top: 1px solid var(--border);
}

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

.btn-primary-custom,
.btn-nav-primary,
.btn-save,
.btn-delete,
.btn-add,
.btn-group-child {
    display: inline-flex;
    align-items: center;

    border: none;
    border-radius: 8px;
    padding: 0.45rem 1rem;

    background: var(--accent);
    color: var(--navy);

    font-size: 0.85rem;
    font-weight: 700;

    transition:
        background 0.2s,
        transform 0.15s;
    
    gap: 6px;
}

.btn-save.btn-group {
    border-top-right-radius: 0px !important;
    border-bottom-right-radius: 0px !important;
}

.btn-group .dropdown-menu {
    border-radius: 8px;
}

.btn-primary-custom:hover,
.btn-nav-primary:hover,
.btn-save:hover,
.btn-add:hover,
.btn-save.dropdown-toggle.show {
    background: var(--accent-2);
    color: var(--navy);
}

.btn-delete {
    color: white;
    background: red;
}

.btn-outline-hero,
.btn-cancel,
.btn-add-sm {
    display: inline-flex;
    align-items: center;

    border-radius: 8px;
    padding: 0.45rem 0.9rem;

    font-size: 0.8rem;
    font-weight: 600;

    transition: 0.2s;
}

.btn-outline-hero {
    border: 1px solid rgba(255,255,255,0.2);

    background: transparent;
    color: var(--white);
}

.btn-outline-hero:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.45);
}

.btn-cancel {
    border: 1px solid var(--border-soft);

    background: var(--surface);
    color: #5A7080;
}

.btn-cancel:hover { border-color: #B0BEC8; color: var(--navy); }

.btn-add-sm {
    border: 1px solid rgba(232,160,32,0.35);

    background: transparent;
    color: var(--accent);
}

.btn-add-sm:hover {
    background: rgba(232,160,32,0.1);
}

.btn-icon {
    width: 26px;
    height: 26px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: 1px solid var(--border-soft);
    border-radius: 6px;

    background: var(--white);
    color: var(--navy);

    cursor: pointer;
    transition: 0.15s;
}

.btn-icon:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-icon.danger:hover {
    border-color: #EF4444;
    color: #EF4444;
}

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

.card-base,
.sidebar-card,
.main-card,
.feature-card,
.assessment-table,
.quick-action,
.hero-card {
    border: 1px solid var(--border-soft);
    border-radius: 16px;

    background: var(--white);
}

.hero-card {
    background: var(--navy-2);
    border-color: rgba(255,255,255,0.1);

    padding: 1.75rem;
}

.sidebar-card {
    position: sticky;
    top: 80px;

    overflow: hidden;
}

.main-card,
.assessment-table {
    overflow: hidden;
}

.feature-card,
.quick-action {
    transition:
        box-shadow 0.2s,
        transform 0.2s;
}

.feature-card:hover,
.quick-action:hover {
    box-shadow: 0 8px 32px rgba(13,27,42,0.10);
    transform: translateY(-3px);
}

/* ──────────────────────────────────────────────
   Page Header
────────────────────────────────────────────── */

  /* ── Page Layout ──────────────────────────────────── */
  .page-header {
    background: var(--white);
    border-bottom: 1px solid #E2EAF0;
    padding: 2rem 0;
  }
  .page-title {
    font-family: var(--ff-head);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--navy);
    letter-spacing: -0.02em;
    margin: 0;
  }
  .page-subtitle {
    font-size: 0.875rem;
    color: var(--muted);
    margin: 0.25rem 0 0;
  }
  .breadcrumb {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
  }
  .breadcrumb-item a { color: var(--accent); text-decoration: none; }
  .breadcrumb-item.active { color: var(--muted); }
  .breadcrumb-item + .breadcrumb-item::before { color: var(--muted); }

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

.template-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.25rem;

    align-items: start;
}

/* ──────────────────────────────────────────────
   Sidebar
────────────────────────────────────────────── */

.sidebar-header,
.main-card-header {
    padding: 1rem 1.25rem;

    border-bottom: 1px solid var(--border-light);
}

.main-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.sidebar-title {
    margin: 0;

    color: #8FA3B8;

    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bt-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0.75rem 1.25rem;

    border-bottom: 1px solid #F8FAFC;

    color: var(--navy);

    transition: background 0.15s;
}

.bt-item:hover {
    background: #F8FAFC;
    color: var(--navy);
}

.bt-item.active {
    border-left: 3px solid var(--accent);

    background: rgba(232,160,32,0.08);
}

.bt-item-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.bt-item-count {
    padding: 0.15rem 0.5rem;

    border: 1px solid var(--border-soft);
    border-radius: 99px;

    background: var(--surface);
    color: var(--muted);

    font-size: 0.72rem;
}

/* ──────────────────────────────────────────────
   Category / Question
────────────────────────────────────────────── */

.cat-block {
    border-bottom: 1px solid var(--border-light);
}

.cat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    cursor: pointer;
    user-select: none;

    transition: background 0.15s;
}

.cat-header:hover {
    background: #FAFCFE;
}

.cat-title {
    display: flex;
    align-items: center;
    gap: 8px;

    color: var(--navy);

    font-size: 0.9rem;
    font-weight: 700;
}

.cat-meta {
    margin-top: 1px;

    color: var(--muted);

    font-size: 0.75rem;
}

.cat-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-body {
    padding: 0 1.5rem 1rem;
}

/* ──────────────────────────────────────────────
   Empty State
────────────────────────────────────────────── */

.empty-state {
    padding: 4rem 1.5rem;

    text-align: center;
    color: var(--muted);
}

.empty-state i {
    display: block;

    margin-bottom: 0.75rem;

    font-size: 2.5rem;
    opacity: 0.35;
}

/* ──────────────────────────────────────────────
   Modal
────────────────────────────────────────────── */

.modal-content {
    border: 1px solid var(--border-soft);
    border-radius: 16px;

    box-shadow: 0 20px 60px rgba(13,27,42,0.15);
}

.modal-header,
.modal-footer {
    padding: 1rem 1.5rem;

    border-color: var(--border-light);
}

.modal-body {
    padding: 1.5rem;
}

.modal-title {
    color: var(--navy);

    font-family: var(--ff-head);
    font-size: 1rem;
    font-weight: 700;
}

.form-label {
    margin-bottom: 0.4rem;

    color: #5A7080;

    font-size: 0.8rem;
    font-weight: 600;
}

.form-label.required::after {
  content: " *";
  color: red;
}

.form-control,
.form-select {
    border: 1px solid var(--border-soft);
    border-radius: 8px;

    color: var(--navy);

    font-size: 0.875rem;
    font-family: var(--ff-body);

    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--accent);

    box-shadow: 0 0 0 3px rgba(232,160,32,0.15);

    outline: none;
}

.hint {
    margin-top: 4px;

    color: var(--muted);

    font-size: 0.75rem;
}

/* ──────────────────────────────────────────────
   Footer
────────────────────────────────────────────── */

footer {
    padding: 1rem 1.5rem;

    border-top: 1px solid var(--border);

    background: var(--navy);
    color: var(--muted);

    font-size: 0.8rem;
    text-align: center;
}

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

.chevron {
    color: var(--muted);

    font-size: 0.9rem;

    transition: transform 0.2s;
}

.chevron.open {
    transform: rotate(180deg);
}

.d-none {
    display: none;
}

/* ──────────────────────────────────────────────
   Responsive
────────────────────────────────────────────── */

@media (max-width: 900px) {
    .template-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 4rem 0 3rem;
    }

    .hero-stats {
        gap: 1.25rem;
    }

    .hero-card {
        margin-top: 2.5rem;
    }
}

.master-tab {
    text-decoration: none;
}

.cat-header.accordion-button:not(.collapsed) {
    background: rgba(232,160,32,0.10) !important;
    color: var(--navy) !important;
}

#saris-toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    z-index: 9999;
    pointer-events: none;
    width: 340px;
}

.saris-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 0.875rem 1rem;
    background: var(--white);
    border: 1px solid var(--border-soft);
    border-left: 4px solid var(--accent);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(13,27,42,0.10);
    pointer-events: all;
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    position: relative;
    overflow: hidden;
}
.saris-toast.show { opacity: 1; transform: translateX(0); }
.saris-toast.hide { opacity: 0; transform: translateX(24px); }

.saris-toast.toast-success { border-left-color: #22C55E; }
.saris-toast.toast-error   { border-left-color: #EF4444; }
.saris-toast.toast-warning { border-left-color: var(--accent); }
.saris-toast.toast-info    { border-left-color: #3B82F6; }

.toast-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
}
.toast-success .toast-icon { background: #F0FDF4; color: #16A34A; }
.toast-error   .toast-icon { background: #FEF2F2; color: #DC2626; }
.toast-warning .toast-icon { background: rgba(232,160,32,0.12); color: var(--accent); }
.toast-info    .toast-icon { background: #EFF6FF; color: #2563EB; }

.toast-body { flex: 1; min-width: 0; }
.toast-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 2px;
    letter-spacing: -0.01em;
}
.toast-msg {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 0 0 4px;
    color: var(--muted);
    font-size: 14px;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.toast-close:hover { opacity: 1; }

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    border-radius: 0 0 0 8px;
    animation: saris-shrink linear forwards;
}
.toast-success .toast-progress { background: #22C55E; }
.toast-error   .toast-progress { background: #EF4444; }
.toast-warning .toast-progress { background: var(--accent); }
.toast-info    .toast-progress { background: #3B82F6; }

@keyframes saris-shrink { from { width: 100%; } to { width: 0%; } }


/* ── Empty state (user-side) ──────────────────────────── */

.data-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted) !important;
}
.data-empty td {
  color: var(--muted) !important;
}

.data-empty a { color:var(--accent) }
.data-empty i { font-size: 3rem; opacity: 0.25; display: block; margin-bottom: 1rem; }
.data-empty p { margin: 0; font-size: 0.875rem; }

.data-empty .empty-title {
  font-weight:700;
  color: var(--navy);
  margin-bottom:0.25rem;
}