:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

.center-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    text-align: center;
}

.login-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
    transition: all 0.2s;
    resize: vertical;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 8px;
    color: var(--text-main);
    font-family: inherit;
}

input:not([type="checkbox"]):not([type="radio"])::placeholder,
textarea::placeholder {
    color: rgba(148, 163, 184, 0.75);
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.22);
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.4rem;
    background-image:
        linear-gradient(45deg, transparent 50%, #c4b5fd 50%),
        linear-gradient(135deg, #c4b5fd 50%, transparent 50%);
    background-position:
        calc(100% - 18px) calc(50% - 2px),
        calc(100% - 12px) calc(50% - 2px);
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

select option {
    background: #111827;
    color: var(--text-main);
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

.btn-block {
    width: 100%;
}

.btn-small {
    padding: 0.45rem 0.75rem;
    font-size: 0.85rem;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert.error {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert.success {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Layout */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav-brand {
    font-size: 1.2rem;
    font-weight: 700;
    background: linear-gradient(to right, #818cf8, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

body.activity-mode .container {
    max-width: none;
    margin-top: 1rem;
}

body.planner-mode .container {
    max-width: 1500px;
    margin-top: 1rem;
}

.page-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Trip Cards */
.trip-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.trip-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.2s;
}

.trip-card:hover {
    transform: translateY(-5px);
}

.trip-card h3 {
    font-size: 1.4rem;
}

.trip-card p {
    color: var(--text-muted);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.tab {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.tab.active {
    color: white;
    background: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Packing List */
.category-section {
    margin-bottom: 2rem;
}

.category-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.packing-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.packing-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--glass-border);
    transition: all 0.2s;
}

.packing-item:hover {
    background: rgba(30, 41, 59, 0.8);
}

.packing-item.checked {
    opacity: 0.6;
}

.packing-item.checked .item-name {
    text-decoration: line-through;
}

.checkbox-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 2px solid var(--primary);
    margin-right: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-container.checked {
    background: var(--primary);
}

.checkbox-container svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}

.checkbox-container.checked svg {
    opacity: 1;
    transform: scale(1);
}

.item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.item-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.item-name {
    font-weight: 500;
    font-size: 1.05rem;
}

.item-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    color: #cbd5e1;
    font-weight: 500;
}

.badge.group {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

/* Documents */
.document-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.document-card {
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Activities */
.section-toolbar {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.section-subtitle {
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.toolbar-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.admin-status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 0.85rem;
    border-radius: 999px;
    color: #fcd34d;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.24);
    font-size: 0.86rem;
    font-weight: 700;
}

.activity-screen {
    min-height: calc(100vh - 170px);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.42);
}

.activity-screen.hidden {
    display: none;
}

.activity-topbar {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 3;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.swipe-stage {
    width: min(92vw, 460px);
    min-height: min(72vh, 640px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    isolation: isolate;
    transition: filter 0.15s ease;
}

.swipe-stage::before {
    content: "";
    position: absolute;
    inset: -18vh -18vw;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.16s ease, background 0.16s ease;
    pointer-events: none;
}

.swipe-stage.glow-yes::before {
    opacity: 1;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.34), transparent 62%);
}

.swipe-stage.glow-no::before {
    opacity: 1;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.32), transparent 62%);
}

.swipe-stage.glow-neutral::before {
    opacity: 1;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.34), transparent 62%);
}

.swipe-card {
    min-height: min(58vh, 520px);
    padding: 2rem;
    border-radius: 16px;
    background:
        linear-gradient(150deg, rgba(99, 102, 241, 0.28), rgba(16, 185, 129, 0.18)),
        rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.16);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    gap: 0.8rem;
    touch-action: none;
    user-select: none;
    cursor: grab;
    will-change: transform, opacity, filter;
    transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.swipe-enter {
    animation: swipeEnter 0.34s cubic-bezier(0.18, 0.9, 0.26, 1) both;
}

.swipe-out-yes {
    animation: swipeOutYes 0.36s cubic-bezier(0.18, 0.84, 0.44, 1) forwards;
}

.swipe-out-no {
    animation: swipeOutNo 0.36s cubic-bezier(0.18, 0.84, 0.44, 1) forwards;
}

.swipe-out-neutral {
    animation: swipeOutNeutral 0.36s cubic-bezier(0.18, 0.84, 0.44, 1) forwards;
}

@keyframes swipeEnter {
    from {
        opacity: 0;
        filter: blur(8px);
        transform: translateY(28px) scale(0.94);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
    }
}

@keyframes swipeOutYes {
    0% {
        opacity: 1;
        filter: blur(0);
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        filter: blur(10px);
        transform: translate(46vw, -8vh) rotate(18deg) scale(0.92);
    }
}

@keyframes swipeOutNo {
    0% {
        opacity: 1;
        filter: blur(0);
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        filter: blur(10px);
        transform: translate(-46vw, -8vh) rotate(-18deg) scale(0.92);
    }
}

@keyframes swipeOutNeutral {
    0% {
        opacity: 1;
        filter: blur(0);
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        filter: blur(10px);
        transform: translateY(-42vh) rotate(1deg) scale(0.9);
    }
}

.swipe-card h4 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.15;
}

.swipe-card p,
.activity-card p {
    color: var(--text-muted);
}

.activity-category {
    width: fit-content;
    max-width: 100%;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #c4b5fd;
    font-size: 0.78rem;
    font-weight: 700;
}

.vote-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.vote-button {
    min-height: 44px;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.activity-list-view {
    display: none;
}

.activity-list-view.active {
    display: block;
}

.vote-button.yes,
.vote-pill.yes {
    background: rgba(16, 185, 129, 0.22);
    color: #86efac;
}

.vote-button.no,
.vote-pill.no {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.vote-button.neutral,
.vote-pill.neutral {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
}

.activity-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.activity-card {
    min-height: 190px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.activity-card:hover {
    transform: translateY(-3px);
    background: rgba(30, 41, 59, 0.9);
}

.activity-card h3 {
    font-size: 1.1rem;
    line-height: 1.25;
    margin: 0.35rem 0;
}

.activity-card-main {
    flex: 1;
}

.activity-votes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.vote-pill {
    border-radius: 999px;
    padding: 0.18rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    border: 1px solid transparent;
    cursor: pointer;
}

.vote-pill.active {
    border-color: rgba(255, 255, 255, 0.7);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.activity-own-vote {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.activity-actions {
    margin-left: 0;
    justify-content: flex-end;
}

.activity-detail-meta {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.modal-wide {
    max-width: 860px;
}

.analysis-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.analysis-row {
    display: grid;
    grid-template-columns: 42px 1fr minmax(180px, auto);
    gap: 1rem;
    align-items: center;
    padding: 0.85rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid var(--glass-border);
}

.analysis-rank,
.wanted-rank {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.22);
    color: #c4b5fd;
    font-weight: 800;
}

.analysis-main {
    min-width: 0;
}

.analysis-main strong,
.wanted-item strong {
    display: block;
    line-height: 1.25;
}

.analysis-main span,
.analysis-numbers span,
.analysis-numbers small,
.wanted-item small {
    display: block;
    color: var(--text-muted);
    font-size: 0.82rem;
}

.analysis-bar {
    height: 6px;
    margin-top: 0.55rem;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.analysis-bar span {
    height: 100%;
    display: block;
    border-radius: inherit;
    background: var(--success);
}

.analysis-numbers {
    text-align: right;
}

.planning-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.planning-stat {
    padding: 1rem;
}

.planning-stat span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.planning-stat strong {
    display: block;
    font-size: 1.6rem;
    line-height: 1.2;
}

.planner-subnav {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    margin: 0 0 1rem;
    padding-bottom: 0.25rem;
}

.planner-subtab {
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-muted);
    border-radius: 8px;
    padding: 0.65rem 0.95rem;
    cursor: pointer;
    font-weight: 700;
    white-space: nowrap;
}

.planner-subtab.active {
    background: var(--primary);
    color: white;
}

.planner-view {
    display: none;
}

.planner-view.active {
    display: block;
}

.workbench-shell,
.full-day-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.workbench-header,
.full-day-header,
.days-overview-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
}

.workbench-header h3,
.full-day-header h3,
.days-overview-header h3 {
    margin: 0.15rem 0 0.25rem;
}

.day-nav-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
}

.planner-move-hint {
    display: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.12);
    color: var(--text-main);
    font-weight: 700;
}

.planner-move-hint.active {
    display: block;
}

.planner-workbench {
    display: grid;
    grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.workbench-day,
.workbench-pool,
.full-day-panel {
    padding: 1rem;
}

.section-mini-title {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: baseline;
    margin-bottom: 0.85rem;
}

.section-mini-title span {
    color: var(--text-muted);
    font-size: 0.84rem;
}

.day-slot-stack,
.full-day-slots {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.activity-pool-filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(140px, 180px));
    gap: 0.6rem;
    margin-bottom: 0.65rem;
}

.activity-pool-filters input,
.activity-pool-filters select {
    min-height: 42px;
    width: 100%;
}

.unplan-dropzone {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin: 0.65rem 0 0.85rem;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    border: 1px dashed rgba(248, 113, 113, 0.45);
    background: rgba(127, 29, 29, 0.15);
    color: #fecaca;
}

.unplan-dropzone span {
    color: rgba(254, 202, 202, 0.78);
    font-size: 0.84rem;
}

.unplan-dropzone.drag-over {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(248, 113, 113, 0.9);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.activity-pool {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
    max-height: 68vh;
    overflow: auto;
    padding-right: 0.2rem;
}

.pool-card {
    cursor: pointer;
}

.pool-card p {
    margin: 0.45rem 0 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.planner-draggable[draggable="true"] {
    cursor: grab;
}

.planner-draggable[draggable="true"]:active {
    cursor: grabbing;
}

.days-overview-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-topline {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
}

.card-topline span {
    flex: 0 0 auto;
    color: #c4b5fd;
    font-weight: 800;
}

.today-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) 360px;
    gap: 1rem;
}

.today-main,
.today-side,
.history-panel {
    padding: 1rem;
}

.today-header,
.day-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.today-timeline,
.nearby-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.travel-card {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: center;
    padding: 0.9rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid var(--glass-border);
}

.travel-card h4 {
    margin: 0 0 0.2rem;
}

.travel-card p {
    color: var(--text-muted);
}

.travel-card-time {
    color: #c4b5fd;
    font-weight: 900;
}

.travel-tags,
.quick-filters,
.weather-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.55rem;
}

.weather-strip {
    margin-bottom: 1rem;
}

.weather-card {
    min-width: 150px;
    padding: 0.75rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
}

.weather-card span,
.weather-card small {
    display: block;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.quick-filters {
    margin-bottom: 1rem;
}

.quick-filters button {
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    cursor: pointer;
}

.nearby-card,
.pool-card,
.day-card,
.map-spot,
.revision-row {
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.55);
    color: var(--text-main);
    border-radius: 10px;
    padding: 0.8rem;
}

.nearby-card span,
.nearby-card small,
.pool-card span,
.pool-card small,
.day-card span,
.day-card small,
.map-spot span,
.revision-row span {
    display: block;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.nearby-card.hidden {
    display: none;
}

.day-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.day-column {
    padding: 1rem;
    min-height: 220px;
}

.day-column h3 {
    margin: 0;
}

.empty-day {
    color: var(--text-muted);
    border: 1px dashed var(--glass-border);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.empty-day.small {
    padding: 0.55rem;
    font-size: 0.82rem;
}

.day-slot {
    min-height: 86px;
    padding: 0.7rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 0.75rem;
}

.day-slot h4 {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-bottom: 0.55rem;
    text-transform: uppercase;
}

.day-slot h4 span {
    color: var(--text-main);
}

.day-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.45rem;
}

.slot-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.day-slot-full {
    min-height: 130px;
}

.day-slot-full .slot-card-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.day-slot.drag-over {
    outline: 2px solid var(--primary);
    background: rgba(99, 102, 241, 0.14);
}

.day-slot.select-target {
    outline: 2px dashed var(--warning);
    background: rgba(245, 158, 11, 0.12);
}

.day-move-btn {
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    border-radius: 6px;
    padding: 0.28rem 0.5rem;
    cursor: pointer;
}

.day-move-btn.danger-soft {
    border-color: rgba(248, 113, 113, 0.35);
    color: #fecaca;
    background: rgba(127, 29, 29, 0.2);
}

.planner-map-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 1rem;
}

.map-list {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 75vh;
    overflow: auto;
}

.map-spot {
    text-align: left;
    cursor: pointer;
}

.map-frame {
    min-height: 72vh;
    overflow: hidden;
}

#plannerLeafletMap {
    width: 100%;
    height: 72vh;
    min-height: 520px;
    border-radius: inherit;
    overflow: hidden;
}

.weather-toolbar-inline {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin: 0.75rem 0;
}

.revision-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.revision-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.planning-settings {
    padding: 1rem;
    margin-bottom: 1rem;
}

.planner-menu,
.ai-planner {
    padding: 0;
    margin-bottom: 1rem;
    overflow: hidden;
}

.planner-menu summary,
.ai-planner summary {
    list-style: none;
    cursor: pointer;
    padding: 1rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px solid transparent;
}

.planner-menu summary::-webkit-details-marker,
.ai-planner summary::-webkit-details-marker {
    display: none;
}

.planner-menu summary span,
.ai-planner summary span {
    font-weight: 800;
}

.planner-menu summary small,
.ai-planner summary small {
    color: var(--text-muted);
}

.planner-menu[open] summary,
.ai-planner[open] summary {
    border-bottom-color: var(--glass-border);
}

.planner-menu .planning-settings,
.ai-planner > :not(summary) {
    margin: 0;
    padding: 1rem;
}

.planner-settings-grid,
.ai-planner-header {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.ai-planner-header {
    grid-template-columns: 1fr minmax(180px, 240px);
    align-items: start;
    margin-bottom: 1rem;
}

.provider-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.badge.configured {
    background: rgba(16, 185, 129, 0.18);
    color: #86efac;
}

.env-hint {
    display: inline-block;
    margin-top: 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    white-space: normal;
}

.ai-key-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    align-items: end;
}

.ai-key-grid .form-group {
    margin-bottom: 0;
}

.ai-key-grid .btn {
    width: 100%;
}

.ai-explain {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
}

.ai-explain strong {
    color: var(--text-main);
}

.ai-output {
    min-height: 160px;
    max-height: 420px;
    overflow: auto;
    white-space: pre-wrap;
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    font-family: inherit;
    line-height: 1.55;
}

.ai-output:empty {
    display: none;
}

.ai-suggestions {
    margin-top: 1rem;
}

.ai-summary,
.ai-day-card,
.ai-alt {
    border: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.55);
    border-radius: 10px;
    padding: 0.9rem;
}

.ai-summary {
    margin-bottom: 1rem;
    color: var(--text-main);
    font-weight: 700;
}

.ai-day-grid,
.ai-alt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ai-item {
    padding: 0.65rem 0;
    border-top: 1px solid var(--glass-border);
}

.ai-item:first-of-type {
    border-top: none;
}

.ai-item span,
.ai-item small,
.ai-alt span,
.ai-alt small {
    display: block;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.planner-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.planner-panel {
    padding: 1rem;
    position: sticky;
    top: 90px;
}

.planner-panel h3 {
    margin-bottom: 1rem;
}

.wanted-item {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 0.75rem;
    align-items: start;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--glass-border);
}

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

.planner-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.planner-row {
    padding: 1rem;
    display: block;
}

.planner-activity {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: start;
}

.planner-activity h3 {
    font-size: 1.05rem;
    line-height: 1.25;
    margin: 0.5rem 0 0.25rem;
}

.planner-activity p {
    color: var(--text-muted);
}

.planner-votes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.planner-card-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}

.planner-card-actions .btn {
    padding: 0.55rem 0.9rem;
}

.planner-controls {
    display: none;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 0.75rem;
    align-items: end;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.planner-row.expanded .planner-controls {
    display: grid;
}

.planner-controls .form-group {
    margin-bottom: 0;
}

.form-group.compact label {
    font-size: 0.78rem;
}

.form-group.wide {
    grid-column: span 2;
}

.checkbox-field input {
    width: 22px;
    height: 22px;
}

.time-tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.time-tag-grid label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    margin: 0;
}

.time-tag-grid input {
    width: auto;
}

.empty-state {
    min-height: 180px;
    border-radius: 12px;
    border: 1px dashed var(--glass-border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
}

.swipe-empty {
    min-height: 360px;
    background: rgba(30, 41, 59, 0.55);
}

.doc-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #818cf8;
}

.doc-info {
    flex: 1;
    overflow: hidden;
}

.doc-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: white;
}

