.dropdown {
    position: relative;
    flex-shrink: 0;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(58, 46, 34, .12);
    min-width: 180px;
    z-index: 999;
    list-style: none;
    padding: .5rem 0;
}

.dropdown-menu li a {
    display: block;
    padding: .6rem 1.2rem;
    color: var(--bark);
    text-decoration: none;
    font-size: .88rem;
    transition: background .2s;
}

.dropdown-menu li a:hover {
    background: var(--sand);
    color: var(--teal);
}

.dropdown:hover .dropdown-menu {
    display: block;
}

.btn-hero-primary,
.btn-hero-ghost {
    --clr: var(--amber);
    transition: 0.5s;
}

.btn-hero-primary:hover {
    background: var(--white) !important;
    color: var(--clr) !important;
    box-shadow: 0 0 25px var(--clr);
    border: 1px solid var(--clr);
}

.btn-hero-ghost:hover {
    background: var(--white) !important;
    color: var(--clr) !important;
    box-shadow: 0 0 25px var(--clr);
    border: 1px solid var(--clr);
}

.nav-links a:hover {
    box-shadow: 0 0 15px var(--amber);
    color: var(--amber) !important;
}

@font-face {
    font-family: 'Pogonia';
    src: url('/static/fonts/Pogonia.ttf') format('truetype');
}

