:root {
    --bg: #f7f3ec;
    --panel: #ffffff;
    --ink: #243029;
    --muted: #7b837c;
    --line: #e8dfd1;
    --green: #0a6e4d;
    --green-soft: #e8f4ef;
    --blue-soft: #edf4ff;
    --orange-soft: #fff0dc;
    --red-soft: #ffecec;
    --shadow: 0 18px 40px rgba(35, 48, 41, 0.08);
    --radius: 22px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    background: radial-gradient(circle at top left, #fff8eb 0, var(--bg) 38%, #f4efe7 100%);
    color: var(--ink);
}

a { color: inherit; text-decoration: none; }

.app-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    background: #fbf8f1;
    border-right: 1px solid var(--line);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 26px;
}

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

.brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: var(--green);
    color: white;
    font-size: 24px;
    box-shadow: var(--shadow);
}

.brand h1 {
    margin: 0;
    font-size: 21px;
}

.brand p, .topbar p, .sidebar-card small {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.nav {
    display: grid;
    gap: 8px;
}

.nav a {
    padding: 13px 14px;
    border-radius: 14px;
    color: #435047;
    transition: 0.2s ease;
}

.nav a:hover, .nav a.active {
    background: var(--green);
    color: #fff;
}

.sidebar-card {
    margin-top: auto;
    background: white;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 7px;
}

.sidebar-card span {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.main {
    padding: 24px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 22px;
}

.topbar h2 {
    margin: 0;
    font-size: 30px;
}

.trip-switcher select, input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    background: white;
    border-radius: 13px;
    padding: 12px 13px;
    font-family: inherit;
    color: var(--ink);
    outline: none;
}

.trip-switcher {
    min-width: 320px;
}

.hero {
    background: linear-gradient(135deg, #0a6e4d, #0f9a70);
    color: white;
    border-radius: 30px;
    padding: 30px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.hero:after {
    content: "";
    position: absolute;
    width: 300px;
    height: 300px;
    border-radius: 999px;
    background: rgba(255,255,255,0.11);
    right: -90px;
    top: -120px;
}

.hero h1 { margin: 0; font-size: 38px; }
.hero p { max-width: 800px; line-height: 1.6; opacity: .92; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.grid {
    display: grid;
    gap: 18px;
}

.grid.cards-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 20px 0;
}

.grid.two {
    grid-template-columns: 1.2fr .8fr;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat {
    min-height: 130px;
}

.stat span {
    color: var(--muted);
    font-size: 13px;
}

.stat strong {
    display: block;
    font-size: 34px;
    margin-top: 12px;
}

.card h3, .card h4 {
    margin-top: 0;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    border: 0;
    border-radius: 13px;
    background: var(--green);
    color: white;
    padding: 11px 15px;
    font-family: inherit;
    cursor: pointer;
    font-size: 14px;
}

.btn.secondary {
    background: var(--green-soft);
    color: var(--green);
}

.btn.danger {
    background: #b42318;
}

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

.btn.small {
    padding: 8px 10px;
    font-size: 12px;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th, .table td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .07em;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.form-grid .full {
    grid-column: 1 / -1;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 700;
    font-size: 14px;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.day-card {
    border-left: 6px solid var(--green);
}

.day-head {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 16px;
}

.day-badge {
    display: inline-flex;
    background: var(--green-soft);
    color: var(--green);
    padding: 8px 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
}

.timeline {
    display: grid;
    gap: 12px;
    margin-top: 15px;
}

.timeline-item {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 15px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fffdf8;
}

.time {
    font-weight: 700;
    color: var(--green);
}

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

.tag {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--blue-soft);
    font-size: 12px;
    font-weight: 700;
}

.tag-green { background: var(--green-soft); color: var(--green); }
.tag-yellow { background: var(--orange-soft); color: #9a5b00; }
.tag-red { background: var(--red-soft); color: #b42318; }

.alert {
    padding: 13px 15px;
    border-radius: 14px;
    margin-bottom: 18px;
    background: var(--green-soft);
    color: var(--green);
    border: 1px solid #cbe9dd;
}

.alert.error {
    background: var(--red-soft);
    color: #b42318;
    border-color: #ffd0d0;
}

.empty {
    text-align: center;
    padding: 34px;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    background: #fffdf8;
}

.note-card {
    display: grid;
    gap: 10px;
    background: #fffdf8;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--line);
}

.check-row:last-child { border-bottom: 0; }

.check-row.done .task-text {
    text-decoration: line-through;
    color: var(--muted);
}

.footer-gap { height: 40px; }

@media (max-width: 980px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: relative;
        height: auto;
    }
    .nav {
        grid-template-columns: repeat(3, 1fr);
    }
    .topbar, .grid.two {
        grid-template-columns: 1fr;
        display: grid;
    }
    .grid.cards-4, .form-grid {
        grid-template-columns: 1fr;
    }
    .trip-switcher {
        min-width: 0;
    }
    .timeline-item {
        grid-template-columns: 1fr;
    }
}


/* Travel calendar module */
.calendar-hero {
    background:
        radial-gradient(circle at 90% 10%, rgba(255,255,255,.24), transparent 28%),
        linear-gradient(135deg, #0a6e4d 0%, #0f9a70 60%, #6fbf8f 100%);
    color: white;
    border-radius: 30px;
    padding: 30px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 22px;
    margin-bottom: 20px;
}

.calendar-hero h1 {
    margin: 10px 0 8px;
    font-size: 38px;
}

.calendar-hero p {
    max-width: 780px;
    margin: 0;
    opacity: .92;
    line-height: 1.6;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-top: 18px;
}

.calendar-day {
    min-height: 230px;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 14px;
    background: linear-gradient(180deg, #fffdf8, #f7fbf8);
    cursor: pointer;
    transition: .2s ease;
}

.calendar-day:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: #b9dfd0;
}

.calendar-date {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 10px;
}

.calendar-date span {
    color: var(--green);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: .08em;
}

.calendar-date strong {
    font-size: 34px;
    color: var(--green);
    grid-row: span 2;
}

.calendar-date small {
    color: var(--muted);
}

.calendar-event-list {
    display: grid;
    gap: 9px;
}

.calendar-empty {
    border: 1px dashed #b9dfd0;
    color: var(--muted);
    padding: 13px;
    border-radius: 16px;
    text-align: center;
    background: rgba(255,255,255,.5);
}

.calendar-event {
    border: 0;
    text-align: left;
    font-family: inherit;
    width: 100%;
    display: grid;
    gap: 4px;
    padding: 11px;
    border-radius: 16px;
    background: var(--green-soft);
    color: var(--ink);
    cursor: pointer;
    border-left: 5px solid var(--green);
}

.calendar-event:hover {
    background: #dff2ea;
}

.calendar-event span {
    color: var(--green);
    font-weight: 700;
    font-size: 12px;
}

.calendar-event strong {
    font-size: 15px;
}

.calendar-event small {
    color: var(--muted);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(36, 48, 41, .55);
    z-index: 99;
    place-items: center;
    padding: 22px;
}

.modal-card {
    width: min(760px, 100%);
    max-height: 92vh;
    overflow: auto;
    background: white;
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 24px 80px rgba(35,48,41,.26);
    border: 1px solid var(--line);
}

@media (max-width: 1180px) {
    .calendar-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 780px) {
    .calendar-hero {
        display: grid;
    }
    .calendar-grid {
        grid-template-columns: 1fr;
    }
}


.inline-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    margin-top: 8px;
    color: var(--green);
    font-weight: 700;
    border-bottom: 1px solid rgba(10, 110, 77, .25);
}

.inline-link:hover {
    border-bottom-color: var(--green);
}

.timeline-item .actions {
    justify-content: flex-end;
    align-content: flex-start;
}


.login-body {
    min-height: 100vh;
    background: radial-gradient(circle at top left, #fff8eb 0, var(--bg) 38%, #f4efe7 100%);
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(460px, 100%);
    background: white;
    border: 1px solid var(--line);
    border-radius: 30px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.login-card h2 {
    font-size: 32px;
    margin: 24px 0 4px;
}

.login-brand {
    justify-content: flex-start;
}

.login-form {
    display: grid;
    gap: 15px;
    margin-top: 20px;
}

.soft-line {
    width: 100%;
    border: 0;
    border-top: 1px solid var(--line);
    margin: 8px 0;
}

.logout-link {
    color: var(--green);
    font-weight: 700;
    margin-top: 4px;
}

.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inline-form input {
    min-width: 150px;
}

button[disabled] {
    opacity: .5;
    cursor: not-allowed;
}


.user-page-note {
    background: var(--green-soft);
    border: 1px solid #cbe9dd;
    color: var(--green);
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 14px;
}

.sidebar-card .muted {
    color: var(--muted);
}

.table form {
    margin: 0;
}


/* Mobile responsiveness refinements */
.mobile-menu-toggle {
    display: none;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive .table {
    min-width: 720px;
}

@media (max-width: 980px) {
    body {
        background: var(--bg);
    }

    .app-shell {
        display: block;
    }

    .sidebar {
        height: auto;
        position: relative;
        padding: 16px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        gap: 16px;
    }

    .brand {
        align-items: flex-start;
    }

    .brand-mark {
        width: 42px;
        height: 42px;
        border-radius: 14px;
        font-size: 21px;
    }

    .brand h1 {
        font-size: 19px;
    }

    .nav {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 5px;
        scrollbar-width: thin;
    }

    .nav a {
        white-space: nowrap;
        flex: 0 0 auto;
        padding: 10px 12px;
        font-size: 14px;
    }

    .sidebar-card {
        margin-top: 0;
        padding: 14px;
        border-radius: 18px;
    }

    .main {
        padding: 16px;
    }

    .topbar {
        display: grid;
        grid-template-columns: 1fr;
        align-items: start;
        margin-bottom: 16px;
    }

    .topbar h2 {
        font-size: 25px;
        line-height: 1.15;
    }

    .topbar p {
        line-height: 1.5;
    }

    .trip-switcher {
        width: 100%;
        min-width: 0;
    }

    .hero,
    .calendar-hero {
        border-radius: 22px;
        padding: 22px;
        display: grid;
    }

    .hero h1,
    .calendar-hero h1 {
        font-size: 30px;
        line-height: 1.15;
    }

    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .grid.cards-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .stat {
        min-height: 105px;
        padding: 16px;
    }

    .stat strong {
        font-size: 28px;
    }

    .grid.two {
        grid-template-columns: 1fr;
    }

    .card {
        border-radius: 20px;
        padding: 16px;
    }

    .day-head {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .actions {
        width: 100%;
    }

    .actions .btn,
    .actions button,
    .actions a {
        flex: 1 1 auto;
    }

    .timeline-item {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .timeline-item .actions {
        justify-content: stretch;
    }

    .timeline-item .actions .btn {
        flex: 1;
    }

    .time {
        background: var(--green-soft);
        color: var(--green);
        border-radius: 999px;
        padding: 6px 10px;
        width: fit-content;
    }

    .calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calendar-day {
        min-height: 205px;
    }

    .modal-overlay {
        padding: 12px;
        align-items: end;
    }

    .modal-card {
        width: 100%;
        max-height: 90vh;
        border-radius: 24px 24px 0 0;
        padding: 18px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid .full {
        grid-column: auto;
    }

    .inline-form {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .inline-form input,
    .inline-form button {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .main {
        padding: 12px;
    }

    .sidebar {
        padding: 14px 12px;
    }

    .brand p {
        font-size: 12px;
    }

    .topbar h2 {
        font-size: 22px;
    }

    .hero,
    .calendar-hero {
        padding: 18px;
        border-radius: 20px;
    }

    .hero h1,
    .calendar-hero h1 {
        font-size: 25px;
    }

    .grid.cards-4 {
        grid-template-columns: 1fr;
    }

    .stat {
        min-height: auto;
    }

    .stat strong {
        font-size: 25px;
    }

    .card {
        padding: 14px;
        border-radius: 18px;
    }

    .table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .calendar-grid {
        grid-template-columns: 1fr;
    }

    .calendar-day {
        min-height: auto;
    }

    .calendar-date strong {
        font-size: 30px;
    }

    .calendar-event {
        padding: 10px;
    }

    .day-badge,
    .tag {
        width: fit-content;
    }

    .btn {
        width: 100%;
        min-height: 42px;
    }

    .btn.small {
        min-height: 36px;
        width: auto;
    }

    .actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .actions .btn.small,
    .actions a.btn.small,
    .actions button.btn.small {
        width: 100%;
    }

    .login-wrap {
        padding: 14px;
        align-items: start;
        padding-top: 40px;
    }

    .login-card {
        padding: 22px;
        border-radius: 24px;
    }

    .login-card h2 {
        font-size: 28px;
    }

    input,
    textarea,
    select {
        font-size: 16px;
    }

    .sidebar-card {
        display: none;
    }
}

@media (max-width: 420px) {
    .nav a {
        font-size: 13px;
        padding: 9px 10px;
    }

    .brand h1 {
        font-size: 18px;
    }

    .hero h1,
    .calendar-hero h1 {
        font-size: 23px;
    }

    .topbar h2 {
        font-size: 20px;
    }

    .modal-card {
        padding: 15px;
    }

    .calendar-date {
        grid-template-columns: 1fr auto;
    }
}


.calendar-event.itinerary-source {
    border-left-color: var(--green);
    background: #f1fbf6;
}

.calendar-more {
    text-align: center;
    color: var(--green);
    font-weight: 700;
    background: var(--green-soft);
    border-radius: 14px;
    padding: 8px;
    font-size: 13px;
}

.day-view-card {
    width: min(860px, 100%);
}

.day-view-nav {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin: 15px 0;
}

.day-view-items {
    display: grid;
    gap: 12px;
}

.day-view-item {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 15px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fffdf8;
}

.day-view-item h4 {
    margin: 8px 0 4px;
}

@media (max-width: 780px) {
    .day-view-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .day-view-item {
        grid-template-columns: 1fr;
    }
}


/* Premium UI refinement layer */
:root {
    --bg: #f6f1e8;
    --panel: rgba(255, 255, 255, 0.94);
    --ink: #203128;
    --muted: #748079;
    --line: #e6dccd;
    --green: #0a6e4d;
    --green-dark: #07543b;
    --green-soft: #e8f4ef;
    --cream: #fffaf1;
    --gold-soft: #fff3d6;
    --red-soft: #fff0ed;
    --blue-soft: #edf6ff;
    --shadow: 0 18px 45px rgba(32, 49, 40, 0.08);
    --shadow-hover: 0 22px 55px rgba(32, 49, 40, 0.13);
    --radius: 24px;
}

body {
    background:
        radial-gradient(circle at 0% 0%, rgba(10, 110, 77, .09), transparent 28%),
        radial-gradient(circle at 100% 8%, rgba(244, 178, 59, .16), transparent 30%),
        linear-gradient(135deg, #fbf7ee 0%, #f6f1e8 58%, #f4eadb 100%);
}

.app-shell {
    background: transparent;
}

.sidebar {
    background: rgba(255, 250, 241, 0.86);
    backdrop-filter: blur(14px);
    border-right: 1px solid rgba(230, 220, 205, 0.9);
}

.brand-mark {
    background:
        radial-gradient(circle at 30% 25%, rgba(255,255,255,.35), transparent 26%),
        linear-gradient(135deg, var(--green), #129166);
    box-shadow: 0 14px 28px rgba(10, 110, 77, .22);
}

.brand h1 {
    letter-spacing: -.02em;
}

.nav a {
    position: relative;
    font-weight: 700;
    color: #46564d;
    border: 1px solid transparent;
}

.nav a:hover {
    background: rgba(10, 110, 77, .08);
    color: var(--green);
    border-color: rgba(10, 110, 77, .10);
}

.nav a.active {
    background: linear-gradient(135deg, var(--green), #11936b);
    color: white;
    box-shadow: 0 12px 24px rgba(10, 110, 77, .18);
}

.sidebar-card,
.card,
.login-card {
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(230, 220, 205, .92);
    box-shadow: var(--shadow);
}

.sidebar-card {
    gap: 9px;
}

.main {
    max-width: 1460px;
    width: 100%;
}

.topbar {
    background: rgba(255, 255, 255, .62);
    border: 1px solid rgba(230, 220, 205, .72);
    border-radius: 26px;
    padding: 18px 20px;
    box-shadow: 0 12px 30px rgba(32,49,40,.05);
    backdrop-filter: blur(10px);
}

.topbar h2 {
    letter-spacing: -.04em;
}

.topbar p {
    font-size: 14px;
}

.trip-switcher select {
    font-weight: 700;
    background: #fffdf8;
}

.hero,
.calendar-hero {
    background:
        radial-gradient(circle at 88% 8%, rgba(255,255,255,.22), transparent 26%),
        linear-gradient(135deg, #07543b 0%, #0a6e4d 48%, #16a474 100%);
    box-shadow: 0 24px 60px rgba(10, 110, 77, .20);
    border: 1px solid rgba(255,255,255,.22);
}

.hero h1,
.calendar-hero h1 {
    letter-spacing: -.05em;
}

.hero p,
.calendar-hero p {
    font-size: 16px;
}

.card {
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(10, 110, 77, .16);
}

.stat {
    position: relative;
    overflow: hidden;
}

.stat:after {
    content: "";
    position: absolute;
    right: -32px;
    bottom: -36px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(10, 110, 77, .09), transparent 68%);
    border-radius: 999px;
}

.stat span {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
}

.stat strong {
    letter-spacing: -.04em;
    color: var(--green-dark);
}

.btn {
    background: linear-gradient(135deg, var(--green), #11936b);
    box-shadow: 0 10px 18px rgba(10, 110, 77, .16);
    font-weight: 700;
    transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(10, 110, 77, .22);
}

.btn.secondary {
    background: var(--green-soft);
    color: var(--green-dark);
    box-shadow: none;
    border: 1px solid rgba(10,110,77,.12);
}

.btn.secondary:hover {
    background: #dff2ea;
}

.btn.light {
    background: rgba(255,255,255,.95);
    color: var(--green-dark);
    box-shadow: 0 12px 24px rgba(0,0,0,.10);
}

.btn.danger {
    background: linear-gradient(135deg, #a83227, #c64738);
}

input,
textarea,
select {
    background: #fffdf8;
    border-color: #e4d8c6;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(10, 110, 77, .55);
    box-shadow: 0 0 0 4px rgba(10, 110, 77, .10);
    background: white;
}

label {
    color: #26372e;
}

.alert {
    box-shadow: 0 10px 24px rgba(10, 110, 77, .08);
}

.table th {
    background: #fffaf2;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table tr {
    transition: background .14s ease;
}

.table tbody tr:hover {
    background: #fbf8f1;
}

.day-card {
    border-left: 0;
    position: relative;
    overflow: hidden;
}

.day-card:before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 7px;
    background: linear-gradient(180deg, var(--green), #58ba86);
}

.day-card .day-head {
    padding-left: 4px;
}

.day-badge {
    background: linear-gradient(135deg, var(--green-soft), #f2fbf7);
    color: var(--green-dark);
    border: 1px solid rgba(10, 110, 77, .12);
}

.timeline {
    gap: 14px;
}

.timeline-item {
    background: linear-gradient(180deg, #fffdf8, #fbfaf5);
    border-color: #eadfce;
    box-shadow: 0 10px 24px rgba(32, 49, 40, .04);
}

.timeline-item:hover {
    border-color: rgba(10,110,77,.22);
}

.time {
    font-variant-numeric: tabular-nums;
}

.inline-link {
    background: var(--green-soft);
    padding: 7px 10px;
    border-radius: 999px;
    border-bottom: 0;
}

.inline-link:hover {
    background: #dff2ea;
}

.calendar-grid {
    align-items: stretch;
}

.calendar-day {
    background: linear-gradient(180deg, #fffdf8, #f9f6ee);
    box-shadow: 0 12px 26px rgba(32,49,40,.045);
    border-color: #eadfce;
}

.calendar-day:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.calendar-date {
    background: rgba(232,244,239,.62);
    border-radius: 16px;
    padding: 11px;
    border-bottom: 0;
}

.calendar-date strong {
    color: var(--green-dark);
}

.calendar-event {
    box-shadow: 0 7px 16px rgba(10,110,77,.05);
}

.calendar-event strong {
    line-height: 1.25;
}

.calendar-event small {
    line-height: 1.4;
}

.day-view-item {
    background: linear-gradient(180deg, #fffdf8, #fbfaf5);
    box-shadow: 0 8px 20px rgba(32,49,40,.04);
}

.modal-overlay {
    backdrop-filter: blur(8px);
}

.modal-card {
    animation: modalRise .18s ease-out;
}

@keyframes modalRise {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-card {
    position: relative;
    overflow: hidden;
}

.login-card:before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 7px;
    background: linear-gradient(90deg, var(--green), #16a474, #f4b23b);
}

.logout-link {
    display: inline-flex;
    width: fit-content;
    background: var(--green-soft);
    padding: 8px 11px;
    border-radius: 999px;
}

.empty {
    background: linear-gradient(180deg, #fffdf8, #fbf8f1);
}

.tag {
    border: 1px solid rgba(32,49,40,.06);
}

@media (max-width: 980px) {
    .topbar {
        border-radius: 20px;
        padding: 15px;
    }

    .main {
        max-width: 100%;
    }

    .card:hover {
        transform: none;
    }

    .sidebar {
        backdrop-filter: none;
    }

    .nav {
        background: rgba(255,255,255,.55);
        border: 1px solid var(--line);
        border-radius: 18px;
        padding: 8px;
    }

    .nav a.active {
        box-shadow: none;
    }
}

@media (max-width: 640px) {
    .topbar {
        margin-bottom: 12px;
    }

    .hero p,
    .calendar-hero p {
        font-size: 14px;
    }

    .timeline-item,
    .day-view-item {
        padding: 12px;
    }

    .calendar-date {
        grid-template-columns: 1fr auto;
    }

    .modal-card {
        animation: mobileSheet .18s ease-out;
    }

    @keyframes mobileSheet {
        from {
            opacity: 0;
            transform: translateY(40px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}


.page-intro-card {
    margin-bottom: 18px;
    background:
        radial-gradient(circle at 96% 12%, rgba(10,110,77,.08), transparent 24%),
        rgba(255,255,255,.94);
}

.page-intro-card h3 {
    font-size: 26px;
    letter-spacing: -.03em;
    margin: 8px 0 6px;
}


/* Sidebar fit + full mobile responsiveness patch */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.app-shell {
    grid-template-columns: 240px minmax(0, 1fr);
}

.sidebar {
    width: 240px;
    min-width: 240px;
    padding: 18px 14px;
    overflow-y: auto;
    overflow-x: hidden;
}

.brand {
    gap: 10px;
}

.brand-mark {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    font-size: 20px;
}

.brand h1 {
    font-size: 18px;
    line-height: 1.1;
}

.brand p {
    font-size: 12px;
}

.nav {
    gap: 6px;
}

.nav a {
    padding: 10px 11px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.15;
}

.sidebar-card {
    padding: 13px;
    border-radius: 17px;
}

.sidebar-card strong {
    font-size: 14px;
    line-height: 1.25;
}

.sidebar-card small {
    font-size: 12px;
    line-height: 1.35;
}

.main {
    min-width: 0;
    padding: 18px;
}

.card,
.topbar,
.hero,
.calendar-hero,
.modal-card {
    max-width: 100%;
}

.table-responsive {
    max-width: 100%;
    overflow-x: auto;
}

img,
svg,
video,
canvas {
    max-width: 100%;
    height: auto;
}

.form-grid {
    min-width: 0;
}

input,
textarea,
select,
button {
    max-width: 100%;
}

@media (max-width: 1180px) {
    .app-shell {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .sidebar {
        width: 220px;
        min-width: 220px;
        padding: 16px 12px;
    }

    .nav a {
        font-size: 13px;
        padding: 9px 10px;
    }

    .brand h1 {
        font-size: 17px;
    }

    .grid.cards-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .calendar-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        width: 100%;
        min-width: 0;
        height: auto;
        max-height: none;
        position: relative;
        padding: 14px;
        overflow: visible;
    }

    .brand {
        margin-bottom: 4px;
    }

    .nav {
        display: flex !important;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 8px;
        padding: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .nav a {
        flex: 0 0 auto;
        white-space: nowrap;
        min-width: max-content;
        padding: 10px 12px;
        font-size: 13px;
    }

    .sidebar-card {
        display: grid;
        grid-template-columns: 1fr auto;
        align-items: center;
        gap: 8px 12px;
        margin-top: 10px;
    }

    .sidebar-card span,
    .sidebar-card strong,
    .sidebar-card small,
    .sidebar-card .soft-line {
        display: none;
    }

    .sidebar-card .logout-link {
        grid-column: 2;
        margin: 0;
        padding: 8px 12px;
    }

    .main {
        padding: 14px;
    }

    .topbar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .trip-switcher {
        width: 100%;
    }

    .grid.two {
        grid-template-columns: 1fr !important;
    }

    .calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .timeline-item,
    .day-view-item {
        grid-template-columns: 1fr;
    }

    .table-responsive .table {
        min-width: 650px;
    }
}

@media (max-width: 720px) {
    .main {
        padding: 12px;
    }

    .topbar {
        border-radius: 18px;
        padding: 14px;
    }

    .topbar h2 {
        font-size: 21px;
    }

    .topbar p {
        font-size: 13px;
    }

    .hero,
    .calendar-hero {
        padding: 18px;
        border-radius: 20px;
    }

    .hero h1,
    .calendar-hero h1 {
        font-size: 25px;
    }

    .grid.cards-4,
    .calendar-grid {
        grid-template-columns: 1fr !important;
    }

    .card {
        padding: 14px;
        border-radius: 18px;
    }

    .form-grid {
        grid-template-columns: 1fr !important;
    }

    .form-grid .full {
        grid-column: auto !important;
    }

    .actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .actions .btn,
    .actions button,
    .actions a {
        width: 100%;
    }

    .btn {
        justify-content: center;
        width: 100%;
    }

    .btn.small {
        width: 100%;
    }

    .day-head {
        grid-template-columns: 1fr !important;
    }

    .modal-overlay {
        padding: 10px;
        align-items: end;
    }

    .modal-card {
        width: 100%;
        max-height: 92vh;
        border-radius: 22px 22px 0 0;
        padding: 16px;
    }

    .day-view-nav {
        grid-template-columns: 1fr 1fr;
    }

    .calendar-event {
        width: 100%;
    }

    .table-responsive .table {
        min-width: 600px;
    }

    .login-wrap {
        padding: 14px;
        align-items: start;
        padding-top: 34px;
    }

    .login-card {
        width: 100%;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        padding: 12px 10px;
    }

    .brand-mark {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        border-radius: 12px;
        font-size: 18px;
    }

    .brand h1 {
        font-size: 16px;
    }

    .brand p {
        font-size: 11px;
    }

    .nav {
        gap: 6px;
        padding: 7px;
    }

    .nav a {
        padding: 8px 10px;
        font-size: 12.5px;
        border-radius: 10px;
    }

    .sidebar-card {
        display: none;
    }

    .main {
        padding: 10px;
    }

    .topbar h2 {
        font-size: 19px;
    }

    .hero h1,
    .calendar-hero h1 {
        font-size: 22px;
    }

    .hero p,
    .calendar-hero p {
        font-size: 13px;
    }

    .stat strong {
        font-size: 24px;
    }

    .calendar-day {
        min-height: auto;
    }

    .calendar-date strong {
        font-size: 28px;
    }

    .table-responsive .table,
    .table {
        min-width: 560px;
    }

    .page-intro-card h3 {
        font-size: 21px;
    }

    .day-badge,
    .tag {
        font-size: 11.5px;
    }

    .timeline-item,
    .day-view-item {
        padding: 11px;
    }

    input,
    textarea,
    select {
        font-size: 16px;
    }
}


/* Index mobile fit + desktop full-height sidebar patch */
@media (min-width: 981px) {
    .app-shell {
        align-items: stretch;
        min-height: 100vh;
    }

    .sidebar {
        position: sticky;
        top: 0;
        align-self: stretch;
        min-height: 100vh;
        height: 100vh;
        max-height: 100vh;
        overflow-y: auto;
    }

    .main {
        min-height: 100vh;
    }
}

.index-itinerary-list {
    display: grid;
    gap: 12px;
}

.index-itinerary-item {
    display: grid;
    grid-template-columns: 62px 1fr;
    gap: 13px;
    align-items: start;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(180deg, #fffdf8, #fbfaf5);
}

.index-day-pill {
    min-height: 62px;
    border-radius: 18px;
    background: var(--green-soft);
    color: var(--green-dark);
    display: grid;
    place-items: center;
    align-content: center;
    border: 1px solid rgba(10, 110, 77, .12);
}

.index-day-pill span {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 700;
}

.index-day-pill strong {
    font-size: 24px;
    line-height: 1;
}

.index-item-topline {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 10px;
    margin-bottom: 5px;
}

.index-item-topline span {
    flex: 0 0 auto;
    color: var(--green);
    font-weight: 700;
    font-size: 13px;
    background: var(--green-soft);
    padding: 5px 8px;
    border-radius: 999px;
}

.index-itinerary-item p {
    margin: 0;
    line-height: 1.45;
}

@media (max-width: 720px) {
    .grid.two {
        gap: 12px;
    }

    .index-itinerary-item {
        grid-template-columns: 52px 1fr;
        gap: 10px;
        padding: 11px;
        border-radius: 16px;
    }

    .index-day-pill {
        min-height: 52px;
        border-radius: 15px;
    }

    .index-day-pill strong {
        font-size: 21px;
    }

    .index-item-topline {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .index-item-topline span {
        width: fit-content;
    }

    .check-row {
        align-items: flex-start;
        gap: 10px;
        padding: 12px 0;
    }

    .check-row > span:first-child {
        flex: 0 0 auto;
    }

    .check-row strong {
        line-height: 1.25;
    }

    .check-row small {
        line-height: 1.35;
        display: inline-block;
        margin-top: 3px;
    }
}

@media (max-width: 420px) {
    .index-itinerary-item {
        grid-template-columns: 1fr;
    }

    .index-day-pill {
        width: fit-content;
        min-height: auto;
        display: inline-flex;
        gap: 6px;
        padding: 8px 11px;
    }

    .index-day-pill strong {
        font-size: 18px;
    }
}


/* Final desktop sidebar full-page height fix */
@media (min-width: 981px) {
    html,
    body {
        min-height: 100%;
    }

    body {
        position: relative;
    }

    .app-shell {
        display: grid;
        grid-template-columns: 240px minmax(0, 1fr);
        align-items: stretch;
        min-height: 100vh;
        position: relative;
    }

    .app-shell::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 240px;
        background: rgba(255, 250, 241, 0.86);
        border-right: 1px solid rgba(230, 220, 205, 0.9);
        z-index: 0;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 2;
        align-self: start;
        height: 100vh;
        min-height: 100vh;
        max-height: 100vh;
        width: 240px;
        min-width: 240px;
        overflow-y: auto;
        background: transparent !important;
        border-right: 0 !important;
    }

    .main {
        position: relative;
        z-index: 1;
        min-height: 100vh;
        min-width: 0;
    }
}

@media (min-width: 981px) and (max-width: 1180px) {
    .app-shell {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .app-shell::before {
        width: 220px;
    }

    .sidebar {
        width: 220px;
        min-width: 220px;
    }
}

/* Calendar category filter + refined premium calendar UI */
.calendar-hero {
    position: relative;
    overflow: hidden;
}

.calendar-hero:before {
    content: "";
    position: absolute;
    right: 18%;
    top: -70px;
    width: 190px;
    height: 190px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .12);
}

.calendar-hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.calendar-panel {
    padding: 0;
    overflow: hidden;
}

.calendar-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    padding: 22px;
    background: linear-gradient(180deg, #fffdf8, #fbf7ef);
    border-bottom: 1px solid var(--line);
}

.calendar-toolbar h3 {
    margin: 10px 0 6px;
    font-size: 25px;
    letter-spacing: -.03em;
}

.calendar-toolbar-actions {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
    min-width: min(520px, 100%);
}

.calendar-filter-label {
    min-width: 240px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .07em;
    font-size: 11px;
}

.calendar-filter-label select {
    margin-top: 7px;
    text-transform: none;
    letter-spacing: 0;
    font-size: 14px;
    color: var(--ink);
    font-weight: 700;
}

.calendar-filter-chips {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    padding: 16px 22px 0;
    background: #fff;
}

.filter-chip {
    border: 1px solid #e4d8c6;
    background: #fffdf8;
    color: #47564c;
    padding: 9px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    transition: .16s ease;
}

.filter-chip span {
    display: inline-flex;
    min-width: 22px;
    height: 22px;
    padding: 0 7px;
    margin-left: 5px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: var(--green-soft);
    color: var(--green);
    font-size: 12px;
}

.filter-chip:hover,
.filter-chip.active {
    background: var(--green);
    border-color: var(--green);
    color: white;
    transform: translateY(-1px);
}

.filter-chip.active span,
.filter-chip:hover span {
    background: rgba(255,255,255,.22);
    color: white;
}

.calendar-results-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 16px 22px 0;
    padding: 12px 14px;
    border-radius: 16px;
    background: var(--green-soft);
    color: var(--green-dark, #07543b);
}

.inline-reset {
    border: 0;
    background: transparent;
    color: var(--green);
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
    border-bottom: 1px solid rgba(10,110,77,.28);
    padding: 0 0 2px;
}

.calendar-panel .calendar-grid {
    padding: 22px;
    margin-top: 0;
}

.calendar-day {
    position: relative;
    overflow: hidden;
}

.calendar-day:before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, var(--green), #f0a846);
    opacity: .8;
}

.calendar-day-muted {
    opacity: .48;
    filter: grayscale(.12);
}

.calendar-day-muted:hover {
    opacity: .78;
}

.calendar-day-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    margin: -2px 0 12px;
    color: var(--muted);
    font-size: 12px;
}

.calendar-day-meta span {
    font-weight: 800;
    color: var(--green);
}

.calendar-event {
    position: relative;
    border-left: 0;
    background: #ffffff;
    border: 1px solid #e6ddcf;
    padding: 12px 12px 11px;
}

.calendar-event:before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 4px;
    border-radius: 999px;
    background: var(--green);
}

.calendar-event span {
    padding-left: 6px;
}

.calendar-event strong,
.calendar-event small,
.calendar-event em {
    margin-left: 6px;
}

.calendar-event em {
    width: fit-content;
    font-style: normal;
    font-size: 11px;
    font-weight: 800;
    color: #9a5b00;
    background: var(--orange-soft);
    padding: 5px 8px;
    border-radius: 999px;
}

.calendar-filter-empty {
    padding: 12px;
    border-radius: 16px;
    background: #fff8ee;
    border: 1px dashed #ead0a5;
    color: #9a5b00;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
}

.day-view-card {
    width: min(900px, 100%);
}

.day-view-nav {
    background: #fffaf2;
    padding: 10px;
    border-radius: 18px;
    border: 1px solid var(--line);
}

.day-view-items {
    max-height: 52vh;
    overflow: auto;
    padding-right: 4px;
}

.day-view-item {
    border: 1px solid #eadfce;
    border-radius: 20px;
    padding: 15px;
}

@media (max-width: 980px) {
    .calendar-toolbar {
        display: grid;
    }

    .calendar-toolbar-actions {
        justify-content: stretch;
        min-width: 0;
    }

    .calendar-filter-label {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 720px) {
    .calendar-toolbar,
    .calendar-filter-chips,
    .calendar-panel .calendar-grid {
        padding: 14px;
    }

    .calendar-results-bar {
        margin: 12px 14px 0;
        display: grid;
    }

    .filter-chip {
        flex: 1 1 auto;
    }
}

.calendar-event-extra {
    display: none;
}

.calendar-event-filter-match {
    order: -1;
    border-color: rgba(10, 110, 77, .32);
    box-shadow: 0 12px 26px rgba(10, 110, 77, .10);
}

.calendar-event-filter-match:before {
    background: #0A6E4D;
}

/* Trip command center dashboard upgrade */
.dashboard-hero {
    background: linear-gradient(135deg, #0a6e4d, #0f9a70 58%, #f2b35d);
    color: white;
    border-radius: 32px;
    padding: 30px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 22px;
    align-items: stretch;
}

.dashboard-hero:after {
    content: "";
    position: absolute;
    width: 360px;
    height: 360px;
    border-radius: 999px;
    background: rgba(255,255,255,0.13);
    right: -110px;
    top: -140px;
}

.dashboard-hero-content,
.countdown-card {
    position: relative;
    z-index: 1;
}

.dashboard-hero h1 {
    margin: 0;
    font-size: 42px;
    letter-spacing: -.03em;
}

.dashboard-hero p {
    max-width: 760px;
    line-height: 1.6;
    opacity: .93;
}

.countdown-card {
    border: 1px solid rgba(255,255,255,.35);
    background: rgba(255,255,255,.16);
    border-radius: 26px;
    padding: 22px;
    display: grid;
    align-content: center;
    backdrop-filter: blur(10px);
}

.countdown-card span,
.countdown-card small {
    opacity: .88;
}

.countdown-card strong {
    font-size: 48px;
    line-height: 1;
    margin: 10px 0;
}

.dashboard-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.dashboard-stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 18px;
    box-shadow: var(--shadow);
    min-height: 142px;
    display: grid;
    align-content: space-between;
    position: relative;
    overflow: hidden;
}

.dashboard-stat-card:before {
    content: "";
    position: absolute;
    width: 86px;
    height: 86px;
    border-radius: 999px;
    right: -32px;
    top: -32px;
    opacity: .72;
}

.dashboard-stat-card span,
.dashboard-stat-card small {
    color: var(--muted);
    font-size: 13px;
}

.dashboard-stat-card strong {
    font-size: 28px;
    margin: 11px 0 6px;
}

.dashboard-stat-card.accent-green:before { background: var(--green-soft); }
.dashboard-stat-card.accent-orange:before { background: var(--orange-soft); }
.dashboard-stat-card.accent-blue:before { background: var(--blue-soft); }
.dashboard-stat-card.accent-purple:before { background: #f1ecff; }

.document-shortcut {
    transition: .18s ease;
}

.document-shortcut:hover {
    transform: translateY(-3px);
    border-color: rgba(10,110,77,.28);
}

.dashboard-grid-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.command-card {
    overflow: hidden;
}

.command-card .day-head p {
    margin: 4px 0 0;
}

.next-activity-box {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 18px;
    align-items: center;
    background: linear-gradient(135deg, #fffaf0, #ffffff);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 18px;
    margin-top: 12px;
}

.next-date-pill {
    min-height: 92px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    align-content: center;
    background: var(--green);
    color: white;
}

.next-date-pill span {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 11px;
}

.next-date-pill strong {
    font-size: 34px;
    line-height: 1;
}

.next-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 8px;
}

.next-meta-row span,
.day-mini-metrics span {
    background: var(--green-soft);
    color: var(--green);
    border-radius: 999px;
    padding: 6px 9px;
    font-size: 12px;
    font-weight: 700;
}

.next-activity-box h2 {
    margin: 0 0 6px;
    font-size: 28px;
}

.next-activity-box p {
    margin: 0;
    color: var(--muted);
}

.compact-check-row {
    padding: 11px 0;
}

.dashboard-lower-grid {
    margin-bottom: 18px;
}

.mini-calendar-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.mini-calendar-day {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 12px;
    background: #fffdf8;
    display: grid;
    gap: 5px;
    min-height: 92px;
}

.mini-calendar-day.today {
    background: var(--green);
    color: #fff;
    border-color: var(--green);
}

.mini-calendar-day span,
.mini-calendar-day small {
    color: inherit;
    opacity: .72;
    font-size: 12px;
}

.weather-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.weather-mini-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(135deg, #fff8ea, #ffffff);
    padding: 14px;
    display: grid;
    gap: 7px;
    min-height: 112px;
}

.weather-mini-card > span {
    font-size: 24px;
}

.weather-mini-card small {
    color: var(--green);
    font-weight: 700;
}

.enhanced-itinerary-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.day-mini-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 10px;
}

.documents-hero {
    margin-bottom: 18px;
}

.doc-category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.doc-category-card {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: white;
    box-shadow: var(--shadow);
    padding: 16px;
    display: grid;
    gap: 8px;
}

.doc-category-card span {
    color: var(--muted);
    font-size: 13px;
}

.doc-category-card strong {
    font-size: 26px;
}

.documents-list {
    display: grid;
    gap: 10px;
}

.document-row {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fffdf8;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.document-row p {
    margin: 4px 0;
}

@media (max-width: 1180px) {
    .dashboard-stat-grid,
    .doc-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid-main,
    .grid.two.dashboard-lower-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .dashboard-hero {
        grid-template-columns: 1fr;
        padding: 22px;
        border-radius: 24px;
    }

    .dashboard-hero h1 {
        font-size: 31px;
    }

    .dashboard-stat-grid,
    .doc-category-grid,
    .weather-card-grid,
    .enhanced-itinerary-list {
        grid-template-columns: 1fr;
    }

    .next-activity-box {
        grid-template-columns: 1fr;
    }

    .next-date-pill {
        width: fit-content;
        min-height: auto;
        padding: 10px 14px;
        grid-auto-flow: column;
        gap: 8px;
    }

    .next-date-pill strong {
        font-size: 22px;
    }

    .mini-calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .document-row {
        display: grid;
    }
}

/* Mobile app-like navigation and interactions */
.mobile-app-topbar,
.mobile-bottom-nav,
.mobile-fab,
.sidebar-backdrop,
.mobile-date-strip {
    display: none;
}

.nav a,
.btn,
.calendar-day,
.calendar-event,
.timeline-item,
.card,
.mobile-bottom-nav a,
.mobile-date-strip a,
.mobile-date-strip button,
.mobile-fab {
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav a span {
    width: 24px;
    text-align: center;
}

.btn:active,
.calendar-event:active,
.mobile-bottom-nav a:active,
.mobile-date-strip a:active,
.mobile-date-strip button:active,
.mobile-fab:active {
    transform: scale(.97);
}

.itinerary-grid {
    scroll-margin-top: 110px;
}

.app-itinerary-card {
    scroll-margin-top: 110px;
}

.app-timeline-card {
    position: relative;
    overflow: hidden;
}

.app-timeline-card:before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--green);
    opacity: .75;
}

.day-view-card {
    overscroll-behavior: contain;
}

.day-view-card:after {
    content: "Swipe left/right to move between days";
    display: block;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    margin-top: 12px;
}

@media (max-width: 980px) {
    body {
        padding-top: 68px;
        padding-bottom: 86px;
    }

    .mobile-app-topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 80;
        height: 64px;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
        background: rgba(251, 248, 241, .92);
        border-bottom: 1px solid var(--line);
        backdrop-filter: blur(14px);
        box-shadow: 0 10px 26px rgba(35, 48, 41, .08);
    }

    .mobile-app-topbar strong,
    .mobile-app-topbar small {
        display: block;
        line-height: 1.2;
    }

    .mobile-app-topbar small {
        color: var(--muted);
        font-size: 12px;
        margin-top: 2px;
    }

    .mobile-menu-btn {
        width: 42px;
        height: 42px;
        border: 0;
        border-radius: 15px;
        background: var(--green);
        color: #fff;
        font-size: 22px;
        box-shadow: var(--shadow);
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(86vw, 330px);
        height: 100vh;
        z-index: 100;
        transform: translateX(-105%);
        transition: transform .28s ease;
        overflow-y: auto;
        padding-top: 24px;
        border-right: 1px solid var(--line);
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(36,48,41,.42);
        z-index: 90;
        opacity: 0;
        pointer-events: none;
        transition: opacity .22s ease;
        display: block;
    }

    body.sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .nav {
        grid-template-columns: 1fr;
    }

    .nav a {
        padding: 14px 15px;
        font-size: 15px;
    }

    .main {
        padding: 16px 14px 24px;
    }

    .topbar {
        display: none;
    }

    .hero,
    .calendar-hero,
    .card {
        border-radius: 24px;
    }

    .calendar-hero {
        padding: 22px;
    }

    .calendar-hero h1,
    .hero h1 {
        font-size: 28px;
    }

    .grid.cards-4 {
        gap: 12px;
    }

    .mobile-bottom-nav {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: 10px;
        z-index: 75;
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 4px;
        background: rgba(255,255,255,.92);
        border: 1px solid var(--line);
        border-radius: 24px;
        padding: 7px;
        box-shadow: 0 16px 46px rgba(35,48,41,.18);
        backdrop-filter: blur(16px);
    }

    .mobile-bottom-nav a {
        display: grid;
        place-items: center;
        gap: 3px;
        padding: 8px 4px;
        border-radius: 18px;
        color: var(--muted);
        font-weight: 700;
    }

    .mobile-bottom-nav a span {
        font-size: 19px;
        line-height: 1;
    }

    .mobile-bottom-nav a small {
        font-size: 10px;
    }

    .mobile-bottom-nav a.active {
        background: var(--green-soft);
        color: var(--green);
    }

    .mobile-fab {
        position: fixed;
        right: 18px;
        bottom: 94px;
        z-index: 76;
        width: 58px;
        height: 58px;
        border: 0;
        border-radius: 22px;
        background: var(--green);
        color: #fff;
        font-size: 30px;
        line-height: 1;
        box-shadow: 0 18px 42px rgba(10,110,77,.32);
        display: grid;
        place-items: center;
    }

    .mobile-date-strip {
        position: sticky;
        top: 68px;
        z-index: 65;
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding: 10px 2px 12px;
        margin: 10px 0 6px;
        background: linear-gradient(180deg, rgba(247,243,236,.98), rgba(247,243,236,.80));
        backdrop-filter: blur(10px);
        scrollbar-width: none;
    }

    .mobile-date-strip::-webkit-scrollbar {
        display: none;
    }

    .mobile-date-strip a,
    .mobile-date-strip button {
        flex: 0 0 auto;
        min-width: 92px;
        border: 1px solid var(--line);
        border-radius: 18px;
        padding: 10px 12px;
        background: #fffdf8;
        color: var(--ink);
        font-family: inherit;
        box-shadow: 0 8px 22px rgba(35,48,41,.06);
        text-align: left;
    }

    .mobile-date-strip a strong,
    .mobile-date-strip button strong,
    .mobile-date-strip a span,
    .mobile-date-strip button span {
        display: block;
    }

    .mobile-date-strip a span,
    .mobile-date-strip button span {
        color: var(--muted);
        font-size: 12px;
        margin-top: 2px;
    }

    .mobile-date-strip a.active,
    .mobile-date-strip button.active {
        background: var(--green);
        color: #fff;
        border-color: var(--green);
    }

    .mobile-date-strip a.active span,
    .mobile-date-strip button.active span {
        color: rgba(255,255,255,.78);
    }

    .day-head {
        display: grid;
        grid-template-columns: 1fr;
    }

    .day-head .btn,
    .calendar-hero-actions .btn,
    .calendar-toolbar-actions .btn {
        width: 100%;
    }

    .itinerary-hero-card .day-head {
        gap: 14px;
    }

    .app-itinerary-card {
        padding: 0;
        overflow: hidden;
        border-left: 0;
        background: linear-gradient(180deg, #ffffff, #fffaf1);
    }

    .app-itinerary-card > .day-head {
        padding: 18px;
        background: linear-gradient(135deg, var(--green-soft), #fffdf8);
        border-bottom: 1px solid var(--line);
    }

    .app-itinerary-card .timeline {
        padding: 0 14px 16px;
    }

    .timeline-item.app-timeline-card {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 16px 14px 16px 18px;
        background: #fff;
        box-shadow: 0 8px 20px rgba(35,48,41,.06);
    }

    .timeline-item .actions {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .timeline-item .actions .btn {
        width: 100%;
    }

    .time {
        width: fit-content;
        background: var(--green-soft);
        color: var(--green);
        padding: 7px 10px;
        border-radius: 999px;
        font-size: 12px;
    }

    .calendar-toolbar,
    .calendar-toolbar-actions,
    .calendar-results-bar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .calendar-filter-chips {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .calendar-filter-chips::-webkit-scrollbar {
        display: none;
    }

    .filter-chip {
        flex: 0 0 auto;
    }

    .calendar-day {
        min-height: unset;
        box-shadow: 0 10px 26px rgba(35,48,41,.07);
    }

    .calendar-event {
        border-left-width: 4px;
    }

    .modal-overlay {
        padding: 0;
        align-items: stretch;
    }

    .modal-card {
        width: 100%;
        max-height: 100vh;
        border-radius: 26px 26px 0 0;
        margin-top: auto;
        padding: 20px 16px calc(92px + env(safe-area-inset-bottom));
    }

    .modal-card.day-view-card {
        min-height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        padding-top: 22px;
    }

    .day-view-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        position: sticky;
        top: 0;
        background: rgba(255,255,255,.92);
        backdrop-filter: blur(12px);
        z-index: 2;
        padding: 10px 0;
    }

    .day-view-item {
        grid-template-columns: 1fr;
        background: #fffdf8;
        border-radius: 20px;
        box-shadow: 0 10px 22px rgba(35,48,41,.06);
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 981px) {
    .mobile-fab {
        display: none !important;
    }
}

/* ==========================================================================
   Travel Portal v2: Enhanced Calendar Views (Month, Week, List)
   ========================================================================== */

/* View Selector Tab Styling */
.calendar-view-selector {
    display: inline-flex;
    background: var(--green-soft);
    border: 1px solid rgba(10, 110, 77, 0.15);
    border-radius: 16px;
    padding: 4px;
    gap: 4px;
    margin-bottom: 20px;
}

.calendar-view-btn {
    border: 0;
    background: transparent;
    color: var(--green-dark);
    padding: 8px 18px;
    font-weight: 700;
    font-size: 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
    font-family: inherit;
}

.calendar-view-btn:hover {
    background: rgba(10, 110, 77, 0.08);
}

.calendar-view-btn.active {
    background: var(--green);
    color: white;
    box-shadow: 0 4px 10px rgba(10, 110, 77, 0.15);
}

/* Month Grid Layout */
.month-calendar-container {
    margin-top: 15px;
}

.month-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
}

.month-calendar-header h4 {
    font-size: 20px;
    color: var(--green-dark);
    margin: 0;
    letter-spacing: -0.02em;
}

.month-calendar-weekday-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.month-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.month-day-cell {
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 10px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    transition: all 0.18s ease;
    position: relative;
}

.month-day-cell:hover {
    border-color: rgba(10, 110, 77, 0.3);
    box-shadow: 0 8px 20px rgba(32, 49, 40, 0.04);
}

/* Grayed out non-trip or pad days */
.month-day-cell.pad-day {
    background: #fbf9f4;
    border-color: rgba(230, 220, 205, 0.5);
    opacity: 0.45;
}

.month-day-cell.pad-day .month-day-num {
    color: var(--muted);
}

/* Highlighted active trip days */
.month-day-cell.trip-day {
    border-color: rgba(10, 110, 77, 0.25);
    background: linear-gradient(180deg, #fffdf8, #fbfaf4);
}

.month-day-cell.trip-day:hover {
    border-color: var(--green);
    box-shadow: 0 8px 25px rgba(10, 110, 77, 0.06);
}

.month-day-cell.today {
    background: var(--green-soft) !important;
    border-color: var(--green) !important;
}

.month-day-header-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
}

.month-day-num {
    font-weight: 700;
    font-size: 15px;
    color: var(--ink);
}

.month-day-badge {
    font-size: 10px;
    padding: 2px 6px;
    font-weight: 700;
    border-radius: 6px;
    background: var(--gold-soft);
    color: #b25e00;
    border: 1px solid rgba(244, 178, 59, 0.2);
}

/* Mini Activity Items within Calendar Cells */
.month-day-activities {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-grow: 1;
    min-height: 50px;
}

.month-activity-tag {
    font-size: 11px;
    padding: 6px 8px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid var(--line);
    border-left: 3px solid var(--green);
    color: var(--ink);
    font-weight: 600;
    cursor: grab;
    transition: all 0.12s ease;
    display: flex;
    flex-direction: column;
    gap: 1px;
    box-shadow: 0 2px 5px rgba(32, 49, 40, 0.02);
    text-align: left;
    width: 100%;
}

.month-activity-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(32, 49, 40, 0.05);
    border-color: rgba(10, 110, 77, 0.3);
}

.month-activity-tag strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.2;
}

.month-activity-tag span {
    font-size: 9px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}



/* Drag and Drop Visual Feedback States */
.month-activity-tag.dragging {
    opacity: 0.4;
    cursor: grabbing;
    background: var(--green-soft) !important;
    border-style: dashed;
}

.month-day-cell.drag-over {
    border-color: var(--green) !important;
    background: var(--green-soft) !important;
    box-shadow: inset 0 0 0 2px rgba(10, 110, 77, 0.15) !important;
}

/* Responsive adjustments for Monthly calendar grid */
@media (max-width: 1024px) {
    .month-calendar-weekday-grid,
    .month-calendar-grid {
        gap: 6px;
    }

    .month-day-cell {
        min-height: 100px;
        padding: 6px;
    }

    .month-day-num {
        font-size: 13px;
    }

    .month-day-badge {
        font-size: 8px;
        padding: 1px 4px;
    }

    .month-activity-tag {
        font-size: 10px;
        padding: 4px;
        border-radius: 6px;
    }
}

@media (max-width: 768px) {
    /* Make month grid scrollable or adapt cleanly */
    .month-calendar-wrapper {
        overflow-x: auto;
        padding-bottom: 12px;
        -webkit-overflow-scrolling: touch;
    }

    .month-calendar-weekday-grid,
    .month-calendar-grid {
        min-width: 780px;
    }
}

/* ==========================================================================
   Travel Portal v2: Rich Category HSL Themes & Opened Day View Modal
   ========================================================================== */

/* Category Specific HSL Themes */
.cat-travel, .tag-cat-travel, .cat-train, .tag-cat-train, .cat-flight, .tag-cat-flight {
    --cat-bg: #f0f7ff;
    --cat-border: rgba(191, 219, 254, 0.7);
    --cat-accent: #2563eb;
    --cat-text: #1e3a8a;
}
.cat-food, .tag-cat-food {
    --cat-bg: #fffaf0;
    --cat-border: rgba(254, 215, 170, 0.7);
    --cat-accent: #d97706;
    --cat-text: #78350f;
}
.cat-sightseeing, .tag-cat-sightseeing, .cat-explore, .tag-cat-explore, .cat-architecture, .tag-cat-architecture {
    --cat-bg: #faf5ff;
    --cat-border: rgba(233, 213, 255, 0.7);
    --cat-accent: #7c3aed;
    --cat-text: #4c1d95;
}
.cat-leisure, .tag-cat-leisure {
    --cat-bg: #f0fdfa;
    --cat-border: rgba(153, 246, 228, 0.7);
    --cat-accent: #0d9488;
    --cat-text: #115e59;
}
.cat-important, .tag-cat-important, .cat-hotel, .tag-cat-hotel {
    --cat-bg: #f0fdf4;
    --cat-border: rgba(187, 247, 208, 0.7);
    --cat-accent: #16a34a;
    --cat-text: #14532d;
}
.cat-reminder, .tag-cat-reminder, .cat-uncategorised, .tag-cat-uncategorised {
    --cat-bg: #f8fafc;
    --cat-border: rgba(226, 232, 240, 0.7);
    --cat-accent: #475569;
    --cat-text: #0f172a;
}

/* Apply HSL theme variables to Month view activity tags */
.month-activity-tag {
    box-sizing: border-box !important;
    max-width: 100% !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    background: var(--cat-bg, #ffffff) !important;
    border: 1px solid var(--cat-border, var(--line)) !important;
    border-left: 4px solid var(--cat-accent, var(--green)) !important;
    color: var(--cat-text, var(--ink)) !important;
    border-radius: 10px;
    padding: 8px 10px;
    box-shadow: 0 4px 10px rgba(32, 49, 40, 0.02) !important;
    margin-bottom: 2px;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    text-align: left !important;
}

.month-activity-tag:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 15px rgba(32, 49, 40, 0.05) !important;
}

.month-activity-tag strong {
    font-weight: 700;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
}

.month-activity-tag span {
    color: var(--cat-text, var(--muted)) !important;
    opacity: 0.8;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
}

/* Apply HSL theme variables to List View calendar items */
.calendar-event {
    box-sizing: border-box !important;
    max-width: 100% !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    background: var(--cat-bg, #ffffff) !important;
    border: 1px solid var(--cat-border, var(--line)) !important;
    border-left: 5px solid var(--cat-accent, var(--green)) !important;
    color: var(--cat-text, var(--ink)) !important;
    box-shadow: 0 6px 18px rgba(32, 49, 40, 0.03) !important;
    border-radius: 14px;
    padding: 12px 14px;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    text-align: left !important;
}

.calendar-event span {
    color: var(--cat-accent, var(--ink)) !important;
    font-weight: 800;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
}

.calendar-event strong {
    font-weight: 700;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
    line-height: 1.3;
}

.calendar-event small {
    color: var(--cat-text, var(--muted)) !important;
    opacity: 0.85;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
}

.calendar-event em {
    background: var(--cat-border, var(--green-soft)) !important;
    color: var(--cat-text, var(--green-dark)) !important;
    display: inline-block;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    width: fit-content;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    white-space: normal !important;
}

/* Opened Day Modal Glassmorphism & Card styling */
#dayViewModal.modal-overlay {
    background: rgba(20, 31, 25, 0.5) !important;
    backdrop-filter: blur(12px) !important;
    display: none;
    place-items: center;
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 20px;
}

.day-view-card.modal-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.99) 0%, rgba(255, 253, 248, 0.97) 100%) !important;
    border: 1px solid rgba(230, 220, 205, 0.7) !important;
    border-radius: 28px !important;
    box-shadow: 0 28px 75px rgba(20, 35, 28, 0.14) !important;
    width: min(780px, 100%) !important;
    padding: 30px !important;
    animation: modalRise 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.day-view-card .day-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    padding-bottom: 16px;
    margin-bottom: 18px;
}

.day-view-card .day-head h3 {
    font-size: 25px;
    letter-spacing: -0.03em;
    color: var(--green-dark);
    margin: 8px 0 4px;
}

.day-view-card .day-badge {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Nav switches inside modal */
.day-view-nav {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.day-view-nav .btn.secondary {
    flex: 1;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--line);
    color: var(--green-dark);
    transition: all 0.16s ease;
}

.day-view-nav .btn.secondary:hover {
    background: var(--green-soft);
    border-color: var(--green);
    transform: translateY(-1px);
}

/* Day View Timeline List */
.day-view-items {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 460px;
    overflow-y: auto;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--green-soft) transparent;
}

.day-view-items::-webkit-scrollbar {
    width: 6px;
}
.day-view-items::-webkit-scrollbar-thumb {
    background-color: var(--green-soft);
    border-radius: 99px;
}

.day-view-item {
    display: grid;
    grid-template-columns: 110px 1fr auto;
    gap: 20px;
    padding: 18px 22px;
    border-radius: 20px;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    box-shadow: 0 8px 24px rgba(32, 49, 40, 0.035);
    background: var(--cat-bg, #ffffff) !important;
    border: 1px solid var(--cat-border, var(--line)) !important;
    border-left-width: 5px !important;
    border-left-color: var(--cat-accent, var(--green)) !important;
}

.day-view-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(10, 110, 77, 0.08) !important;
    border-color: var(--cat-accent, var(--green)) !important;
}

/* Time badge layout */
.time-badge {
    background: var(--cat-border, var(--green-soft)) !important;
    color: var(--cat-text, var(--green-dark)) !important;
    font-size: 13px;
    font-weight: 800;
    padding: 8px 12px;
    border-radius: 14px;
    height: fit-content;
    text-align: center;
    white-space: nowrap;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 2px 8px rgba(32, 49, 40, 0.01);
}

.day-view-item-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.day-view-item-content h4 {
    font-size: 18px;
    color: var(--cat-text, var(--ink)) !important;
    margin: 4px 0 0 0;
    font-weight: 700;
    line-height: 1.3;
}

.day-view-item-content .location-row {
    font-size: 13px;
    color: var(--cat-text, var(--muted)) !important;
    opacity: 0.85;
    margin: 2px 0 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Inline Reference Link inside opened day */
.day-view-item-content .inline-link {
    font-size: 12px;
    font-weight: 700;
    color: var(--cat-text, var(--green)) !important;
    background: var(--cat-border, var(--green-soft)) !important;
    padding: 6px 14px;
    border-radius: 99px;
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.16s ease;
    margin-top: 4px;
    border-bottom: 0;
}

.day-view-item-content .inline-link:hover {
    background: var(--cat-accent, var(--green)) !important;
    color: white !important;
}

/* Beautiful dynamic category tag inside day view modal */
.tag-cat-travel, .tag-cat-train, .tag-cat-flight {
    background: rgba(59, 130, 246, 0.1) !important;
    color: #1d4ed8 !important;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
}
.tag-cat-food {
    background: rgba(245, 158, 11, 0.1) !important;
    color: #b45309 !important;
    border: 1px solid rgba(245, 158, 11, 0.2) !important;
}
.tag-cat-sightseeing, .tag-cat-explore, .tag-cat-architecture {
    background: rgba(124, 58, 237, 0.1) !important;
    color: #6d28d9 !important;
    border: 1px solid rgba(124, 58, 237, 0.2) !important;
}
.tag-cat-leisure {
    background: rgba(13, 148, 136, 0.1) !important;
    color: #0f766e !important;
    border: 1px solid rgba(13, 148, 136, 0.2) !important;
}
.tag-cat-important, .tag-cat-hotel {
    background: rgba(22, 163, 74, 0.1) !important;
    color: #15803d !important;
    border: 1px solid rgba(22, 163, 74, 0.2) !important;
}
.tag-cat-reminder, .tag-cat-uncategorised {
    background: rgba(71, 85, 105, 0.1) !important;
    color: #334155 !important;
    border: 1px solid rgba(71, 85, 105, 0.2) !important;
}

.day-view-notes {
    font-size: 13px;
    color: var(--cat-text, #4b5563) !important;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 12px;
    padding: 8px 12px;
    margin-top: 6px;
    line-height: 1.5;
    border-left: 3px solid var(--cat-border, var(--line));
}

.day-view-item .actions {
    display: flex;
    align-items: center;
}

.day-view-item .actions .edit-btn {
    background: #ffffff !important;
    border: 1px solid var(--cat-border, var(--line)) !important;
    color: var(--cat-text, var(--ink)) !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02) !important;
    padding: 8px 14px;
    font-size: 12px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.16s ease;
}

.day-view-item .actions .edit-btn:hover {
    background: var(--cat-accent, var(--green)) !important;
    color: #ffffff !important;
    border-color: var(--cat-accent, var(--green)) !important;
    transform: translateY(-1px);
}

@media (max-width: 780px) {
    .day-view-card.modal-card {
        padding: 20px 16px !important;
        margin: auto 0 0 0 !important;
        border-radius: 28px 28px 0 0 !important;
    }
    
    .day-view-item {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }
    
    .time-badge {
        width: fit-content;
    }
    
    .day-view-item .actions .edit-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   Overflow and Wrapping Fixes for Long Texts & Cards (v4_calendar_fit)
   ========================================================================== */

/* Calendar Day and Event List Shrinking Constraint */
.calendar-day {
    min-width: 0 !important;
    box-sizing: border-box !important;
}
.calendar-event-list {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Month View Activity Tags Wrapping and Overflow Control */
.month-activity-tag {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}
.month-activity-tag strong,
.month-activity-tag span {
    display: block !important;
    max-width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

/* List View (Sequential) Calendar Events Wrapping and Overflow Control */
.calendar-event {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}
.calendar-event span,
.calendar-event strong,
.calendar-event small,
.calendar-event em {
    display: block !important;
    max-width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

/* Day View Modal Cards Wrapping and Overflow Control */
.day-view-item {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
.day-view-item-content {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}
.day-view-item-content h4,
.day-view-item-content .location-row,
.day-view-item-content .inline-link,
.day-view-item-content .day-view-notes {
    display: block !important;
    max-width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}
.day-view-item-content .location-row {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}
.day-view-item-content .inline-link {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    width: fit-content !important;
}

/* Itinerary Timeline Cards Wrapping and Overflow Control */
.timeline-item {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}
.timeline-item > div {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}
.timeline-item strong,
.timeline-item p,
.timeline-item .inline-link,
.timeline-item .muted {
    white-space: normal !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
}

/* ==========================================================================
   Leaflet Maps Route Plotter split screen page (v6_leaflet_map)
   ========================================================================== */
.map-split-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    height: calc(100vh - 130px);
    margin-top: 10px;
}

.map-sidebar-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    height: 100%;
}

.map-sidebar-header {
    border-bottom: 1px solid var(--line);
    padding-bottom: 15px;
}

.map-sidebar-header h3 {
    margin: 6px 0 4px;
    font-size: 24px;
    color: var(--green-dark);
}

.map-day-selector select {
    margin-top: 6px;
}

.map-activities-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex-grow: 1;
}

.map-activity-card {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
    background: #fffdf8;
    box-shadow: 0 4px 12px rgba(32,49,40,0.02);
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 5px solid var(--cat-accent, var(--green));
    min-width: 0;
}

.map-activity-card:hover, .map-activity-card.active {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(10, 110, 77, 0.08);
    border-color: var(--cat-accent, var(--green));
}

.map-activity-card.active {
    background: var(--green-soft);
    border-color: var(--green) !important;
}

.map-activity-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.map-activity-time {
    font-size: 12px;
    font-weight: 800;
    color: var(--green);
    background: var(--green-soft);
    padding: 3px 8px;
    border-radius: 6px;
}

.map-activity-card h4 {
    margin: 4px 0 2px;
    font-size: 16px;
    line-height: 1.3;
}

.map-activity-card .location-row {
    font-size: 13px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

/* Custom DivIcon Badges for Leaflet */
.map-number-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 28px !important;
    height: 28px !important;
    border-radius: 99px;
    background: var(--cat-accent, var(--green)) !important;
    color: white !important;
    font-weight: 800 !important;
    font-size: 13px !important;
    border: 2px solid white !important;
    box-shadow: 0 3px 8px rgba(0,0,0,0.25) !important;
    text-align: center;
}

/* Manual geocode/coordinates override styling */
.map-warning-box {
    margin-top: 8px;
    background: var(--orange-soft);
    border: 1px solid rgba(244,178,59,0.3);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-warning-text {
    font-size: 12px;
    color: #9a5b00;
    font-weight: 600;
    margin: 0;
}

.map-search-form {
    display: flex;
    gap: 6px;
}

.map-search-form input {
    flex-grow: 1;
    font-size: 11px;
    padding: 6px 8px;
    border-radius: 8px;
    border: 1px solid rgba(244,178,59,0.4);
    outline: none;
    background: white;
}

.map-search-form .btn {
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 8px;
}

.map-canvas-panel {
    position: relative;
    height: 100%;
}

@media (max-width: 980px) {
    .map-split-container {
        grid-template-columns: 1fr;
        height: auto;
        gap: 15px;
    }
    
    .map-sidebar-panel {
        height: auto;
        max-height: 480px;
    }
    
    .map-canvas-panel {
        height: 380px;
    }
}

/* Dynamic Fading Toast Alert for quiet AJAX saves */
.map-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--ink);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}
.map-toast.visible {
    opacity: 1;
    transform: translateY(0);
}




/* Generic productization additions */
.trip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 18px;
}

.trip-card {
    display: grid;
    gap: 14px;
}

.trip-card.selected-trip {
    border-color: rgba(10, 110, 77, .45);
    box-shadow: 0 18px 50px rgba(10, 110, 77, .14);
}

.stats-row.compact-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.stats-row.compact-stats span {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 12px;
    background: #fffdf8;
    color: var(--muted);
}

.stats-row.compact-stats strong {
    color: var(--ink);
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    align-items: center;
}

.inline-actions form {
    margin: 0;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(36, 48, 41, .55);
    z-index: 999;
    display: none;
    place-items: center;
    padding: 22px;
}

.modal.visible {
    display: grid;
}

body.modal-open {
    overflow: hidden;
}

.modal-close {
    float: right;
    border: 0;
    background: var(--green-soft);
    color: var(--green);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
}

.wide-modal {
    width: min(860px, 100%);
}

.install-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.install-shell {
    width: min(980px, 100%);
}

.install-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.install-step {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fffdf8;
}

.install-step.ok { border-color: rgba(10,110,77,.35); background: var(--green-soft); }
.install-step.fail { border-color: rgba(180,35,24,.35); background: var(--red-soft); }

.check-inline {
    display: flex !important;
    gap: 10px;
    align-items: center;
}

.check-inline input[type="checkbox"] {
    width: auto;
}

/* Export and enhanced document management */
.doc-category-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.doc-category-card,
.document-health-row {
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.doc-category-card span,
.document-health-row span {
    color: var(--muted);
    font-size: 13px;
}

.doc-category-card strong,
.document-health-row strong {
    color: var(--green);
    font-size: 22px;
}

.documents-health-list,
.enhanced-documents-list {
    display: grid;
    gap: 12px;
}

.enhanced-document-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #fffdf8;
}

.document-main {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 12px;
}

.document-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--green-soft);
}

.document-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 9px 0;
}

.document-actions {
    max-width: 320px;
    justify-content: flex-end;
}

.document-actions form {
    margin: 0;
}

.export-hero .calendar-hero-actions {
    align-items: center;
}

.print-sheet {
    background: white;
}

.print-header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: start;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.print-header h1 {
    margin: 12px 0 5px;
    font-size: 38px;
}

.print-header p {
    margin: 0;
    color: var(--muted);
}

.print-meta {
    min-width: 160px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fffdf8;
    display: grid;
    gap: 5px;
}

.export-note {
    margin: 18px 0;
    padding: 16px;
    border-radius: 18px;
    background: var(--green-soft);
    color: var(--green);
    line-height: 1.6;
}

.export-day-block {
    margin-top: 22px;
    page-break-inside: avoid;
}

.export-day-title {
    border-left: 5px solid var(--green);
    padding: 12px 0 12px 16px;
    margin-bottom: 12px;
}

.export-day-title span {
    color: var(--green);
    font-weight: 700;
    font-size: 13px;
}

.export-day-title h2 {
    margin: 5px 0;
}

.export-day-title p {
    margin: 0;
    color: var(--muted);
}

.export-activity-list {
    display: grid;
    gap: 10px;
}

.export-activity-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 14px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fffdf8;
    page-break-inside: avoid;
}

.export-time {
    color: var(--green);
    font-weight: 700;
}

@media (max-width: 1180px) {
    .doc-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 780px) {
    .doc-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .enhanced-document-row,
    .print-header,
    .export-activity-row { grid-template-columns: 1fr; display: grid; }
    .document-actions { max-width: none; justify-content: stretch; }
}

@media print {
    body { background: white !important; }
    .sidebar,
    .topbar,
    .mobile-app-topbar,
    .sidebar-backdrop,
    .export-hero,
    .alert,
    .footer-gap { display: none !important; }
    .app-shell { display: block !important; min-height: auto !important; }
    .main { padding: 0 !important; max-width: none !important; }
    .card,
    .print-sheet { box-shadow: none !important; border: 0 !important; border-radius: 0 !important; }
    .card:hover { transform: none !important; }
    a { text-decoration: none !important; color: inherit !important; }
}

.brand-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: 6px;
}

.branding-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(255,255,255,.7));
    margin-top: 14px;
}

.branding-preview .brand-mark {
    background: var(--preview-color, var(--green));
}

.branding-preview img {
    width: 54px;
    height: 54px;
    object-fit: contain;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #fff;
    padding: 6px;
}

.branding-preview strong,
.branding-preview small {
    display: block;
}

.branding-preview small {
    color: var(--muted);
    margin-top: 4px;
}

.settings-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.settings-summary div {
    border: 1px solid var(--line);
    background: #fffdf8;
    border-radius: 16px;
    padding: 12px;
}

.settings-summary span,
.settings-summary strong {
    display: block;
}

.settings-summary span {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 5px;
}

.branding-remove-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .settings-grid {
        grid-template-columns: 1fr !important;
    }
    .settings-summary {
        grid-template-columns: 1fr;
    }
}


/* Demo mode / marketplace preview */
.demo-login-card {
    margin-top: 22px;
    padding: 18px;
    border: 1px solid rgba(10, 110, 77, .18);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(10,110,77,.08), rgba(13,181,167,.08));
}
.demo-login-card h3 {
    margin: 8px 0 4px;
}
.demo-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(10,110,77,.12);
    color: var(--green);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.demo-credentials {
    display: grid;
    gap: 10px;
    margin: 14px 0;
}
.demo-credentials div {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255,255,255,.7);
    border: 1px solid rgba(10,110,77,.12);
}
.demo-credentials span {
    display: block;
    font-size: 12px;
    color: #6b756d;
    margin-bottom: 3px;
}
.demo-credentials strong {
    color: #243029;
    word-break: break-all;
}
.btn-outline {
    background: transparent;
    color: var(--green);
    border: 1px solid rgba(10,110,77,.3);
}
.btn-outline:hover {
    background: rgba(10,110,77,.08);
}
.full {
    width: 100%;
}
.alert.demo {
    border-color: rgba(13,181,167,.25);
    background: rgba(13,181,167,.09);
    color: #075d54;
}
