/* ============================================
   STICKY HEADER STYLES
   ============================================ */

.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    min-height: 64px;
    background: #ffffff;
    border-bottom: 1px solid rgba(11, 28, 59, 0.08);
    z-index: 999;
    box-shadow: 0 2px 8px rgba(11, 28, 59, 0.04);
}

.sticky-header-content {
    width: min(1120px, calc(100vw - 32px));
    min-height: 64px;
    margin: 0 auto;
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.sticky-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.sticky-header-logos {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sticky-header-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.sticky-header-logo--secondary {
    height: 32px;
}

.sticky-header-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.sticky-header-kicker {
    margin: 0;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(11, 28, 59, 0.55);
}

.sticky-header-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    margin: 0;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.header-date {
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(11, 28, 59, 0.58);
    margin: 0;
    white-space: nowrap;
    text-align: left;
}

.title-abbr {
    display: none;
}

/* Compact user name on small screens */
@media (max-width: 768px) {
    .header-user-name {
        display: inline;
        max-width: 110px;
        font-size: 0.85rem;
    }
    
    .header-user-btn {
        width: auto;
        max-width: 180px;
        padding: 0 10px;
        justify-content: flex-start;
    }
}

.sticky-header-actions {
    position: relative;
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}

.header-doc-btn {
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(47, 111, 228, 0.2);
    background: rgba(47, 111, 228, 0.06);
    color: rgba(11, 28, 59, 0.76);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
    white-space: nowrap;
}

.header-doc-btn[hidden] {
    display: none !important;
}

.header-doc-icon {
    width: 18px;
    height: 18px;
    fill: rgba(11, 28, 59, 0.62);
    flex-shrink: 0;
    transition: fill 180ms ease;
}

.header-doc-btn:hover {
    background: rgba(47, 111, 228, 0.12);
    border-color: rgba(47, 111, 228, 0.3);
}

.header-doc-btn:hover .header-doc-icon {
    fill: var(--sea);
}

.header-doc-btn:active {
    background: rgba(47, 111, 228, 0.14);
}

.header-doc-btn.is-active {
    background: rgba(47, 111, 228, 0.1);
    border-color: rgba(47, 111, 228, 0.24);
    color: rgba(11, 28, 59, 0.76);
}

.header-doc-btn.is-active .header-doc-icon {
    fill: rgba(11, 28, 59, 0.62);
}

.header-icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(15, 26, 31, 0.25);
    background: white;
    color: rgba(15, 26, 31, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 250ms ease;
    padding: 0;
}

.header-user-btn {
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(11, 28, 59, 0.12);
    background: #ffffff;
    color: rgba(11, 28, 59, 0.78);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
    padding: 0 14px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(11, 28, 59, 0.04);
}

.header-user-btn .user-icon {
    width: 18px;
    height: 18px;
    fill: rgba(11, 28, 59, 0.58);
    transition: fill 180ms ease;
    flex-shrink: 0;
}

.header-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(11, 28, 59, 0.84);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-user-btn:hover {
    background: rgba(47, 111, 228, 0.08);
    border-color: rgba(47, 111, 228, 0.22);
    box-shadow: 0 4px 10px rgba(47, 111, 228, 0.08);
}

.header-user-btn:hover .user-icon {
    fill: var(--sea);
}

.header-user-btn:active {
    background: rgba(47, 111, 228, 0.14);
    box-shadow: 0 2px 8px rgba(11, 28, 59, 0.04);
}

.header-icon-btn svg {
    width: 20px;
    height: 20px;
    fill: rgba(15, 26, 31, 0.65);
    transition: fill 250ms ease;
}

.header-icon-btn:hover {
    background: var(--hover-sea-subtle, rgba(47, 111, 179, 0.1));
    border-color: var(--sea);
}

.header-icon-btn:hover svg {
    fill: var(--sea);
}

.header-icon-btn:active {
    background: rgba(47, 111, 179, 0.12);
}

/* ============================================
   HEADER POPUP PANEL STYLES
   ============================================ */

.header-popup-panel {
    position: absolute;
    top: 50px;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 10px 24px rgba(11, 28, 59, 0.12);
    border: 1px solid rgba(11, 28, 59, 0.08);
    z-index: 100;
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.header-popup-panel.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.header-popup-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.header-popup-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 500;
}

.header-popup-user-info svg {
    width: 20px;
    height: 20px;
    fill: rgba(15, 26, 31, 0.5);
    flex-shrink: 0;
}

.header-user-email {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(15, 26, 31, 0.7);
}

.header-popup-divider {
    height: 1px;
    background: rgba(11, 28, 59, 0.08);
    margin: 4px 8px;
}

.header-popup-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 180ms ease, color 180ms ease;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink);
    text-align: left;
    width: 100%;
}

.header-popup-option[hidden] {
    display: none !important;
}

.header-popup-option svg {
    width: 20px;
    height: 20px;
    fill: rgba(15, 26, 31, 0.5);
    flex-shrink: 0;
    transition: fill 200ms ease;
}

