:root {
    --primary-color: #e31e24;
    /* Sargam Red */
    --primary-hover: #c4191e;
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.08);
    --glass-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --danger: #ef4444;
    --success: #10b981;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Professional Card Utility */
.glass-effect {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: var(--glass-shadow);
}

/* Messages */
.messages-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 350px;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.alert-error {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.alert-info {
    background: rgba(59, 130, 246, 0.9);
    color: white;
}

.close-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

/* =============================================
   Login Page
   ============================================= */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-glass-panel {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h2 {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: -1px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 14px;
}

/* =============================================
   Centered Form Page Layout
   (Used by Add Staff / Add Event / Add Viewer)
   ============================================= */
.form-page-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 70px);
    /* subtract top-navbar height */
    padding: 32px 16px;
}

/* ---- Form Card ---- */
.form-card {
    width: 100%;
    max-width: 560px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    animation: formFadeIn 0.4s ease forwards;
}

@keyframes formFadeIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

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

/* ---- Card Header ---- */
.form-card-header {
    padding: 28px 36px 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg,
            rgba(227, 30, 36, 0.05) 0%,
            rgba(227, 30, 36, 0.02) 100%);
    display: flex;
    align-items: center;
    gap: 16px;
}

.form-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #e31e24, #c4191e);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    color: white;
    box-shadow: 0 6px 20px rgba(227, 30, 36, 0.2);
}

.form-card-title {
    flex: 1;
}

.form-card-title h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.form-card-title p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ---- Card Body ---- */
.form-card-body {
    padding: 28px 36px 32px;
}

/* ---- Form Group (shared) ---- */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-size: 11.5px;
}

/* Override Django-rendered inputs inside .form-card-body */
.form-card-body input,
.form-card-body select,
.form-card-body textarea {
    width: 100%;
    padding: 11px 14px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background-color: #ffffff;
    color: var(--text-main);
    font-size: 14.5px;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
    outline: none;
}

.form-card-body input:focus,
.form-card-body select:focus,
.form-card-body textarea:focus {
    border-color: var(--primary-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(227, 30, 36, 0.08);
}

.form-card-body input::placeholder,
.form-card-body textarea::placeholder {
    color: #94a3b8;
}

/* Date and Time Picker styling */
.form-card-body input[type="date"],
.form-card-body input[type="time"],
.form-card-body input.flatpickr-input {
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
}

/* Invert the calendar and clock icons so they are visible on dark background */
.form-card-body input[type="date"]::-webkit-calendar-picker-indicator,
.form-card-body input[type="time"]::-webkit-calendar-picker-indicator {
    opacity: 0.6;
    cursor: pointer;
    transition: all 0.25s ease;
}

.form-card-body input[type="date"]::-webkit-calendar-picker-indicator:hover,
.form-card-body input[type="time"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    transform: scale(1.1);
}


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

/* ---- Field error / helper text ---- */
.field-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-muted);
}

.field-error {
    display: block;
    margin-top: 5px;
    font-size: 12.5px;
    color: var(--danger);
}

/* ---- Form Action Bar ---- */
.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
}

.form-actions .btn-primary {
    flex: 1;
    padding: 12px 20px;
    margin-top: 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
    background: linear-gradient(135deg, #e31e24, #c4191e);
    border: none;
    color: white;
    cursor: pointer;
    transition: opacity 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 18px rgba(227, 30, 36, 0.2);
}

.form-actions .btn-primary:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(227, 30, 36, 0.35);
}

.form-actions .btn-primary:active {
    transform: translateY(0);
}

.form-actions .btn-cancel {
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    cursor: pointer;
    white-space: nowrap;
}

.form-actions .btn-cancel:hover {
    background: #e2e8f0;
    color: var(--text-main);
    border-color: #cbd5e1;
}

.field-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-muted);
}

.field-error {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--danger);
    font-weight: 500;
}



.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: var(--text-main);
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(227, 30, 36, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--primary-color);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 10px;
}

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

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    background: #ffffff;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-brand h2 {
    font-size: 22px;
    color: var(--text-main);
    font-weight: 800;
}

.sidebar-brand span {
    color: var(--primary-color);
}

