/* styles.css */
.module-view,
.app-view {
    display: none;
}

.module-view.active,
.app-view.active {
    display: block !important;
}

:root {
    --bg-dark: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    --sidebar-width: 260px;
    --sidebar-collapsed: 80px;

    --header-height: 70px;

    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(15, 23, 42, 0.65);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);

    --radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Neon Brand Palette */
    --neon-pink: #ff0055;
    --neon-red: #ff3131;
    --neon-cyan: #00f2ff;
    --neon-lime: #bcff00;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    /* Subtle background gradient for premium feel */
    background: radial-gradient(circle at 10% 20%, rgb(18, 25, 45) 0%, rgb(15, 23, 42) 90%);
}

/* Custom Scrollbar for visibility */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* SIDEBAR STYLES */
.sidebar {
    width: var(--sidebar-width);
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 100;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 1.5rem;
}

.sidebar.collapsed .logo-text {
    display: none;
}

/* Sidebar Logo Toggling */
.sidebar .logo-icon-only {
    display: none;
}

.sidebar .logo-full-text {
    display: block;
}

.sidebar.collapsed .logo-icon-only {
    display: block;
    margin: 0 auto;
}

.sidebar.collapsed .logo-full-text {
    display: none;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}

.toggle-btn:hover {
    color: var(--text-main);
}

.sidebar.collapsed .toggle-btn {
    transform: rotate(180deg);
}

.user-profile {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    white-space: nowrap;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
}

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

.sidebar.collapsed .user-info {
    display: none;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item i {
    font-size: 1.25rem;
    min-width: 24px;
    text-align: center;
}

.sidebar.collapsed .nav-text {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 0.75rem 0;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary);
}

.sidebar-footer {
    padding: 1.5rem 0.75rem;
    border-top: 1px solid var(--glass-border);
}

.text-danger {
    color: var(--danger);
}

.text-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* MAIN CONTENT */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-header {
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 10;
}

.header-search {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    width: 300px;
    gap: 0.75rem;
    transition: var(--transition);
}

.header-search:focus-within {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

.header-search i {
    color: var(--text-muted);
}

.header-search input {
    background: transparent;
    border: none;
    color: var(--text-main);
    outline: none;
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.role-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.role-selector select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    outline: none;
}

.role-selector select option {
    background: var(--bg-dark);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.btn-icon.btn-trash:hover {
    background: rgba(255, 77, 77, 0.2);
    color: #ff4d4d;
}

#btnDeleteEvent {
    background: linear-gradient(135deg, #ff4d4d 0%, #cc0000 100%);
    border: none;
    border-radius: 20px;
    padding: 10px 24px;
    box-shadow: 0 4px 15px rgba(204, 0, 0, 0.3);
    color: #ffffff;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: auto;
    width: auto;
}

#btnDeleteEvent:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(204, 0, 0, 0.4);
    transform: translateY(-2px);
}

/* Standard Module Containers for Parity */
.module-body {
    background: var(--glass-bg);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    margin-top: 1.5rem;
    overflow-y: auto;
}

.module-body .gignizer-table {
    margin-top: 0;
    background: transparent !important;
    border: none;
    box-shadow: none;
}

/* MODULE VIEWS */
.module-view,
.app-view {
    display: none;
    flex: 1;
    padding: 1.5rem 2rem;
    overflow-y: auto;
    height: 100%;
}

.module-view.active,
.app-view.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease forwards;
}

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

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

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

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.calendar-selectors {
    display: flex;
    gap: 0.5rem;
}

.jump-select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    outline: none;
}

.jump-select:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.jump-select option {
    background: var(--bg-dark);
    font-size: 1rem;
}

