﻿/* ------------------------------------
   1. Reset & Base
------------------------------------ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-family: Inter, sans-serif;
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: #f8f9fa;
    color: #212529;
}

/* ------------------------------------
   2. Layout Utilities
------------------------------------ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.dashboard-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background-color: #ffffff;
    border-bottom: 1px solid #e9ecef;
    z-index: 100;
}

    .dashboard-nav .logo img {
        height: 60px;
        width: auto;
    }

.dashboard-main {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}


/* ==== Header Layout ==== */
.tz-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.tz-header {
    background: #fff;
    border-bottom: 1px solid #eef1f4;
    box-shadow: 0 1px 0 rgba(0,0,0,.02);
    margin-bottom: 2rem;
    z-index: 1100;
}

.tz-brand {
    display: flex;
    align-items: center;
}

.tz-logo {
    height: 40px;
}

.tz-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
}

.tz-links {
    list-style: none;
    display: flex;
    gap: 18px;
    margin: 0;
    padding: 0;
}

    .tz-links a {
        color: #004f8b;
        font-weight: 600;
        text-decoration: none;
        padding: 6px 8px;
        border-radius: 8px;
    }

        .tz-links a:hover {
            background: #f2f6fb;
            font-weight: 600;
        }

.tz-header .tz-nav .tz-links a {
    font-size: 20px; /* or whatever size you want */
}


/* Account dropdown */
.tz-account-wrap {
    display: flex;
    align-items: center;
}

.tz-dropdown {
    position: relative;
    z-index: 3000;
}

/*.tz-account-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #004f8b;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 8px 12px;
}*/

.tz-account-btn {
    display: flex !important; /* defeat any .btn display override */
    align-items: center;
    gap: 8px;
    white-space: nowrap; /* prevent line wraps */
}

    .tz-account-btn .tz-avatar,
    .tz-account-btn .tz-account-label,
    .tz-account-btn .tz-caret {
        display: inline-flex; /* overrides .btn span { display:block } types of rules */
        align-items: center;
        flex: 0 0 auto; /* don't stretch */
    }


/* Avatar styling (lighter chip) */
.tz-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #5a7fa5; /* lighter than the button */
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    line-height: 1; /* keeps the letter centered cleanly */
    justify-content: center;
}

/* Optional: a tiny left/right pad inside the button so it breathes */
.tz-account-btn {
    padding-left: 10px;
    padding-right: 12px;
}

.tz-account-label {
    font-weight: 600;
}

.tz-caret {
    opacity: .9;
}

.tz-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    min-width: 180px;
    padding: 6px;
    display: none;
    z-index: 1200;
}

.tz-dropdown.open .tz-menu {
    display: block;
}

.tz-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border-radius: 8px;
    color: #0f172a;
    background: none;
    border: none;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

    .tz-item:hover {
        background: #f2f6fb;
        color: #004f8b;
    }


/* Loading panel — global, high z-index so it beats sticky/sidebar */
.tz-loading[hidden] {
    display: none !important;
}

.tz-loading {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 2000; /* above header + sticky nav */
}

.tz-loading__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.35); /* subtle dim */
    backdrop-filter: saturate(120%) blur(1px);
}

.tz-loading__card {
    position: relative;
    min-width: 220px;
    max-width: 90vw;
    padding: 16px 20px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e6e6e6;
    box-shadow: 0 12px 28px rgba(0,0,0,.15);
    display: grid;
    grid-auto-flow: column;
    align-items: center;
    gap: 12px;
}

/* Spinner */
.tz-loading__spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid #e5e7eb;
    border-top-color: #004f8b;
    animation: tzSpin 0.8s linear infinite;
}

@keyframes tzSpin {
    to {
        transform: rotate(360deg);
    }
}

.tz-loading__text {
    font-size: 14px;
    color: #1f2937;
    user-select: none;
}


/* --- Toasts: top-center, subtle card look --- */
/* Toast container */
.tz-toasts {
    position: fixed;
    top: var(--toast-top, 84px); /* just under your header */
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    gap: 14px;
    z-index: 2100;
    pointer-events: none;
}

/* Toast card */
.tz-toast {
    pointer-events: auto;
    min-width: 300px;
    max-width: 600px;
    padding: 16px 20px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    color: #fff;
    background: #004f8b; /* brand blue background */
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    opacity: 0;
    transform: translate(-50%, -10px);
    animation: tzToastIn .25s ease-out forwards;
}

/* Close button */
.tz-toast__close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    opacity: .8;
}

    .tz-toast__close:hover {
        opacity: 1;
    }