.sidebar-menu {
    list-style: none;
    padding: 20px 0;
    flex: 1;
    overflow-y: auto;
}

.menu-header {
    padding: 10px 24px;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 1px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.sidebar-menu li a:hover,
.sidebar-menu li.active a {
    opacity: 1;
    background: rgba(227, 30, 36, 0.05);
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.user-info p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.btn-logout {
    display: block;
    text-align: center;
    padding: 8px;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

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

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
    /* prevents flex child from overflowing */
}

.top-navbar {
    height: 70px;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: #ffffff;
    border-radius: 0;
}

.navbar-left h3 {
    color: var(--text-main);
    font-weight: 700;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 20px;
    cursor: pointer;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    background: #fff;
}

.content-wrapper {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 24px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

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

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(227, 30, 36, 0.1);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-details p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-details h3 {
    font-size: 28px;
    font-weight: 700;
}

/* Dashboard Sections */
.dashboard-sections {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.dashboard-panel {
    border-radius: 16px;
    overflow: hidden;
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-body {
    padding: 24px;
}

/* =============================================
   Action Buttons (Edit / Delete / etc.)
   ============================================= */
.btn-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    line-height: 1;
    vertical-align: middle;
    user-select: none;
}

.btn-sm:hover {
    transform: translateY(-2px);
    opacity: 0.93;
}

.btn-sm:active {
    transform: translateY(0);
    opacity: 1;
}

/* Professional Blue — Edit */
.btn-edit {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    color: white !important;
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.35);
}

.btn-edit:hover {
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.5);
}

/* WhatsApp Green */
.btn-whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E) !important;
    color: white !important;
    box-shadow: 0 3px 10px rgba(37, 211, 102, 0.35);
}

.btn-whatsapp:hover {
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.5);
}


/* Professional Red — Delete */
.btn-delete {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: white !important;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.35);
}

.btn-delete:hover {
    box-shadow: 0 6px 18px rgba(239, 68, 68, 0.5);
}

/* Table Actions cell — always a flex row, never stacks */
/* Table Actions container - use inline-flex for perfect alignment inside standard table cells */
.table-actions {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
}

.panel-body td:last-child {
    white-space: nowrap;
}

.activity-list {
    list-style: none;
}

.activity-list li {
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
}

.activity-list li:last-child {
    border-bottom: none;
}

.activity-list .time {
    color: var(--text-muted);
    font-size: 12px;
}

/* Seating Map */
.seating-map-container {
    background: var(--bg-card);
    padding: 30px;
    border-radius: 12px;
    margin-top: 30px;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.seating-map-inner {
    min-width: max-content;
}

.stage {
    background: #f8fafc;
    color: var(--text-main);
    text-align: center;
    padding: 15px;
    margin-bottom: 40px;
    border-radius: 4px;
    font-weight: bold;
    border-bottom: 3px solid var(--primary-color);
    letter-spacing: 5px;
    text-transform: uppercase;
}

.seat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    gap: 20px;
}

.row-label {
    width: 40px;
    flex-shrink: 0;
    color: var(--primary-color);
    font-weight: bold;
    text-align: right;
    font-size: 16px;
}

.seat-wrapper {
    display: grid;
    flex-grow: 1;
    grid-template-columns: 1fr 30px auto 30px 1fr;
    align-items: center;
}

.seat-section {
    display: flex;
    gap: 6px;
}

.seat-section.left {
    justify-content: flex-end;
}

.seat-section.center {
    justify-content: center;
}

.seat-section.right {
    justify-content: flex-start;
}

.seat {
    width: 32px;
    height: 32px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px 6px 2px 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    font-size: 11px;
    transition: all 0.2s;
    cursor: default;
}

.seat:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-hover);
    transform: scale(1.1);
}

.aisle {
    width: 30px;
}

.row-actions {
    width: 160px;
    flex-shrink: 0;
    display: flex;
    gap: 5px;
    justify-content: flex-start;
}

