/* ---------------------------------------------------
   GLOBAL.CSS — SHARED STRUCTURE STYLES
---------------------------------------------------- */

:root {
    --tt-navy: #002357;
    --tt-hero: #003C85;
    --tt-gold: #BC8A36;
    --tt-footer: #002357;
    --tt-cream: #F7F3EB;
    --tt-page-width: 1200px;
    --tt-page-gap: clamp(18px, 3vw, 32px);
}

/* RESET WITHOUT OVERRIDING DESIGN */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* BASE TEXT SETTINGS */
html, body {
    height: 100%;
}

body {
    font-family: "Montserrat", sans-serif;
    line-height: 1.5;
    color: #071425;
    background: var(--tt-cream);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.app-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: var(--tt-cream);
}

.app-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* LINKS */
a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    opacity: 0.85;
}

/* GENERIC CONTAINER (does not affect landing page) */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* BUTTON UTILITY — does not override landing page */
.btn {
    display: inline-block;
    padding: 10px 18px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
}

/* GOLD BUTTON OPTION */
.btn-gold {
    background: var(--tt-gold);
    color: #071425;
}

main {
    flex: 1 0 auto;
    width: 100%;
    max-width: min(var(--tt-page-width), 100%);
    margin: 0 auto;
    padding-top: 32px;
    padding-bottom: 48px;
    padding-inline: var(--tt-page-gap);
    box-sizing: border-box;
}

/* ===============================
   GLOBAL HEADER / HERO / FOOTER
=============================== */
.tt-header {
    width: 100%;
    background: var(--tt-navy) !important;
    padding: 0 !important;
}

.tt-header-inner {
    width: 100%;
    max-width: min(var(--tt-page-width), 100%) !important;
    margin: 0 auto !important;
    padding: 16px var(--tt-page-gap) !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
}

.tt-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tt-brand img {
    height: 54px !important;
}

.tt-brand-title {
    font-size: 26px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    line-height: 1.05 !important;
}

.tt-brand-tagline {
    font-size: 16.25px !important;
    font-weight: 550 !important;
    color: #F6CC6D !important;
    margin-top: -4px !important;
}

.tt-nav {
    margin-left: auto;
}

.tt-nav .nav-logged-in,
.tt-nav .nav-logged-out {
    display: none;
}

body.logged-in .tt-nav {
    display: block;
}

body.logged-in .nav-logged-in {
    display: grid;
    grid-template-columns: repeat(4, max-content);
    column-gap: 18px;
    row-gap: 8px;
    justify-content: end;
    align-items: center;
}

body.logged-in .nav-logged-out {
    display: none;
}

body:not(.logged-in) .tt-nav {
    display: flex;
    gap: 18px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

body:not(.logged-in) .nav-logged-out {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

body:not(.logged-in) .nav-logged-in {
    display: none;
}

.tt-nav a {
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.dashboard-nav-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.dashboard-nav-row {
    display: grid;
    grid-template-columns: repeat(4, max-content);
    gap: 18px;
    justify-content: flex-end;
}

.dashboard-nav-row a {
    display: block;
    padding: 6px 0;
    text-align: center;
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
}

.dashboard-nav-row a.active,
.dashboard-nav-row a:hover {
    color: #ffe082;
}

@media (max-width: 900px) {
    .dashboard-nav-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tt-header-inner {
        flex-wrap: wrap;
    }
}

.tt-dashboard-link {
    display: inline-block;
    margin: 6px 0 12px 0;
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
    opacity: 0.85;
    text-decoration: none;
}

.tt-dashboard-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.tt-nav-toggle {
    display: none;
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid #f6cc6d;
    background: transparent;
    color: #fff;
    font-weight: 700;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.tt-hero {
    background: var(--tt-hero) !important;
    text-align: center !important;
    padding: 38px var(--tt-page-gap) 42px !important;
    border-bottom: 4px solid var(--tt-gold) !important;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tt-hero > * {
    width: 100%;
    max-width: min(var(--tt-page-width), 100%);
    margin: 0 auto;
}

.tt-hero h1 {
    margin: 0 !important;
    color: #ffffff !important;
    font-size: 40px !important;
    font-weight: 800 !important;
    line-height: 1.08 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.tt-hero p {
    margin-top: 0 !important;
    font-size: 19px !important;
    color: #f0c75e !important;
    font-weight: 600 !important;
    line-height: 1.35 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.tt-footer {
    width: 100%;
    background: var(--tt-footer) !important;
    color: #fff !important;
    text-align: center;
    padding: 28px var(--tt-page-gap) !important;
    font-size: 0.85rem !important;
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
}

.tt-footer > * {
    width: 100%;
    max-width: min(var(--tt-page-width), 100%);
    margin: 0 auto;
}

.tt-footer .footer-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 0;
}

.tt-footer .footer-links a {
    color: #ffffff;
    font-weight: 600;
}

.footer-links__group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
}

body.logged-in .footer-logged-out {
    display: none;
}

body.logged-in .footer-logged-in {
    display: flex;
}

body:not(.logged-in) .footer-logged-in {
    display: none;
}

body:not(.logged-in) .footer-logged-out {
    display: flex;
}

.micro-ref {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 450;
    font-style: italic;
    color: #0b1f33;
    margin: 14px 0 8px;
    margin-bottom: 15px;
    line-height: 1.4;
}

/* FORM ELEMENTS */
input, select, textarea {
    font-family: inherit;
}

/* GRID UTILITY FOR CALCULATORS */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

/* HIDES ELEMENTS GLOBALLY */
.hidden {
    display: none !important;
}

/* SAFE MARGINS */
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }

/* FEATURE LOCKED CARD */
.feature-locked {
    border: 1px solid #d7b15f;
    background: #fffaf0;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.06);
}

.feature-locked h2 {
    color: #0b3a6e;
    font-weight: 800;
}

.feature-locked p {
    color: #2b4060;
    font-weight: 600;
    margin-top: 6px;
}

/* SAVE TO CASE PROMPT */
.case-save-prompt {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px solid #0b3a6e;
    border-radius: 10px;
    background: #ffffff;
    color: #0b1f33;
    box-shadow: 0 10px 20px rgba(7, 20, 37, 0.08);
    width: 100%;
    max-width: 760px;
}

.case-save-title {
    font-weight: 700;
    margin-bottom: 8px;
}

.case-save-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 14px;
}

.case-save-input,
.case-save-select {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d9c08c;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.95rem;
    background: #fff;
    color: #0a274f;
    margin-bottom: 6px;
}

.case-save-btn {
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid #0a2f58;
    background: #0b3a6e;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.case-save-cancel {
    margin-top: 8px;
    background: transparent;
    border: none;
    color: #0b3a6e;
    font-weight: 700;
    cursor: pointer;
}

.case-save-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    margin-bottom: 6px;
}

@media (max-width: 900px) {
    .tt-header-inner {
        flex-wrap: wrap;
    }

    .tt-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .tt-nav {
        display: none;
        width: 100%;
        margin-left: 0;
    }

    body.nav-open .tt-nav {
        display: block;
        padding: 10px 0 4px;
    }

    body.nav-open .nav-logged-in {
        display: grid;
        grid-template-columns: 1fr;
        row-gap: 8px;
    }

    body.nav-open .nav-logged-out {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
}

/* SAVE/ASSIGN MODAL + TOAST */
.tt-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tt-modal.tt-modal-inline {
    position: static;
    inset: auto;
    align-items: stretch;
    justify-content: center;
    margin-top: 12px;
    display: block;
}

.tt-modal.tt-modal-inline .tt-modal-backdrop {
    display: none;
}

.tt-modal.tt-modal-inline .tt-modal-card {
    width: min(720px, 100%);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
}

.tt-create-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #0b2d58;
}

.tt-create-case-hint {
    font-size: 0.75rem;
    color: #4d5780;
    margin: 0;
}

.tt-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 20, 40, 0.55);
}