.header-popup-option:hover {
    background: rgba(47, 111, 179, 0.08);
}

.header-popup-option:hover svg {
    fill: var(--sea);
}

.header-popup-option:active {
    background: rgba(15, 26, 31, 0.12);
}

/* ============================================
   HEADER DRAFT TA MODAL STYLES
   ============================================ */

body.header-modal-open {
    overflow: hidden;
}

#header-draft-ta-modal {
    z-index: 1250;
    padding: 24px;
}

.header-draft-ta-modal-content {
    max-width: 780px;
    max-height: calc(100vh - 48px);
}

.header-draft-ta-fields {
    gap: 16px;
}

.header-draft-ta-fields .field-row {
    align-items: start;
}

.header-draft-ta-separator {
    width: 100%;
    height: 1px;
    background: rgba(15, 26, 31, 0.16);
    margin: -2px 0 2px;
}


.header-draft-ta-fields .multiselect-dropdown {
    z-index: 25;
}

.header-draft-ta-date-input {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(15, 26, 31, 0.12);
    background: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-family: inherit;
    color: var(--ink);
    outline: none;
    box-sizing: border-box;
}

.header-draft-ta-date-input {
    min-height: 47px;
    padding: 12px 14px 12px 40px;
}

.header-draft-ta-select {
    width: 100%;
    min-height: 47px;
    border-radius: 12px;
    border: 1px solid rgba(15, 26, 31, 0.12);
    background: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-family: inherit;
    color: var(--ink);
    outline: none;
    box-sizing: border-box;
    padding: 12px 14px;
}

.header-draft-ta-select:focus {
    border-color: rgba(95, 183, 177, 0.8);
    box-shadow: 0 0 0 3px rgba(95, 183, 177, 0.18);
}

.header-draft-ta-date-input::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.72;
}

.header-draft-ta-date-input:focus {
    border-color: rgba(95, 183, 177, 0.8);
    box-shadow: 0 0 0 3px rgba(95, 183, 177, 0.18);
}

.header-draft-ta-actions {
    margin-top: 6px;
}

.header-draft-location-actions {
    display: grid;
    gap: 4px;
    margin-top: 8px;
}

.header-draft-location-link {
    justify-self: start;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--sea);
    font-size: 0.94rem;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    box-shadow: none;
}

.header-draft-location-link:hover,
.header-draft-location-link:focus,
.header-draft-location-link:active {
    background: transparent;
    color: var(--sea);
    box-shadow: none;
    text-decoration: none;
    outline: none;
}

.header-draft-location-link:focus-visible {
    outline: none;
    text-decoration: underline;
}

.header-draft-location-hint {
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.45;
    color: rgba(11, 28, 59, 0.66);
}

#header-draft-location-modal {
    z-index: 1300;
    padding: 24px;
}

.header-draft-location-modal-content {
    width: min(920px, calc(100vw - 48px));
    max-width: 920px;
    max-height: calc(100vh - 48px);
    display: grid;
    gap: 16px;
}

.header-draft-location-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.header-draft-location-heading h3 {
    margin: 0 0 6px;
}

.header-draft-location-heading p {
    margin: 0;
    color: rgba(11, 28, 59, 0.72);
    line-height: 1.55;
}

.header-draft-location-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.header-draft-location-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: rgba(11, 28, 59, 0.7);
    line-height: 1.45;
}

.header-draft-location-status::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: rgba(47, 111, 179, 0.4);
    flex-shrink: 0;
}

.header-draft-location-status[data-state="error"]::before {
    background: rgba(183, 61, 61, 0.85);
}

.header-draft-location-status[data-state="success"]::before {
    background: rgba(49, 135, 84, 0.85);
}

.header-draft-location-search {
    position: relative;
    display: grid;
    gap: 10px;
    z-index: 20;
}

.header-draft-location-search-input-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.header-draft-location-search-input {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid rgba(15, 26, 31, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--ink);
    font: inherit;
    outline: none;
    box-sizing: border-box;
}

.header-draft-location-search-input:focus {
    border-color: rgba(95, 183, 177, 0.8);
    box-shadow: 0 0 0 3px rgba(95, 183, 177, 0.18);
}

.header-draft-location-search-button {
    min-height: 46px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid rgba(15, 26, 31, 0.12);
    background: #ffffff;
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.header-draft-location-search-button:hover {
    background: rgba(47, 111, 179, 0.08);
    border-color: rgba(47, 111, 179, 0.24);
    color: var(--sea);
}

.header-draft-location-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: grid;
    gap: 6px;
    max-height: min(392px, 42vh);
    overflow-y: auto;
    padding: 6px;
    border-radius: 18px;
    border: 1px solid rgba(15, 26, 31, 0.1);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 40px rgba(11, 28, 59, 0.16);
    backdrop-filter: blur(10px);
    z-index: 30;
}

.header-draft-location-search-results[hidden] {
    display: none !important;
}

.header-draft-location-map {
    position: relative;
    z-index: 1;
}