/* Responsive Layouts */
@media (max-width: 1024px) {
    .seat {
        width: 28px;
        height: 28px;
        font-size: 10px;
    }

    .aisle {
        width: 20px;
    }

    .seat-wrapper {
        grid-template-columns: 1fr 20px auto 20px 1fr;
    }

    .row-label {
        width: 30px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .seat {
        width: 24px;
        height: 24px;
        font-size: 9px;
        border-radius: 4px 4px 1px 1px;
    }

    .aisle {
        width: 15px;
    }

    .seat-wrapper {
        grid-template-columns: 1fr 15px auto 15px 1fr;
    }

    .seat-section {
        gap: 4px;
    }

    .row-actions {
        width: 140px;
    }
}

@media (max-width: 480px) {
    .seat {
        width: 20px;
        height: 20px;
        font-size: 8px;
    }

    .aisle {
        width: 10px;
    }

    .seat-wrapper {
        grid-template-columns: 1fr 10px auto 10px 1fr;
    }

    .seat-section {
        gap: 3px;
    }

    .row-label {
        width: 25px;
        font-size: 12px;
    }

    .row-actions {
        width: 120px;
    }

    .btn-sm {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* =============================================
   Flatpickr Custom Theme Overrides 
   ============================================= */
.flatpickr-calendar {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
    border-radius: 12px !important;
    color: var(--text-main) !important;
}

.flatpickr-day {
    color: var(--text-main) !important;
}

.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: rgba(30, 41, 59, 0.1) !important;
}

.flatpickr-months .flatpickr-month,
.flatpickr-current-month,
.flatpickr-current-month input.cur-year {
    color: var(--text-main) !important;
    fill: var(--text-main) !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange,
.flatpickr-day.selected.inRange,
.flatpickr-day.startRange.inRange,
.flatpickr-day.endRange.inRange,
.flatpickr-day.selected:focus,
.flatpickr-day.startRange:focus,
.flatpickr-day.endRange:focus,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange:hover,
.flatpickr-day.endRange:hover,
.flatpickr-day.selected.prevMonthDay,
.flatpickr-day.startRange.prevMonthDay,
.flatpickr-day.endRange.prevMonthDay,
.flatpickr-day.selected.nextMonthDay,
.flatpickr-day.startRange.nextMonthDay,
.flatpickr-day.endRange.nextMonthDay {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #fff !important;
}

.flatpickr-time input:hover,
.flatpickr-time .flatpickr-am-pm:hover,
.flatpickr-time input:focus,
.flatpickr-time .flatpickr-am-pm:focus {
    background: rgba(227, 30, 36, 0.1) !important;
}

.flatpickr-time input,
.flatpickr-time .flatpickr-time-separator,
.flatpickr-time .flatpickr-am-pm {
    color: var(--text-main) !important;
}

.flatpickr-months .flatpickr-month {
    background: #fff !important;
    color: var(--text-main) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: #fff !important;
    color: var(--text-main) !important;
    font-family: inherit !important;
    font-weight: 600 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    background: #f1f5f9 !important;
}

/* Custom premium styles for Flatpickr navigation arrows */
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: var(--text-main) !important;
    fill: var(--text-main) !important;
    padding: 10px !important;
    transition: color 0.2s ease;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    color: var(--primary-color) !important;
}

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
    fill: currentColor !important;
}

span.flatpickr-weekday {
    background: #fff !important;
    color: var(--text-muted) !important;
    font-weight: 600 !important;
}

/* =============================================
   Choices.js Custom Theme Overrides (Modern Dropdown)
   ============================================= */
.choices {
    margin-bottom: 0;
}

/* The main input box */
.choices__inner {
    width: 100%;
    padding: 11px 14px !important;
    min-height: unset;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background-color: #ffffff !important;
    color: var(--text-main);
    font-size: 15px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

.is-focused .choices__inner,
.is-open .choices__inner {
    border-color: var(--primary-color);
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(227, 30, 36, 0.1);
}

/* The selected item text */
.choices__list--single {
    padding: 0 !important;
    text-align: left;
    /* Center align selected text as requested */
}

.choices__list--single .choices__item {
    color: var(--text-main);
    opacity: 1;
}

/* The dropdown container */
.choices__list--dropdown {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1) !important;
    border-radius: 12px !important;
    margin-top: 8px !important;
    padding: 8px !important;
    overflow-y: auto !important;
    z-index: 100;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.choices__list--dropdown::-webkit-scrollbar,
.choices__list--dropdown .choices__list::-webkit-scrollbar {
    display: none;
}

.choices__list--dropdown .choices__list {
    padding: 0;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

/* Individual options in the dropdown */
.choices__list--dropdown .choices__item {
    padding: 12px 16px !important;
    font-size: 14.5px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    letter-spacing: 0.5px;
    color: var(--text-main);
    text-align: left;
    border-radius: 8px !important;
    margin-bottom: 4px;
    transition: all 0.25s ease !important;
}

.choices__list--dropdown .choices__item:last-child {
    margin-bottom: 0;
}

/* Hover state for options */
.choices__list--dropdown .choices__item--selectable.is-highlighted {
    background: var(--primary-color) !important;
    color: #ffffff !important;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(227, 30, 36, 0.2);
}

/* Hide the empty Django choice completely from the dropdown */
.choices__list--dropdown .choices__item[data-value=""] {
    display: none !important;
}

/* Custom arrow to match theme */
.choices[data-type*="select-one"]::after {
    height: 8px;
    width: 8px;
    border-style: solid;
    border-color: #94a3b8 transparent transparent transparent;
    border-width: 5px 5px 0 5px;
    margin-top: -2.5px;
    right: 18px;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.choices[data-type*="select-one"].is-open::after {
    border-color: transparent transparent var(--primary-color) transparent;
    border-width: 0 5px 5px 5px;
    margin-top: -2.5px;
}

/* =============================================
   RESPONSIVE — Full Layout (all breakpoints)
   ============================================= */

/* ── 1024 px and below (laptop / tablet landscape) ── */
@media (max-width: 1024px) {

    /* Sidebar stays visible but we tighten it */
    .sidebar {
        width: 220px;
    }

    /* Ensure content can shrink without overflow */
    .main-content {
        min-width: 0;
        overflow: hidden;
    }

    .content-wrapper {
        padding: 18px;
        overflow-x: hidden;
        min-width: 0;
    }

    /* --- Tables: horizontally scrollable at 1024px --- */
    .panel-body {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .panel-body>table,
    .panel-body>div>table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    /* Slightly tighten cell padding */
    .panel-body table th,
    .panel-body table td {
        padding: 10px 12px !important;
        font-size: 13.5px;
    }

    /* Tighten action buttons */
    .btn-sm {
        padding: 5px 10px;
        font-size: 12.5px;
    }

    /* Stats grid: 2 columns */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    /* Sidebar brand slightly smaller */
    .sidebar-brand h2 {
        font-size: 19px;
    }
}

/* ── 768 px and below ── */
@media (max-width: 768px) {

    /* --- Dashboard Layout --- */
    .dashboard-layout {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        position: relative;
    }

    /* --- Sidebar overlay --- */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 260px;
        height: 100%;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
    }

    /* Dim overlay behind open sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    /* --- Main content fills full width --- */
    .main-content {
        width: 100%;
        min-height: 100vh;
        overflow: visible;
    }

    /* --- Top navbar --- */
    .top-navbar {
        height: 60px;
        padding: 0 16px;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .navbar-left h3 {
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
    }

    .avatar {
        width: 34px;
        height: 34px;
    }

    /* --- Content wrapper --- */
    .content-wrapper {
        padding: 16px;
        overflow: visible;
    }

    /* --- Stats grid: 2 columns on tablet --- */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        margin-bottom: 20px;
    }

    .stat-card {
        padding: 16px;
        gap: 14px;
    }

    .stat-details h3 {
        font-size: 22px;
    }

    /* --- Panel header: stack title + button vertically --- */
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 16px;
    }

    .panel-header h4 {
        font-size: 15px;
    }

    /* Make the "Add" buttons full width on mobile */
    .panel-header .btn-primary {
        width: 100% !important;
        text-align: center;
        padding: 10px 16px !important;
    }

    /* --- Panel body --- */
    .panel-body {
        padding: 0;
    }

    /* --- Tables: horizontally scrollable --- */
    .panel-body>table,
    .panel-body>div>table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    /* Tighten table cells */
    .panel-body table th,
    .panel-body table td {
        padding: 10px 10px !important;
        font-size: 13px;
    }

    /* --- Action buttons in tables --- */
    .btn-sm {
        padding: 5px 9px;
        font-size: 12px;
    }

    /* --- Activity list --- */
    .activity-list li {
        flex-direction: column;
        gap: 4px;
        font-size: 13px;
    }

    .activity-list .time {
        font-size: 11px;
    }

    /* --- Form page --- */
    .form-page-wrapper {
        padding: 20px 12px;
        min-height: calc(100vh - 60px);
    }

    .form-card {
        border-radius: 14px;
    }

    .form-card-header {
        padding: 20px 20px 16px;
    }

    .form-card-body {
        padding: 20px 20px 24px;
    }

    .form-card-title h2 {
        font-size: 17px;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions .btn-cancel {
        order: 2;
    }

    /* --- Login --- */
    .login-glass-panel {
        padding: 28px 22px;
    }

    .login-header h2 {
        font-size: 22px;
    }

    /* --- Messages toast --- */
    .messages-container {
        top: 70px;
        right: 12px;
        left: 12px;
        max-width: 100%;
    }
}

/* ── 600 px and below ── */
@media (max-width: 600px) {

    /* Stats grid: single column */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 14px 16px;
    }

    /* Navbar title shorter */
    .navbar-left h3 {
        font-size: 14px;
        max-width: 130px;
    }

    /* Panel header button: keep compact */
    .panel-header .btn-primary {
        font-size: 13px;
        padding: 9px 14px !important;
    }

    /* Table cells even tighter */
    .panel-body table th,
    .panel-body table td {
        padding: 9px 8px !important;
        font-size: 12px;
    }

    /* Action buttons stack if needed */
    .table-actions {
        flex-wrap: wrap;
        gap: 5px;
    }

    .form-card-header {
        padding: 16px;
        gap: 12px;
    }

    .form-card-body {
        padding: 16px;
    }

    .form-card-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* ── 480 px and below ── */
@media (max-width: 480px) {

    /* Top navbar very compact */
    .top-navbar {
        height: 54px;
        padding: 0 12px;
    }

    .navbar-left h3 {
        font-size: 13px;
        max-width: 110px;
    }

    .btn-icon {
        font-size: 18px;
    }

    .avatar {
        width: 30px;
        height: 30px;
    }

    /* Content wrapper */
    .content-wrapper {
        padding: 12px;
    }

    /* Panel header */
    .panel-header {
        padding: 12px;
        gap: 8px;
    }

    /* Table font even smaller */
    .panel-body table th,
    .panel-body table td {
        padding: 8px 7px !important;
        font-size: 11.5px;
    }

    /* Form card */
    .form-card-header {
        padding: 14px;
    }

    .form-card-body {
        padding: 14px;
    }

    .form-card-title h2 {
        font-size: 15px;
    }

    .form-card-title p {
        font-size: 12px;
    }

    /* Login */
    .login-glass-panel {
        padding: 22px 16px;
    }

    .login-header h2 {
        font-size: 20px;
    }
}

/* =============================================
   Premium Cohesive Buttons & Allocation Layout
   ============================================= */

/* Allocation Actions Header Container */
.allocation-actions-bar {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.allocation-left-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.allocation-form {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
}

.allocation-timestamp {
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
}

/* Premium Buttons System */
.btn-premium {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    line-height: 1.2;
    user-select: none;
}

.btn-premium:hover {
    transform: translateY(-1.5px);
}

.btn-premium:active {
    transform: translateY(0);
}

/* Primary Premium Button (Red Gradient) */
.btn-premium-primary {
    background: linear-gradient(135deg, #e31e24, #c4191e);
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(227, 30, 36, 0.25);
}

.btn-premium-primary:hover {
    background: linear-gradient(135deg, #ef2d33, #d31b20);
    box-shadow: 0 6px 20px rgba(227, 30, 36, 0.38);
}

/* Dark Premium Button (Seat View) */
.btn-premium-dark {
    background: #0f172a;
    color: #f8fafc !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.btn-premium-dark:hover {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
}

/* Disabled Premium Button */
.btn-premium-disabled {
    background: #cbd5e1 !important;
    color: #64748b !important;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none !important;
}

.btn-premium-disabled:hover {
    transform: none !important;
}

/* Premium Allocation Dropdown styling */
.allocation-dropdown {
    position: relative;
    display: inline-block;
}

.allocation-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    min-width: 220px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
    padding: 6px 0;
    backdrop-filter: blur(10px);
    animation: dropdownFadeIn 0.2s ease;
}

.allocation-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.allocation-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.allocation-dropdown-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin: 4px 0;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

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

/* Responsive Overrides for Premium Components */
@media (max-width: 768px) {
    .allocation-actions-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .allocation-left-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        width: 100%;
    }

    .allocation-form {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }

    .allocation-form .btn-premium {
        width: 100%;
    }

    .allocation-timestamp {
        text-align: center;
        margin-left: 0 !important;
        margin-top: 4px;
    }

    .allocation-dropdown {
        width: 100%;
    }

    .allocation-dropdown-btn {
        width: 100% !important;
        justify-content: center;
    }

    .btn-premium-dark {
        width: 100%;
    }
}

/* =============================================
   Premium Seat View & Controls Layout
   ============================================= */

/* Seat View Body Padding */
.seat-view-body {
    padding: 30px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Header layout */
.seat-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
}

.seat-view-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.seat-view-right {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

/* Seating View Legend */
.seat-view-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.seat-view-legend-item {
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    color: var(--text-main);
}

.seat-view-legend-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 3px;
    margin-right: 6px;
}

/* Premium Download Button */
.btn-download-seating {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 18px;
    background: linear-gradient(135deg, #e31e24, #c4191e);
    color: #ffffff !important;
    font-size: 13.5px;
    font-weight: 700;
    border-radius: 20px;
    text-decoration: none;
    border: none;
    box-shadow: 0 4px 12px rgba(227, 30, 36, 0.2);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    white-space: nowrap;
}

.btn-download-seating:hover {
    transform: translateY(-1.5px);
    box-shadow: 0 6px 18px rgba(227, 30, 36, 0.35);
    background: linear-gradient(135deg, #ef2d33, #d31b20);
}

.btn-download-seating:active {
    transform: translateY(0);
}

/* Seating Layout Row Container wrapper */
.seat-row-wrapper {
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 800px;
    padding-bottom: 20px;
}

/* Responsive Rules for Seat View */
@media (max-width: 768px) {
    .seat-view-body {
        padding: 16px 12px !important;
    }

    .seat-view-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .seat-view-left {
        width: 100%;
        justify-content: space-between;
    }

    .seat-view-right {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .seat-view-legend {
        justify-content: center;
        gap: 12px;
        background: rgba(0, 0, 0, 0.02);
        padding: 10px;
        border-radius: 8px;
        border: 1px solid var(--border-color);
    }

    .btn-download-seating {
        width: 100%;
        padding: 12px 20px;
        font-size: 14.5px;
        border-radius: 12px;
    }

    /* Floating instruction panel bottom sheet */
    #modify-instructions-panel {
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        transform: none !important;
        width: 100% !important;
        border-radius: 16px 16px 0 0 !important;
        padding: 16px 20px 24px 20px !important;
        flex-direction: column !important;
        gap: 14px !important;
        align-items: stretch !important;
        box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.25) !important;
    }

    #modify-instructions-panel>div {
        justify-content: center;
        text-align: center;
    }

    #modify-instructions-panel button {
        width: 100% !important;
        margin-top: 4px !important;
    }

    /* Lift Modify FAB above bottom sheet */
    .modify-fab-container {
        right: 16px !important;
        bottom: 16px !important;
        transition: bottom 0.3s ease;
    }

    /* When instructions panel is visible (i.e. is active), lift the FAB */
    body.modify-mode-active .modify-fab-container {
        bottom: 240px !important;
        /* height of bottom sheet + spacing */
    }
}

@media (max-width: 480px) {
    .seat-view-left {
        flex-direction: row;
        align-items: center;
    }

    .seat-view-left h4 {
        font-size: 14.5px;
    }

    .seat-view-legend-item {
        font-size: 12.5px;
    }

    body.modify-mode-active .modify-fab-container {
        bottom: 270px !important;
    }
}