.calendar-filters {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.4rem 1rem;
    border-radius: 16px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

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

/* CALENDAR GRID */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: auto repeat(6, 1fr);
    flex: 1;
    min-height: 0;
    gap: 1px;
    background: var(--glass-border);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.cal-day-header {
    background: rgba(30, 41, 59, 0.8);
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.cal-cell {
    background: rgba(15, 23, 42, 0.4);
    padding: 0.4rem;
    transition: var(--transition);
    position: relative;
    overflow-y: auto;
    min-height: 120px;
}

.cal-cell::-webkit-scrollbar {
    width: 4px;
}

.cal-cell::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.cal-cell:hover {
    background: rgba(30, 41, 59, 0.6);
}

.date-number {
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: inline-block;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
}

.cal-cell.today .date-number {
    background: var(--primary);
    color: white;
}

.cal-cell.other-month {
    opacity: 0.4;
}

/* Net Profit Styling */
.pl-net-profit {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 2px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pl-net-profit h4 {
    margin: 0;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.pl-net-profit .profit-value {
    font-size: 1.5rem;
    font-weight: 800;
}

.profit-positive {
    color: #10b981;
}

/* Emerald-500 */
.profit-negative {
    color: #ef4444;
}

/* Red-500 */

/* P&L Two-Column Layout */
.pl-columns-container {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    margin-top: 1rem;
}

.pl-column {
    height: fit-content !important;
    padding: 10px !important;
    display: flex;
    flex-direction: column;
    gap: 0.25rem !important;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius);
}

.pl-column.revenue-col {
    border-top: 4px solid var(--accent);
}

.pl-column.expense-col {
    border-top: 4px solid var(--danger);
}

.pl-column h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

/* Consolidated above */

.pl-column .form-group {
    margin-bottom: 0.25rem !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    flex: 0 0 auto !important;
    /* Prevents rows from stretching vertically */
}

.pl-column label {
    margin-bottom: 1px !important;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.pl-column input {
    height: 30px !important;
    font-size: 0.85rem !important;
}

.pl-column input[readonly] {
    background: rgba(255, 255, 255, 0.04) !important;
    cursor: default;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.pl-net-profit {
    padding: 1rem !important;
    margin-top: 1rem !important;
    background: rgba(0, 0, 0, 0.2) !important;
}

.pl-net-profit .profit-value {
    font-size: 1.8rem !important;
}

/* EVENT BLOCKS */
.event-block {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    border-left: 3px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: var(--transition);
}

.event-block:hover {
    transform: translateX(2px);
    filter: brightness(1.2);
}

.event-block .time {
    opacity: 0.8;
    margin-right: 4px;
}

/* CALENDAR OVERFLOW & POPOVER */
.cal-more {
    font-size: 0.7rem;
    color: var(--primary);
    text-align: center;
    padding: 2px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 4px;
    transition: var(--transition);
    background: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
}

.cal-more:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: scale(1.05);
}

.neon-popover {
    position: fixed;
    z-index: 10002;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(99, 102, 241, 0.2);
    min-width: 200px;
    max-width: 280px;
    animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }

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

.popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

.popover-header h4 {
    font-size: 1rem;
    color: var(--text-main);
}

/* TEMPLATES VIEW */
.template-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.template-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.template-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--glass-shadow);
    border-color: var(--primary);
}

.template-card h4 {
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.template-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* =========================================
   MODALS & OVERLAYS (BASE CLASSES)
========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
    visibility: visible;
}

/* Fallback for explicit active states if needed */
.modal-overlay.active {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10001;
    justify-content: center;
    align-items: center;
    border: none;
    border-radius: 0;
    transform: none;
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-dark);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    gap: 1px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--glass-border);
    padding: 0 1.5rem;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: var(--text-main);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-btn i {
    margin-right: 0.5rem;
}

.modal-body {
    display: block;
    padding: 1.5rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.6rem 1.25rem;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

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

/* Form Tabs */
.form-tab {
    display: none;
}

.form-tab.active {
    display: block;
}

/* Form Styles */
.form-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-section h3 {
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    /* Added to fix overflow */
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-group {
    flex: 1 1 200px;
    /* Changed to allow wrapping and minimum width */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-group input,
.form-group select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    color: var(--text-main);
    outline: none;
    transition: var(--transition);
    font-family: inherit;
    width: 100%;
    /* Ensure inputs take full width of container */
}

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

.form-group input:disabled,
.form-group select:disabled {
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.02);
    cursor: not-allowed;
    border-color: rgba(255, 255, 255, 0.05);
}

.form-group select option {
    background: var(--bg-dark);
}

.city-search-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.city-search-container i {
    position: absolute;
    right: 12px;
    color: var(--accent);
    pointer-events: none;
}

.city-search-container input {
    width: 100%;
    padding-right: 35px;
}

.template-selector {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.template-selector label {
    color: var(--accent);
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.template-selector select {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
}

/* Fee Structure Refinements */
.fee-structure-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fee-option-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    /* Added for responsiveness inside rows */
    gap: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.fee-option-row:focus-within {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    min-width: 150px;
    cursor: pointer;
    color: var(--text-main);
}

.radio-label input[type="radio"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.fee-inputs {
    display: flex;
    flex-wrap: wrap;
    /* Added to fix overflow */
    flex: 1;
    gap: 1.5rem;
}

.fee-inputs .form-group {
    margin-bottom: 0;
}

/* Installments logic specific UI */
.installments-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    width: 100%;
}

.installment-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(15, 23, 42, 0.4);
    padding: 0.75rem;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.inst-num {
    font-weight: 700;
    color: var(--text-muted);
    min-width: 30px;
    align-self: center;
}

/* =========================================
   LOGIN SCREEN STYLES
========================================= */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.login-box {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 3rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.installments-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding-top: 1rem;
    border-top: 1px dashed var(--glass-border);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    border-radius: 6px;
    height: fit-content;
    flex: none;
}

.btn-sm i {
    font-size: 0.8rem;
}

.installments-math {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-end;
    font-size: 0.9rem;
}

.math-row {
    display: flex;
    justify-content: space-between;
    width: 200px;
    color: var(--text-muted);
}

.math-row.total {
    font-weight: 600;
    padding-top: 0.25rem;
    margin-top: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.math-row span:last-child {
    font-family: monospace;
    font-size: 1rem;
}

/* Logistics Accordions */
.logistics-accordion {
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.02);
    overflow: hidden;
}

.accordion-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: rgba(30, 41, 59, 0.5);
    font-weight: 600;
    cursor: pointer;
    margin: 0;
    transition: var(--transition);
}

.accordion-header input[type="checkbox"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

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

.accordion-body {
    padding: 1.5rem;
    border-top: 1px solid var(--glass-border);
    background: rgba(15, 23, 42, 0.3);
}

.accordion-body .fee-option-row {
    margin-bottom: 1rem;
}

.accordion-body .fee-option-row:last-child {
    margin-bottom: 0;
}

/* FINANCIALS UI CLASSES */
.text-success {
    color: var(--accent);
}

.header-sync span {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#plTotalRevenue,
#plTotalExpenses {
    font-size: 1.1rem;
}

/* MODERN UI COMPONENTS: CHIPS & TAGS */
.chip-selector-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.4);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
}

.artist-chip {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}

.artist-chip i {
    font-size: 0.75rem;
    opacity: 0;
    transition: var(--transition);
}

.artist-chip.active i {
    opacity: 1;
}

.artist-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* The Glowing Effect */
.artist-chip.active {
    color: white;
    border-color: transparent;
}

.tag-input-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    min-height: 42px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    background: var(--primary);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.tag .remove-tag {
    cursor: pointer;
    font-size: 0.7rem;
    opacity: 0.7;
}

.tag .remove-tag:hover {
    opacity: 1;
}

.tag-input-container input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    min-width: 150px;
    font-size: 0.9rem;
}

.chip-selector-grid.vertical {
    flex-direction: column;
    align-items: flex-start;
}

/* ---------------------------------------------------- */
/* Venues Grid Layout Fix                               */
/* ---------------------------------------------------- */
#view-venues {
    flex-grow: 1;
    width: 100%;
    padding: 2rem;
    box-sizing: border-box;
}