:root {
    --sand: #f5efe6;
    --linen: #ede5d8;
    --amber: #EF8233;
    --amber-d: #a86830;
    --teal: #175968;
    --teal-d: #3BB9B6;
    --bark: #424142;
    --mist: #8fa8a3;
    --white: #fdfaf6;
    --ink: #1e1610;
    --danger: #c0392b;
    --success: #27ae60;
    --warning: #e67e22;
    --info: #2980b9;
    --radius: 12px;
    --radius-lg: 20px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Pogonia', sans-serif;
    background: var(--sand);
    color: var(--bark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
input, select, textarea, button {
    font-family: inherit;
}

/* ── NAV ── */
nav {
    background: var(--white);
    border-bottom: 1px solid var(--linen);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.nav-inner {
    max-width: none;
    margin: 0 auto;
    padding: 0 2rem;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--teal);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.nav-logo span {
    color: var(--amber);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: .15rem;
    list-style: none;
    width: 100%;
    margin-left: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--bark);
    font-size: .85rem;
    font-weight: 500;
    padding: .5rem .65rem;
    border-radius: var(--radius);
    transition: background .18s, color .18s;
    letter-spacing: .01em;
    white-space: nowrap;
}

.nav-links a:hover {
    background: var(--linen);
    color: var(--teal);
}

.nav-links a.active {
    color: var(--teal);
    background: #e8f3f1;
}

.btn-nav {
    background: var(--amber) !important;
    color: var(--white) !important;
    border-radius: 999px !important;
    padding: .45rem 1.1rem !important;
    transition: 0.5s;
    text-decoration: none !important;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-nav:hover {
    background: var(--white) !important;
    color: var(--amber) !important;
    box-shadow: 0 0 25px var(--amber);
    border: 1px solid var(--amber);
}

.user-name-btn {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .88rem;
    color: var(--mist);
}

/* ── FLASH MESSAGES ── */
.flash-wrap {
    position: fixed;
    top: 68px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    z-index: 99;
    padding: 0;
}

.flash {
    position: relative;
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem 2.1rem .65rem .65rem;
    border-radius: 12px;
    border-bottom: 2.5px solid var(--amber);
    margin-bottom: .5rem;
    font-size: .88rem;
    font-weight: 600;
    animation: flashIn .45s cubic-bezier(.34, 1.56, .64, 1);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
    white-space: nowrap;
    overflow: hidden;
    border-top: none;
    border-left: none;
    border-right: none;
}

.flash.flash-hide {
    animation: flashOut .25s ease forwards;
}

.flash-icon {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 50%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.flash-icon i {
    font-size: .72rem;
}

.flash-accent {
    font-family: 'Pogonia', serif;
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: .2px;
}

.flash-close {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 2.1rem;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, .75);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.flash-close:hover {
    color: var(--white);
}

.flash.success {
    background: var(--teal);
    color: var(--white);
}

.flash.success .flash-icon i {
    color: var(--teal);
}

.flash.danger {
    background: #8a3232;
    color: var(--white);
}

.flash.danger .flash-icon i {
    color: #8a3232;
}

.flash.warning {
    background: var(--amber-d);
    color: var(--white);
}

.flash.warning .flash-icon i {
    color: var(--amber-d);
}

.flash.info {
    background: var(--bark);
    color: var(--sand);
}

.flash.info .flash-icon i {
    color: var(--bark);
}

@keyframes flashIn {
    from {
        opacity: 0;
        transform: translateY(-14px) scale(.94);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes flashOut {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(.92);
    }
}

/* ── MAIN CONTENT ── */
main {
    flex: 1;
}

/* ── FOOTER ── */
footer {
    background: var(--bark);
    color: var(--linen);
    padding: 3.5rem 2rem 2rem;
    margin-top: 0;
}

.footer-inner {
    max-width: none;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.8fr 1fr 1fr;
    gap: 3rem;
}

.footer-brand {
    font-family: 'Pogonia', serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--sand);
    margin-bottom: .75rem;
}

.footer-brand span {
    color: var(--amber);
}

footer p {
    font-size: .88rem;
    color: var(--mist);
    line-height: 1.7;
}

.footer-col h4 {
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--amber);
    margin-bottom: 1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: .5rem;
}

.footer-col ul li a {
    color: var(--mist);
    text-decoration: none;
    font-size: .88rem;
    transition: color .15s;
}

.footer-col ul li a:hover {
    color: var(--sand);
}

.footer-bottom {
    max-width: none;
    margin: 2.5rem auto 0;
    padding-top: 1.5rem;
    border-top: 1px solid #4a3d2f;
    font-size: .8rem;
    color: #6a5c4a;
    display: flex;
    justify-content: space-between;
}

/* ── GLOBAL UTILITIES ── */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .65rem 1.4rem;
    border-radius: 999px;
    font-family: 'Pogonia', sans-serif;
    font-size: .88rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .2s;
    letter-spacing: .01em;
}

.btn-primary {
    background: var(--amber);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--teal-d);
}

.btn-amber {
    background: var(--amber);
    color: var(--white);
}

.btn-amber:hover {
    background: var(--amber-d);
}

.btn-outline {
    background: transparent;
    color: var(--teal);
    border-color: var(--teal);
}

.btn-outline:hover {
    background: var(--teal);
    color: var(--white);
}

.btn-ghost {
    background: transparent;
    color: var(--bark);
    border-color: var(--linen);
}

.btn-ghost:hover {
    background: var(--linen);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #a93226;
}

.btn-sm {
    padding: .4rem 1rem;
    font-size: .82rem;
}

.btn-sm-edit {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .3rem .65rem;
    font-size: .78rem;
    border-radius: 6px;
    background: rgba(41, 128, 185, .1);
    color: #2980b9;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background .2s;
}

.btn-sm-edit:hover {
    background: rgba(41, 128, 185, .2);
}

.badge {
    display: inline-block;
    padding: .2rem .65rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .03em;
}

.badge-pending {
    background: #fff3cd;
    color: #856404;
}

.badge-confirmed {
    background: #d4edda;
    color: #155724;
}

.badge-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.badge-new {
    background: rgba(41, 128, 185, .12);
    color: #2980b9;
}

.badge-contacted {
    background: rgba(200, 135, 74, .12);
    color: var(--amber);
}

.badge-closed {
    background: rgba(58, 46, 34, .1);
    color: var(--mist);
}

.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 16px rgba(58, 46, 34, .07);
    overflow: hidden;
}

.section-title {
    font-family: 'Pogonia', serif;
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--bark);
    line-height: 1.2;
}

.section-sub {
    color: var(--mist);
    font-size: .95rem;
    margin-top: .4rem;
}

/* ── FORM ── */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: .83rem;
    font-weight: 500;
    color: var(--bark);
    margin-bottom: .4rem;
    letter-spacing: .02em;
}

.form-control {
    width: 100%;
    padding: .7rem 1rem;
    border: 1.5px solid var(--linen);
    border-radius: var(--radius);
    font-family: 'Pogonia', sans-serif;
    font-size: .92rem;
    color: var(--ink);
    background: var(--white);
    transition: border-color .18s, box-shadow .18s;
    outline: none;
}

.form-control:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(45, 122, 111, .12);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Native date/time pickers are OS-rendered widgets, not something CSS
   can fully restyle - iOS Safari in particular uses the input's font
   metrics to size its internal segmented control, so a decorative
   display font (Pogonia) inflates it to an oddly tall, oversized box.
   Reset these specific input types back to the system font stack,
   which the native control is actually designed around. */