/* Variants */
.tz-toast--success {
    background: #15803d;
}
/* green success */
.tz-toast--error {
    background: #b91c1c;
}
/* red error */
.tz-toast--info {
    background: #0369a1;
}
/* lighter info blue */

/* Exit animation */
.tz-toast--out {
    animation: tzToastOut .2s ease-in forwards;
}

@keyframes tzToastIn {
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

@keyframes tzToastOut {
    to {
        opacity: 0;
        transform: translate(-50%, -8px);
    }
}



/* Burger (mobile) */
.tz-burger {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    position: relative;
    border-radius: 8px;
}

    .tz-burger span {
        position: absolute;
        left: 10px;
        right: 10px;
        height: 2px;
        background: #0f172a;
        border-radius: 2px;
        transition: .2s;
    }

        .tz-burger span:nth-child(1) {
            top: 12px;
        }

        .tz-burger span:nth-child(2) {
            top: 19px;
        }

        .tz-burger span:nth-child(3) {
            top: 26px;
        }

    .tz-burger[aria-expanded="true"] span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .tz-burger[aria-expanded="true"] span:nth-child(2) {
        opacity: 0;
    }

    .tz-burger[aria-expanded="true"] span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }


/* Main content container to align with header */
.tz-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 40px;
}


.tz-grid {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 20px;
    margin-top: 16px;
}

.tz-span-2 {
    grid-column: span 2;
}

.tz-card {
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(0,0,0,.06);
    padding: 18px 18px 20px;
    margin-bottom: 20px;
}

.tz-card__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 10px;
}

    .tz-card__head h2 {
        margin: 0;
        font-size: 1.5rem;
    }

.tz-sub {
    color: #6c757d;
    font-size: .9rem;
}

.tz-card__body {
    display: block;
}

.tz-form .tz-field {
    margin-bottom: 12px;
}

.tz-actions-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.tz-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tz-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

.tz-actions-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2,1fr);
}

.tz-stats {
    display: grid;
    grid-template-columns: repeat(3,1fr);
    gap: 12px;
}

.tz-stat {
    background: #f8f9fb;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
}

.tz-kpi {
    font-weight: 800;
    font-size: 1.8rem;
    color: #004f8b;
}

.tz-kpi-label {
    color: #6c757d;
    font-size: .9rem;
}


/* ------------------------------------
   3. Cards
------------------------------------ */
.card {
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* ------------------------------------
   4. Forms & Buttons
------------------------------------ */
.form-section,
form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

input,
select,
textarea {
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    font: inherit;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    color: #ffffff;
    background-color: #004f8b;
    border: 1px solid #004f8b;
    border-radius: 0.25rem;
    cursor: pointer;
    text-decoration: none;
}

    .btn:hover,
    button:hover {
        background-color: #003f73;
        border-color: #003f73;
    }

textarea {
    resize: none;
}

/* ------------------------------------
   5. Modals & Overlays
------------------------------------ */
.loading-overlay,
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

    .loading-overlay.show,
    .modal.show {
        display: flex;
    }

.modal-content {
    background-color: #ffffff;
    border-radius: 0.5rem;
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.spinner {
    width: 3rem;
    height: 3rem;
    border: 0.5rem solid #e9ecef;
    border-top-color: #004f8b;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* --------------------- */
/* Styles for all Modal  */
/* --------------------- */

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}


/* ------------------------- */
/* Account Management Modal  */
/* ------------------------- */

.modal-title {
    margin-bottom: 0.75rem;
}

.req {
    color: #dc3545; /* red asterisk for required fields */
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1rem;
    align-items: start;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field--full {
    grid-column: 1 / -1;
}

.password-section {
    margin-top: 1rem;
}

.link-btn {
    appearance: none;
    background: transparent;
    border: none;
    color: #004f8b; /* matches your footer/button primary color */
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
}

    .link-btn:hover {
        text-decoration: underline;
    }

.chevron {
    transform: rotate(-90deg);
    transition: transform .2s ease;
}

#userModal .modal-content {
    position: relative;
}

#userModal .close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    float: none; /* override the float */
    font-size: 20px;
    font-weight: bold;
    color: #004f8b;
    background: none;
    border: none;
    cursor: pointer;
}

.link-btn[aria-expanded="true"] .chevron {
    transform: rotate(0deg);
}

.help-text {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Override the Change Password toggle to look like a text link */
#userModal .link-btn {
    background: none !important;
    border: none !important;
    color: #004f8b !important; /* your brand blue */
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    box-shadow: none !important;
}

    #userModal .link-btn:hover {
        text-decoration: underline;
        background: none !important;
    }