.venues-table-container {
    width: 100%;
    overflow-x: auto;
    background: var(--glass-bg);
    border-radius: var(--radius);
    border: 1px solid var(--glass-border);
    margin-top: 1.5rem;
}

/* Hoteling Refinements */
.hotel-entry-row {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.hotel-entry-row:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
}

.hotel-people {
    max-width: 80px;
}

.hotel-cat {
    max-width: 120px;
}

.hotel-single,
.hotel-double,
.hotel-triple {
    width: 60px !important;
    text-align: center;
}

.btn-remove-hotel {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
}

.btn-remove-hotel:hover {
    background: #ef4444;
    color: white;
}

/* Room Matrix UI Cleanup & 2-Row Layout */
.hotel-row {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1.25rem !important;
    margin-bottom: 1.5rem !important;
}

.room-matrix-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.75rem !important;
    align-items: center;
    width: 100%;
}

.room-matrix-row .form-group {
    flex: 1 !important;
    min-width: 0 !important;
}

.room-matrix-row .form-group input {
    padding: 0.5rem !important;
    text-align: center;
}

/* Event Editor Specifics */
#view-event-editor {
    position: relative !important;
    z-index: 100 !important;
    background: var(--bg-dark) !important;
    display: none;
    /* JS will toggle this */
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.editor-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

/* P&L Summary Grid */
.pl-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.pl-summary-grid .form-group label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

/* Technical Contacts Alignment */
.technical-contacts-table input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