/* Actions */
.item-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: all 0.2s;
    opacity: 0.7;
}

.btn-icon:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.text-danger {
    color: #ef4444;
}

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

@media (max-width: 640px) {
    .navbar {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
        padding: 1rem;
    }
    
    .nav-user {
        flex-wrap: wrap;
        justify-content: center;
    }

    .login-container {
        padding: 1.5rem;
    }

    .tabs {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.5rem;
        scrollbar-width: none; /* Firefox */
    }
    .tabs::-webkit-scrollbar {
        display: none; /* Chrome/Safari/Edge */
    }

    .packing-item {
        flex-wrap: wrap;
        padding: 0.75rem;
    }

    .checkbox-container {
        margin-right: 0.75rem;
        flex-shrink: 0;
    }

    .item-details {
        width: calc(100% - 3rem);
    }

    .item-header {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    .item-name {
        width: 100%;
    }

    .item-actions {
        width: 100%;
        margin-left: 0;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        justify-content: flex-end;
    }

    .document-card {
        flex-wrap: wrap;
    }
    
    .document-card .item-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 0.5rem;
    }

    .modal {
        padding: 1.5rem;
        max-height: 90vh;
        overflow-y: auto;
    }

    .section-toolbar {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .activity-screen {
        min-height: calc(100vh - 210px);
        border-radius: 12px;
    }

    .activity-topbar {
        left: 1rem;
        right: 1rem;
    }

    .activity-topbar .btn {
        flex: 1;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .swipe-card {
        min-height: min(54vh, 480px);
        padding: 1.5rem;
    }

    .swipe-stage {
        width: 100%;
        padding: 0 0.75rem;
    }

    .activity-list {
        display: flex;
        flex-direction: column;
    }

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

    .planner-layout,
    .planner-row,
    .analysis-row,
    .planner-settings-grid,
    .ai-planner-header,
    .ai-key-grid,
    .today-grid,
    .planner-workbench,
    .workbench-header,
    .full-day-header,
    .days-overview-header,
    .activity-pool-filters,
    .planner-map-layout,
    .travel-card,
    .revision-row {
        display: flex;
        flex-direction: column;
    }

    .day-board {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
    }

    .day-column {
        min-width: 82vw;
        scroll-snap-align: start;
    }

    .map-frame,
    #plannerLeafletMap {
        min-height: 420px;
        height: 420px;
    }

    .planner-panel {
        position: static;
    }

    .planner-controls {
        grid-template-columns: 1fr;
    }

    .activity-pool {
        max-height: none;
    }

    .form-group.wide {
        grid-column: auto;
    }

    .analysis-numbers {
        text-align: left;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