.header-draft-location-search-result,
.header-draft-location-search-empty {
    padding: 9px 12px;
    border-radius: 12px;
    border: 1px solid rgba(15, 26, 31, 0.08);
    background: rgba(248, 250, 253, 0.95);
}

.header-draft-location-search-result {
    text-align: left;
    cursor: pointer;
    min-height: 54px;
    transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.header-draft-location-search-result:hover {
    background: rgba(47, 111, 179, 0.08);
    border-color: rgba(47, 111, 179, 0.24);
    transform: translateY(-1px);
}

.header-draft-location-search-result-title {
    display: block;
    margin-bottom: 2px;
    color: var(--ink);
    font-weight: 600;
    line-height: 1.25;
}

.header-draft-location-search-result-subtitle,
.header-draft-location-search-empty {
    display: block;
    color: rgba(11, 28, 59, 0.68);
    font-size: 0.9rem;
    line-height: 1.3;
}

.header-draft-location-map {
    width: 100%;
    min-height: 360px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(15, 26, 31, 0.12);
    background:
        radial-gradient(circle at top left, rgba(47, 111, 179, 0.14), transparent 38%),
        linear-gradient(180deg, rgba(245, 248, 252, 0.95), rgba(235, 241, 247, 0.95));
}

.header-draft-location-preview-card {
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(15, 26, 31, 0.08);
    background: rgba(248, 250, 253, 0.95);
}

.header-draft-location-preview-label {
    display: inline-block;
    margin-bottom: 3px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(47, 111, 179, 0.82);
}

.header-draft-location-preview {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.35;
    color: var(--ink);
    word-break: break-word;
}

/* ============================================
   LOGIN PAGE HEADER STYLES
   ============================================ */

.login-hero-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(560px, 100%);
    padding: 4px 0 0;
    text-align: center;
    justify-items: center;
}

.login-header-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.logo-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-row img {
    height: 54px;
    width: auto;
    object-fit: contain;
}

.login-header-kicker {
    margin: 0;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(47, 111, 179, 0.08);
    color: var(--sea);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-header-copy {
    display: grid;
    gap: 0;
    justify-items: center;
}

.login-header-copy h1 {
    margin: 0;
    font-size: clamp(2.1rem, 1.8vw, 1.35rem);
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.tagline {
    font-family: inherit;
    font-size: 0.88rem;
    max-width: 42ch;
    line-height: 1.55;
    color: rgba(11, 28, 59, 0.7);
    margin: 0;
}

/* ============================================
   RESPONSIVE STYLES
   ============================================ */

@media (max-width: 420px) {
    #header-draft-ta-modal {
        padding: 16px;
    }

    #header-draft-location-modal {
        padding: 16px;
    }

    .header-draft-location-modal-content {
        width: calc(100vw - 32px);
    }

    .header-draft-location-map {
        min-height: 300px;
    }

    .header-draft-ta-modal-content {
        max-width: 100%;
    }


@media (max-width: 640px) {
    .header-draft-location-actions,
    .header-draft-location-toolbar,
    .header-draft-location-heading {
        align-items: stretch;
    }

    .header-draft-location-search-input-wrap {
        grid-template-columns: 1fr;
    }

    .header-draft-location-search-button {
        width: 100%;
    }

    .header-draft-location-status {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .header-draft-location-modal-content {
        gap: 14px;
    }

    .header-draft-location-map {
        min-height: 320px;
    }
}
    .header-draft-ta-modal-content {
        max-width: 100%;
    }

    .sticky-header {
        min-height: 60px;
    }

    .sticky-header-content {
        width: min(1120px, calc(100vw - 24px));
        min-height: 60px;
        padding: 8px 0;
    }

    .sticky-header-left {
        gap: 10px;
    }

    .sticky-header-logo {
        height: 32px;
    }

    .sticky-header-logo--secondary {
        height: 28px;
    }

    .sticky-header-kicker,
    .header-date {
        display: none;
    }

    .sticky-header-title {
        font-size: 0.94rem;
    }

    .header-user-name {
        max-width: 96px;
    }

    .header-doc-btn {
        min-width: 40px;
        padding: 0 12px;
    }

    .header-doc-label {
        display: none;
    }

    .login-hero-header {
        gap: 8px;
    }

    .login-header-copy h1 {
        font-size: clamp(1.05rem, 4.5vw, 1.3rem);
    }

    .logo-row img {
        height: 44px;
    }
}

@media (max-width: 650px) {
    .title-full {
        display: none;
    }

    .title-abbr {
        display: inline;
    }

    .sticky-header-content {
        gap: 12px;
    }

    .sticky-header-logos {
        gap: 8px;
    }

    .sticky-header-logo--secondary {
        display: none;
    }

    .header-user-btn {
        padding: 0 12px;
    }
}

@media (max-width: 480px) {
    .tagline {
        font-size: 0.95rem;
    }

    .login-header-bar {
        align-items: flex-start;
    }

    .logo-row img {
        height: 38px;
    }

    .header-user-name {
        display: none;
    }

    .header-user-btn {
        width: 40px;
        justify-content: center;
        padding: 0;
    }
}