.technical-contacts-table th {
    padding: 1rem 0.5rem;
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
}

.technical-contacts-table td {
    padding: 0.5rem;
}

/* Dark Mode Pro Financial Deal Refinement */
.financial-deal-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.deal-row {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.deal-row:has(input:checked) {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.1);
}

.deal-label-box {
    background: rgba(255, 255, 255, 0.07) !important;
    color: #ffffff !important;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 16px;
    min-width: 150px;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    font-weight: 500;
}

.deal-input {
    background: #0f172a !important;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 12px;
    flex-grow: 1;
    color: #ffffff;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.deal-input:last-child {
    border-right: none;
}

.deal-input:focus {
    outline: none;
    background: #1e293b !important;
    box-shadow: inset 0 0 0 2px rgba(99, 102, 241, 0.4);
}

.deal-text-inline {
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.04);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    height: 41px;
    /* Matches larger input height */
    display: flex;
    align-items: center;
    color: #94a3b8;
    font-size: 0.8rem;
    white-space: nowrap;
}

.deal-row input[type="radio"] {
    margin: 0 15px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #6366f1;
}

/* Disabled State: Cohesive and Clearly Inactive */
.deal-row:not(:has(input:checked)) {
    opacity: 0.4;
    filter: grayscale(0.5);
}

input:disabled {
    cursor: not-allowed;
    background: rgba(15, 23, 42, 0.5) !important;
}

/* Production Tab Contact Accordions */
.contact-accordion {
    margin-bottom: 0.75rem;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.02);
}

.contact-header {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.contact-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.contact-body {
    padding: 1.25rem;
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.contact-accordion.active .contact-body {
    display: grid;
}

.contact-accordion.active .contact-header i {
    transform: rotate(180deg);
}

.contact-header i {
    transition: transform 0.3s;
}

/* Premium Card Wrapper for Sections */
.form-section-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 8px;
}

/* Enhanced Notes Textarea Styling */
.notes-textarea {
    width: 100%;
    min-height: 120px;
    background: #0f172a !important;
    /* Match other inputs */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px;
    color: white !important;
    font-family: inherit;
    padding: 12px;
    resize: vertical;
    transition: var(--transition);
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    background: rgba(15, 23, 42, 0.8) !important;
}

.notes-textarea::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.artist-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 24px !important;
    padding: 24px 0 !important;
    width: 100% !important;
}

.artist-card {
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
}

.neon-card .card-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: var(--transition);
}

.neon-card:hover .card-actions {
    opacity: 1;
}

/* Promoter & General Tables - Professional Sync */
.gignizer-table {
    width: 100%;
    border-collapse: collapse;
    background: transparent;
}

.gignizer-table th {
    background: rgba(16, 185, 129, 0.05);
    /* Brand Teal Base */
    text-align: left;
    padding: 1rem;
    color: var(--accent);
    /* Brand Teal */
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(16, 185, 129, 0.2);
}

.gignizer-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
}

.gignizer-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02) !important;
}

/* Artist Management - Neon Cards */
.neon-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.neon-card:hover {
    transform: translateY(-5px);
    background: rgba(22, 32, 58, 0.9);
}

.neon-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--card-glow, var(--primary));
    box-shadow: 0 0 15px var(--card-glow, var(--primary));
}

.neon-card .icon-box {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--text-muted);
}

.neon-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

.neon-card .card-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.neon-card .meta-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.neon-card .meta-item i {
    width: 16px;
    text-align: center;
    opacity: 0.7;
}

/* Chips & Selection Pills */
.chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.chip {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
}

.chip:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-main);
}

.chip.active {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.chip i {
    font-size: 0.75rem;
}

/* Event Editor Specifics */
.editor-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    min-height: 400px;
    /* Force minimum height */
    position: relative;
}

/* Force Tab Visibility Overrides */
.form-tab.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    min-height: 100px;
}

.editor-body,
.form-tab {
    position: relative !important;
    z-index: 110 !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Custom Multiselect Components */
.custom-multiselect {
    position: relative;
    width: 100%;
    min-width: 200px;
    font-size: 0.9rem;
}

.multiselect-trigger {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.multiselect-trigger:after {
    content: '\f107';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    opacity: 0.5;
}

.multiselect-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    width: 100%;
    z-index: 10010;
    background: #0f172a;
    border: 1px solid var(--primary);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 10px rgba(99, 102, 241, 0.3);
    max-height: 250px;
    overflow-y: auto;
    display: none;
    padding: 0.5rem;
}

.multiselect-menu.active {
    display: block;
}

/* Force perfect alignment for filter items */
.multiselect-item {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px;
    padding: 10px 15px;
    width: 100%;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-main);
}