input[type="date"].form-control,
input[type="time"].form-control,
input[type="datetime-local"].form-control {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: normal;
    padding: .5rem 1rem;
    height: auto;
}

/* ── Date input display overlay ──
   iOS Safari's native <input type="date"> doesn't reliably honor CSS
   sizing - width, box-sizing, -webkit-appearance - the way every other
   input type does, so trying to make the real input BE the visible box
   kept breaking in new ways. Instead: the real input is fully invisible
   and only used to capture the tap and hold the value; a plain sibling
   div (which every browser sizes identically, with no native quirks) is
   what actually renders the visible box, border, and text - it carries
   both "doverlay" and "form-control" classes. See static/js/main.js:
   initDateDisplay(). */
.dstack {
    position: relative;
}

.dstack-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
}

.doverlay {
    display: flex;
    align-items: center;
    pointer-events: none;
    color: var(--mist);
}

.doverlay.has-value {
    color: var(--ink);
}

/* ── Custom dropdown ──
   A styled replacement for <select> where the OPEN list needs to be
   themeable (native select option lists are OS-rendered and can't be
   styled). See static/js/main.js: initCustomSelect(). */
.cselect {
    position: relative;
}

.cselect-trigger {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    padding: .7rem 1rem;
    border: 1.5px solid var(--linen);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--bark);
    font-family: 'Pogonia', sans-serif;
    font-size: .92rem;
    cursor: pointer;
    transition: border-color .18s;
}

.cselect.open .cselect-trigger {
    border-color: var(--teal);
}

.cselect-chevron {
    font-size: .78rem;
    color: var(--teal);
    transition: transform .18s ease;
    flex-shrink: 0;
}

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

.cselect-list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1.5px solid var(--teal);
    border-radius: var(--radius);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-height .2s ease, opacity .15s ease;
    z-index: 30;
}

.cselect.open .cselect-list {
    max-height: 280px;
    opacity: 1;
    overflow-y: auto;
    pointer-events: auto;
}

.cselect-option {
    padding: .6rem 1rem;
    font-size: .88rem;
    color: var(--bark);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--linen);
}

.cselect-option:first-child {
    border-top: none;
}

.cselect-option:hover {
    background: var(--linen);
}

.cselect-option.selected {
    background: rgba(23, 89, 104, .08);
    color: var(--teal);
    font-weight: 600;
}

.cselect-option i {
    font-size: .78rem;
    color: var(--teal);
}

.cselect.cselect-disabled .cselect-trigger {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238fa8a3' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.mobile-menu {
    display: none;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--teal);
    cursor: pointer;
}