#userModal .modal-content {
    max-width: 640px; /* make modal a little wider than default */
}


/* ------------------ */
/* New Project Modal  */
/* ------------------ */


/* Make every modal card the positioning context */
.modal-content {
    position: relative; /* new */
}

/* Close button rules shared by all modals */
.modal .close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    float: none; /* kill any float */
    font-size: 20px;
    font-weight: bold;
    color: #004f8b;
    background: none;
    border: none;
    cursor: pointer;
}

/* Make Create Project modal match Edit Profile */
#projectModal .modal-content {
    position: relative;
    max-width: 640px; /* same width as Edit Profile */
}

#projectModal .close-btn,
#itemModal .close-btn {
    position: absolute;
    top: 12px;
    right: 16px;
    float: none;
    font-size: 20px;
    font-weight: bold;
    color: #004f8b;
    background: none;
    border: none;
    cursor: pointer;
}

#projectModal .modal-title,
#itemModal .modal-title {
    margin-bottom: 0.75rem;
}

#itemsTable tbody tr.pad-row td {
    height: 44px; /* match your real row height */
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

#itemsTable tbody tr.pad-row:hover {
    background: #fff !important;
}


/* Since Bootstrap is disabled, define button variants */
.btn-primary {
    background-color: #004f8b;
    border-color: #004f8b;
    color: #fff;
}

    .btn-primary:hover {
        background-color: #003f73;
        border-color: #003f73;
    }

.btn-outline-secondary {
    background: transparent;
    color: #495057;
    border: 1px solid #ced4da;
}

    .btn-outline-secondary:hover {
        background: #f2f6fb;
        color: #004f8b;
        border-color: #b7c7dc;
    }

/* Optional: make the single field row full-width */
#projectModal .form-grid.form-field--full {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
}


/* Combo: input + caret that look/act like one control */
.tz-combo {
    display: flex;
    align-items: stretch;
    width: 100%;
    gap: 0; /* no seam */
}

    .tz-combo > .form-control {
        flex: 1 1 auto;
        border-right: 0; /* remove inner seam */
        border-top-right-radius: 0;
        border-bottom-right-radius: 0; /* radius = your inputs (0.25rem) */
    }

    .tz-combo > .tz-combo-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 .75rem; /* matches your input height (base padding .5rem) */
        border: 1px solid #ced4da; /* same border as inputs */
        border-left: 0; /* join with input */
        border-top-right-radius: .25rem;
        border-bottom-right-radius: .25rem;
        background: #fff;
        cursor: pointer;
        line-height: 1; /* crisp caret centering */
    }

/* Single down caret built with borders */
.tz-caret {
    width: 0;
    height: 0;
    border-left: .3em solid transparent;
    border-right: .3em solid transparent;
    border-top: .45em solid currentColor;
}

/* Optional: unified focus ring for both pieces */
.tz-combo:focus-within {
    box-shadow: 0 0 0 .2rem rgba(0,79,139,.15);
    border-radius: .25rem; /* matches the outer corners */
}

.tz-combo .form-control:disabled {
    background-color: #f1f3f5;
    cursor: not-allowed;
}

.tz-combo .tz-combo-toggle:disabled {
    background-color: #f1f3f5;
    border-color: #e5e7eb;
    cursor: not-allowed;
}


@media (max-width: 1080px) {
    .tz-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .tz-span-2 {
        grid-column: span 2;
    }
}


@media (max-width: 900px) {
    .tz-burger {
        display: block;
    }

    .tz-nav {
        position: absolute;
        inset: 64px 0 auto 0;
        background: #fff;
        border-top: 1px solid #eef1f4;
        box-shadow: 0 8px 24px rgba(0,0,0,.06);
        display: none;
    }

        .tz-nav.open {
            display: block;
        }

    .tz-links {
        flex-direction: column;
        gap: 0;
        padding: 10px 16px;
    }

        .tz-links a {
            padding: 10px 12px;
            border-radius: 8px;
        }

    .tz-account-wrap {
        padding: 6px 16px 12px;
    }

    .tz-account-btn {
        width: 100%;
        justify-content: space-between;
    }

    .tz-dropdown .tz-menu {
        position: static;
        box-shadow: none;
        border: 0;
        padding: 4px 0;
    }
}


@media (max-width: 720px) {
    .tz-grid {
        grid-template-columns: 1fr;
    }

    .tz-actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .tz-actions-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr; /* stack fields on small screens */
    }
}