.multiselect-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Reset checkbox defaults to prevent floating */
.multiselect-item input[type='checkbox'] {
    margin: 0 !important;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    /* Prevents the box from squishing on long text */
    cursor: pointer;
    accent-color: var(--primary);
}

/* Ensure text stays aligned and handles overflow gracefully */
.multiselect-item span {
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
    /* Centers text perfectly with the box */
}

/* --- USER STATUS BADGES --- */
.status-badge {
    padding: 4px 12px;
    border-radius: 999px;
    /* Pill shape */
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.status-badge.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.status-inactive {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Landing Page Specific Styles */
body.landing-body {
    overflow-y: auto;
    overflow-x: hidden;
    background: #0f172a;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: var(--text-main);
}

.landing-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Uses modern math to perfectly align header with content max-width 1300px */
    padding: 1.5rem max(2rem, calc(50vw - 650px));
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.landing-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* --- LANGUAGE DROPDOWN --- */
.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-dropdown-trigger {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: color 0.2s;
}

.lang-dropdown-trigger:hover {
    color: var(--primary);
}

/* --- LANGUAGE DROPDOWN MENU & HOVER BRIDGE --- */
.lang-dropdown-menu {
    position: absolute;
    top: 100%;
    /* Moves it up to touch the container */
    margin-top: 10px;
    /* Pushes it down visually */
    right: -10px;
    background: #1e293b;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 60px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 1010;
}

/* This creates an invisible bridge over the gap so the menu doesn't vanish */
.lang-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 15px;
}

.lang-dropdown:hover .lang-dropdown-menu {
    display: flex;
}

.lang-option {
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 0.85rem;
    text-align: center;
    color: var(--text-main);
}

.lang-option:hover {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary);
}

.nav-link {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary);
}

.hero-section {
    display: flex;
    align-items: center;
    padding: 10rem max(2rem, calc(50vw - 650px)) 6rem;
    gap: 4rem;
    background: radial-gradient(circle at 0% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 50%);
    min-height: 90vh;
    /* Helps vertically center the content */
}

.hero-content {
    flex: 1.2;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    /* Centers the video horizontally */
    align-items: center;
}

.hero-title {
    /* Clamps font size so it doesn't get ridiculously huge on wide screens */
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.hero-desc {
    font-size: 1.25rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2.5rem;
    max-width: 90%;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.6rem 1.25rem;
    border-radius: 20px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
}

.release-note {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Video Size Fix */
.video-container {
    width: 100%;
    max-width: 600px !important;
    aspect-ratio: 16 / 9;
    /* Forces standard video proportions so it isn't too tall */
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(99, 102, 241, 0.3) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5) !important;
    background: #000;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- WHITE BACKGROUND SECTIONS --- */

.section-container {
    background-color: #ffffff;
    color: #0f172a;
    padding: 6rem max(2rem, calc(50vw - 650px));
    text-align: center;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: #475569 !important;
    font-size: 1.2rem;
    margin-bottom: 4rem;
}

/* Forces 5 columns to line up elegantly */
.features-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.feature-card {
    flex: 1 1 180px;
    max-width: 240px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 2.5rem 1.5rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

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

.feature-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.feature-card h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #0f172a;
}

.feature-card p {
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Benefits Grid (6 Items) */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.benefit-card {
    text-align: center;
    background: transparent;
    padding: 1rem 0;
}

.benefit-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.benefit-card h4 {
    font-size: 1rem;
    color: #0f172a;
    margin-bottom: 0.5rem;
}

.benefit-card p {
    font-size: 0.85rem;
    color: #475569;
    line-height: 1.4;
}

/* --- DARK BANNER --- */
.dark-banner {
    background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
    padding: 6rem max(2rem, calc(50vw - 650px));
    text-align: left;
    border-top: 1px solid rgba(99, 102, 241, 0.2);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
}

.dark-banner h3 {
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.dark-banner h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    max-width: 900px;
    /* Constrains width so text wraps naturally without <br> */
    line-height: 1.3;
}

/* --- SOLUTION SECTION (WHITE) --- */
.split-section {
    background-color: #ffffff;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 4rem;
    padding: 6rem max(2rem, calc(50vw - 650px));
}

.split-section img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0 !important;
}

.split-section p {
    color: #475569 !important;
}

.checklist {
    list-style: none;
    margin-top: 2rem;
    text-align: left;
}

.checklist li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    color: #475569;
    font-weight: 500;
}

.checklist i {
    color: var(--primary);
    font-size: 1.2rem;
}

/* --- FOOTER --- */
.landing-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3rem max(2rem, calc(50vw - 650px));
    background: #0f172a;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.footer-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text-main);
}