@media (max-width: 1024px) {
    .nav-inner {
        padding: 0 1rem;
    }

    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu {
        display: none;
        position: absolute;
        top: 68px;
        left: 0;
        right: 0;
        background: var(--white);
        border-bottom: 1px solid var(--linen);
        box-shadow: 0 16px 32px rgba(0,0,0,.10);
        z-index: 99;
        max-height: calc(100vh - 68px);
        overflow-y: auto;
    }

    .mobile-menu.mm-open {
        display: block;
    }

    .mm-account {
        position: relative;
        display: flex;
        align-items: center;
        gap: .75rem;
        padding: .9rem 1.1rem;
        background: var(--linen);
    }

    .mm-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: var(--teal);
        color: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 1rem;
        flex-shrink: 0;
    }

    .mm-account-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        text-decoration: none;
    }

    .mm-name {
        font-weight: 700;
        font-size: .95rem;
        color: #1a1a1a;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mm-sub {
        font-size: .72rem;
        color: var(--mist);
    }

    .mm-bell {
        position: relative;
        color: var(--teal);
        font-size: 1.15rem;
        padding: .4rem;
        text-decoration: none;
        flex-shrink: 0;
    }
    .mm-account .dropdown {
        position: static;
    }
    .mobile-menu .mm-notif-menu {
        left: 0;
        right: 0;
        min-width: 0;
        max-width: none;
        width: auto;
        margin: 0 .5rem;
    }

    .mm-badge {
        position: absolute;
        top: 0;
        right: -2px;
        background: #D85A30;
        color: #fff;
        font-size: .6rem;
        font-weight: 700;
        border-radius: 999px;
        padding: 1px 5px;
    }

    .mm-guest {
        gap: .75rem;
    }

    .mm-login,
    .mm-signup {
        flex: 1;
        text-align: center;
        padding: .7rem;
        border-radius: 10px;
        font-weight: 600;
        font-size: .9rem;
        text-decoration: none;
    }

    .mm-login {
        border: 1.5px solid var(--teal);
        color: var(--teal);
    }

    .mm-signup {
        background: var(--amber);
        color: #fff;
    }

    .mm-links {
        padding: .4rem .5rem;
    }

    .mm-links a {
        display: flex;
        align-items: center;
        gap: .8rem;
        padding: .8rem .85rem;
        border-radius: 10px;
        font-size: .95rem;
        color: #333;
        text-decoration: none;
    }

    .mm-links a i {
        width: 20px;
        text-align: center;
        color: var(--mist);
        font-size: .9rem;
    }

    .mm-links a.mm-active {
        background: #eaf4f2;
        color: var(--teal);
        font-weight: 600;
    }

    .mm-links a.mm-active i {
        color: var(--teal);
    }

    .mm-footer {
        padding: .4rem 1.1rem 1.1rem;
    }

    .mm-cta {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: .5rem;
        background: var(--amber);
        color: #fff;
        border-radius: 12px;
        padding: .85rem;
        font-weight: 700;
        font-size: .95rem;
        text-decoration: none;
        box-shadow: 0 4px 12px rgba(239,130,51,.3);
    }

    .mm-actions {
        display: flex;
        justify-content: space-between;
        gap: .5rem;
        margin-top: .9rem;
        padding-top: .9rem;
        border-top: 1px solid var(--linen);
        flex-wrap: wrap;
    }

    .mm-actions a {
        font-size: .82rem;
        font-weight: 600;
        color: var(--teal);
        text-decoration: none;
    }

    .mm-actions a.mm-logout {
        color: #b3543a;
    }
}

@media (max-width: 768px) {
    .flash-wrap {
        left: 1rem;
        right: 1rem;
        transform: none;
        width: auto;
    }
    .flash {
        white-space: normal;
        width: 100%;
        border-radius: 12px;
        justify-content: center;
    }
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .footer-bottom {
        flex-direction: column;
        gap: .75rem;
        text-align: center;
        align-items: center;
    }
}

/* ── Custom file input button ── */
.file-upload-wrapper {
  position: relative;
  display: inline-block;
}

.file-upload-wrapper input[type="file"] {
  display: none;
}

.file-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1.25rem;
  border: 1.5px solid var(--bark);
  border-radius: 2rem;
  background: white;
  color: var(--bark);
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.file-upload-btn:hover {
  background: var(--bark);
  color: white;
}

.file-upload-label {
  display: block;
  font-size: .82rem;
  color: var(--mist);
  margin-top: .4rem;
}

/* ── FOOTER SOCIALS ── */
.footer-socials {
  display: flex;
  gap: .75rem;
  align-items: center;
}

.footer-socials a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--linen);
  font-size: .9rem;
  text-decoration: none;
  transition: background .2s, color .2s;
}

.footer-socials a:hover {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--white);
}
.notif-dropdown {
  position: relative;
}

.notif-bell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 .5rem;
  font-size: 1.05rem;
  color: var(--bark);
  text-decoration: none;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -2px;
  background: var(--amber);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

.notif-menu {
  right: 0;
  left: auto;
  min-width: 300px;
  max-width: 340px;
  max-height: 380px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
}

.notif-header {
  padding: .8rem .9rem .5rem;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--mist);
  border-bottom: 1px solid var(--linen);
}

.notif-menu .notif-item a {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  padding: .75rem .9rem;
  text-decoration: none;
  color: var(--bark);
  border-bottom: 1px solid var(--linen);
  white-space: normal;
}

.notif-item:last-child a {
  border-bottom: none;
}

.notif-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--linen);
  color: var(--mist);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
}

.notif-item.unread .notif-icon {
  background: rgba(239, 130, 51, .15);
  color: var(--amber);
}

.notif-body {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  min-width: 0;
}

.notif-item.unread {
  background: rgba(23, 89, 104, .06);
}

.notif-item.unread .notif-message {
  font-weight: 600;
}

.notif-message {
  font-size: .85rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.notif-time {
  font-size: .72rem;
  color: var(--mist);
}

.notif-empty {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--mist);
  font-size: .85rem;
}