.tt-modal-card {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: min(720px, 92vw);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.25);
    padding: 20px 22px;
    z-index: 1;
}

.tt-create-panel {
    position: relative;
    background: #fff;
    border: 1px solid #e6d9be;
    border-radius: 16px;
    padding: 20px 24px;
    margin: var(--tt-page-gap) 0;
    box-shadow: 0 12px 30px rgba(7, 20, 37, 0.08);
}

.tt-create-panel-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.tt-create-panel label {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    color: #0b2d58;
}

.tt-create-error {
    color: #b31818;
    font-size: 0.85rem;
    min-height: 1.2em;
}

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

.tt-modal-header h3 {
    margin: 0;
    font-size: 20px;
}

.tt-modal-close {
    border: 0;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
}

.tt-modal-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tt-tab {
    border: 1px solid #d6d6d6;
    background: #f3f5f9;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
}

.tt-tab.active {
    background: #0b3a6e;
    color: #fff;
    border-color: #0b3a6e;
}

.tt-tab-panel {
    display: none;
    gap: 10px;
    flex-direction: column;
}

.tt-tab-panel.active {
    display: flex;
}

.tt-input {
    border: 1px solid #d8d8d8;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
}

.tt-case-list {
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    padding: 8px;
    max-height: 220px;
    overflow: auto;
}

.tt-case-row {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: #f9f9fb;
    margin-bottom: 6px;
    cursor: pointer;
}

.tt-case-row.active {
    border-color: #0b3a6e;
    background: #e8f0fb;
}

.tt-empty {
    padding: 10px 12px;
    color: #5c5c5c;
}

.tt-modal-footer {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.tt-selected-case {
    font-weight: 600;
}

.tt-modal-actions {
    display: flex;
    gap: 10px;
}

.tt-btn {
    border: none;
    border-radius: 12px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
}

.tt-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tt-btn-outline {
    border: 1px solid #c9c9c9;
    background: #fff;
    color: #0c2049;
}

.tt-btn-blue {
    background: #1b5fa7;
    color: #fff;
}

.tt-btn-gold {
    background: #f6cc6d;
    color: #111;
}

.tt-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    background: #0b3a6e;
    color: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10001;
}

.tt-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.tt-save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2a63bf;
    color: #fff;
    border: 2px solid #2456a8;
    padding: 11px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 11.5px;
    line-height: 1;
    height: 36px;
    box-sizing: border-box;
    cursor: pointer;
}

.tt-print-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f5f6f7;
    color: #0b1f33;
    border: 2px solid #d2d6dc;
    padding: 11px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 11.5px;
    line-height: 1;
    height: 36px;
    box-sizing: border-box;
    cursor: pointer;
}