.footer-links .separator {
    color: var(--glass-border);
}

.footer-copyright {
    font-size: 0.85rem;
    opacity: 0.7;
}

.footer-right {
    display: flex;
    gap: 1.5rem;
}

.footer-right a {
    color: var(--text-muted);
    font-size: 1.25rem;
    transition: color 0.2s;
}

.footer-right a:hover {
    color: var(--text-main);
}

@media (max-width: 1024px) {
    .hero-section {
        flex-direction: column;
        padding-top: 8rem;
        text-align: center;
    }

    .hero-desc {
        margin: 0 auto 2.5rem auto;
    }

    .hero-buttons {
        justify-content: center;
    }

    .split-section {
        flex-direction: column-reverse;
        text-align: center;
    }

    .checklist li {
        justify-content: center;
    }

    .landing-footer {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
}

/* =========================================
   MOBILE APP UI OVERRIDES (Capacitor)
========================================= */
@media (max-width: 768px) {

    /* 1. Drawer Sidebar */
    .sidebar:not(.collapsed) {
        position: absolute;
        height: 100%;
        z-index: 9999;
        box-shadow: 10px 0 50px rgba(0, 0, 0, 0.8);
    }

    /* 2. Unified Horizontal Scroll */
    /* We allow the main view to overflow, so header, filters, and calendar move together */
    .main-content {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        width: 100vw;
    }

    .module-view,
    .app-view,
    .top-header {
        min-width: 850px;
        /* Forces the header and content to be wide enough for the calendar */
        padding: 1rem;
    }

    /* 3. Header & UI Cleanup */
    .top-header {
        height: 70px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid var(--glass-border);
    }

    .header-search {
        max-width: 250px;
        /* Keep search small to make room for other buttons */
    }

    /* Hide redundant info on mobile to make room for EN/PT and New Event */
    #sessionUserInfo,
    .role-selector {
        display: none !important;
    }

    /* 4. Calendar & Table Specifics */
    .calendar-grid,
    .gignizer-table {
        width: 100%;
        white-space: nowrap !important;
    }

    /* 5. Clean up Status Filters - No more individual scrollbar! */
    .calendar-filters {
        display: flex;
        gap: 0.5rem;
        margin-bottom: 1rem;
        overflow: visible !important;
    }
}

/* --- IN-APP PAYWALL STYLES --- */
.billing-grid-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem;
}

/* =========================================
   PRICING PAGE STYLES
   ========================================= */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 3rem;
    align-items: stretch;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 1024px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

.pricing-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.pricing-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.pricing-card.featured {
    border: 2px solid var(--primary);
    transform: scale(1.05);
    z-index: 10;
}

.pricing-card.featured:hover {
    transform: scale(1.05) translateY(-8px);
}

.featured-badge {
    position: absolute;
    top: 1.2rem;
    right: -2.8rem;
    background: var(--primary);
    color: white;
    width: 10rem;
    padding: 0.4rem 0;
    text-align: center;
    transform: rotate(45deg);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.tier-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.tier-price {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: baseline;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2px;
}

.tier-price span {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
    white-space: nowrap;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2.5rem 0;
    flex-grow: 1;
    text-align: left;
    /* FIX: Overrides center alignment of the parent */
}

.feature-item {
    display: flex;
    align-items: flex-start;
    /* FIX: Keeps checkmark at top of multi-line text */
    gap: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.feature-item i {
    color: var(--accent);
    font-size: 1rem;
    margin-top: 3px;
    /* Optically aligns with first line */
}

.btn-upgrade {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s, transform 0.2s;
}

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

.btn-upgrade-primary:hover {
    background: var(--primary-dark);
    transform: scale(1.02);
}

.btn-upgrade-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}

.btn-upgrade-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: scale(1.02);
}

.static-container {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 2rem;
    text-align: center;
}

.static-container h1 {
    color: var(--primary);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.static-container p.subtitle {
    color: var(--text-muted);
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.back-home {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    transition: color 0.2s;
}

.back-home:hover {
    color: var(--primary);
}