:root {
    --bg-dark: #151521;
    --bg-card: #1E1E2F;
    --bg-sidebar: #1E1E2F;
    --text-primary: #ffffff;
    --text-secondary: #8b8b9b;
    --accent-blue: #3d5afe;
    --border-color: #2d2d44;
    --hover-bg: #27273f;

    --status-paid-bg: #1e3a2f;
    --status-paid-text: #4cd964;
    --status-pending-bg: #3a321e;
    --status-pending-text: #ffcc00;
    --status-due-bg: #3a1e1e;
    --status-due-text: #ff3b30;

    color-scheme: dark;
    /* Forces native controls like date picker to be dark */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444466;
}

.app-container {
    display: flex;
    height: 100%;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 0;
    height: 100vh;
}

.sidebar-header {
    padding: 24px;
    color: var(--accent-blue);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header span {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
    padding-bottom: 24px;
}

/* Custom Scrollbar for Sidebar */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 10px 20px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: all 0.2s;
    border-left: 3px solid transparent;
    gap: 16px;
    /* Optimized gap */
}

.nav-item i {
    font-size: 18px;
}

.nav-item span {
    font-size: 13px;
    font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
    color: var(--accent-blue);
    background-color: rgba(61, 90, 254, 0.05);
}

.nav-item.active {
    border-left-color: var(--accent-blue);
}

/* Sidebar Layout Adjustment based on Screenshot 
   The screenshot sidebar items are centered vertically with icons on top of text?
   Actually in the screenshot:
   Icon on top, Text below. Centered.
   My css above does exactly that.
*/

/* Main Content */
.main-content {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
}

.page-header {
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 16px;
}

.tab-navigation {
    display: flex;
    gap: 32px;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding-bottom: 12px;
    cursor: pointer;
    position: relative;
    font-family: inherit;
}

.tab-btn.active {
    color: var(--accent-blue);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    /* Overlap border */
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-blue);
}

/* Content Card */
.content-card {
    background-color: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 20px;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 32px;
    margin-bottom: 24px;
    align-items: center;
    flex-wrap: wrap;
    /* Prevent cropping on wrap */
}

.date-filters {
    display: flex;
    gap: 20px;
}

.input-group,
.search-filter,
.service-filter,
.country-filter {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.input-group label,
.search-filter label,
.service-filter label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
}

.input-wrapper {
    position: relative;
    background-color: #151521;
    /* Darker than card */
    border: 1px solid var(--border-color);
    border-radius: 6px;
    height: 40px;
    display: flex;
    align-items: center;
    padding: 0 12px;
}

.input-wrapper input,
.input-wrapper select {
    background: none;
    border: none;
    color: white;
    width: 100%;
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.input-wrapper.icon-left input {
    padding-left: 28px;
}

/* Ensure date inputs have consistent styling */
input[type="date"] {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    color: var(--text-secondary);
    font-size: 16px;
    pointer-events: none;
    /* Let clicks pass through */
}

/* Make select dropdown arrows consistent or dark */
select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

/* Re-add custom arrow for select */
.select-wrapper::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-secondary);
    pointer-events: none;
}

/* Custom Select Dropdown Options */
select option {
    background-color: var(--bg-card);
    color: var(--text-primary);
    padding: 10px;
}

/* Import Page Redesign */
.import-page-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh;
    margin: 0 !important;
    padding: 0 !important;
    background: #f5f7fa;
    overflow-y: auto;
}

.import-page-header {
    background: white;
    padding: 24px 40px;
    border-bottom: 1px solid #e5e7eb;
    position: relative;
}

.breadcrumb {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 8px;
}

.import-page-title {
    font-size: 32px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.import-close {
    position: absolute;
    top: 24px;
    right: 40px;
    font-size: 28px;
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
}

.import-tabs-container {
    display: flex;
    gap: 12px;
    padding: 24px 40px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.import-tab-btn {
    padding: 12px 24px;
    border-radius: 24px;
    border: none;
    background: #e5e7eb;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.import-tab-btn.active {
    background: #0f172a;
    color: #fbbf24;
}

.import-tab-btn:hover:not(.active) {
    background: #d1d5db;
}

.import-tab-content {
    display: none;
    padding: 40px;
}

.import-tab-content.active {
    display: block;
}

.disclaimer-section {
    background: white;
    padding: 32px;
    border-radius: 12px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.disclaimer-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 16px 0;
}

.disclaimer-section p {
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    margin: 0;
}

.upload-section,
.paste-section,
.manual-entry-section {
    background: white;
    padding: 32px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.upload-section h3,
.paste-section h3,
.manual-entry-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
}

.upload-subtitle,
.paste-subtitle {
    font-size: 13px;
    color: #9ca3af;
    margin: 0 0 24px 0;
}

.upload-zone-new {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 80px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f9fafb;
}

.upload-zone-new:hover {
    border-color: #f59e0b;
    background: #fffbeb;
}

.paste-textarea {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
    background: #f9fafb;
    color: #374151;
}

.paste-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
}

.deploy-btn {
    margin-top: 16px;
    padding: 12px 24px;
    background: #0f172a;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.deploy-btn:hover {
    background: #1e293b;
}

.manual-form-new {
    margin-top: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field label {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 8px;
}

.form-field input {
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #f9fafb;
    color: #374151;
    font-family: inherit;
}

.form-field input::placeholder {
    color: #9ca3af;
}

.form-field input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 32px;
}

.deploy-single-btn {
    padding: 12px 32px;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.deploy-single-btn:hover {
    background: #059669;
}

.import-results-new {
    margin-top: 20px;
    padding: 16px;
    background: #ecfdf5;
    border: 1px solid #10b981;
    border-radius: 8px;
    color: #065f46;
    font-size: 13px;
    display: none;
}

.import-results-new.show {
    display: block;
}

/* Old import modal styles - keeping for backward compatibility */
.import-tabs {
    display: flex;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.import-tabs .tab-btn {
    padding: 12px 0;
    font-size: 14px;
    border-bottom: 2px solid transparent;
}

.import-tabs .tab-btn.active {
    border-bottom-color: var(--accent-blue);
    color: var(--accent-blue);
}

.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.02);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent-blue);
    background: rgba(61, 90, 254, 0.05);
}

.upload-zone p {
    margin: 16px 0 4px;
    font-weight: 500;
}

.upload-zone span {
    font-size: 12px;
    color: var(--text-secondary);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.manual-form .input-group {
    flex-direction: column;
    align-items: flex-start;
}

.manual-form input,
.manual-form select {
    width: 100%;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    border-radius: 6px;
    color: white;
    font-family: inherit;
    font-size: 13px;
    margin-top: 4px;
}

.submit-btn:hover {
    background-color: #2d4afc !important;
}

/* Clear Filters Button */
.clear-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    transition: all 0.2s;
    height: 40px;
}

.clear-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Table Animation */
.sales-table tbody tr {
    transition: background-color 0.15s ease;
}

.sales-table tbody tr:hover {
    background-color: var(--hover-bg);
}



/* Specific widths from screenshot intuition */
.filter-bar .date-filters .input-wrapper {
    width: 160px;
}

.filter-bar .search-filter {
    flex: 1;
    /* Search takes remaining space until Service */
}

.filter-bar .service-filter .input-wrapper {
    width: 200px;
}

/* Table */
.table-container {
    overflow-x: auto;
}

.sales-table {
    width: 100%;
    border-collapse: collapse;
}

.sales-table th {
    text-align: left;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    white-space: nowrap;
}

.sales-table th i {
    font-size: 10px;
    margin-left: 4px;
    vertical-align: middle;
}

.sales-table td {
    padding: 16px;
    font-size: 13px;
    color: #e0e0e0;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.sales-table tr:last-child td {
    border-bottom: none;
}

.sales-table tr:hover {
    background-color: var(--hover-bg);
}

/* Status Badges */
.status-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    min-width: 80px;
    text-align: center;
}

.status-paid {
    background-color: var(--status-paid-bg);
    color: var(--status-paid-text);
}

.status-pending {
    background-color: var(--status-pending-bg);
    color: var(--status-pending-text);
}

.status-due {
    background-color: var(--status-due-bg);
    color: var(--status-due-text);
}

/* Filter Bar - Clean & Compact */
.filter-bar {
    display: flex;
    flex-wrap: nowrap;
    /* Force one line */
    align-items: center;
    gap: 16px;
    /* Optimized gap */
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    overflow-x: auto;
    /* Allow scroll if screen too small */
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.filter-bar::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.filter-bar {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.filter-bar .date-filters {
    display: flex;
    gap: 16px;
    align-items: center;
}

.filter-bar .input-group,
.filter-bar .search-filter,
.filter-bar .service-filter {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    flex-shrink: 0;
    /* Stop squishing/overlapping */
}

/* Labels */
.input-group label,
.search-filter label,
.service-filter label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
    white-space: nowrap;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    height: 36px;
    /* Restored comfortable height */
    transition: all 0.2s;
    flex-shrink: 0;
    /* Crucial: Prevent size collapse */
    overflow: hidden;
    /* Clip internal content */
}



.input-wrapper:hover,
.input-wrapper:focus-within {
    border-color: var(--accent-blue);
    background-color: #1a1a2e;
}

.input-wrapper input,
.input-wrapper select {
    background: transparent !important;
    /* Force transparent */
    border: none !important;
    /* Force no border */
    color: var(--text-primary);
    font-size: 13px;
    height: 100%;
    padding: 0 12px;
    outline: none;
    width: 100%;
    font-family: inherit;
    cursor: text;
    box-shadow: none !important;
    /* Remove any shadow */
}

.input-wrapper select {
    cursor: pointer;
}

/* Specific Widths */
.filter-bar .date-filters .input-wrapper {
    width: 150px;
}

#search-input {
    width: 200px;
}

#service-filter {
    width: 180px;
}

/* Icons */
.input-wrapper.icon-left input {
    padding-left: 36px;
}

.input-wrapper i {
    left: 12px;
    font-size: 16px;
    color: var(--text-secondary);
}

/* Clear Button */
.clear-btn {
    height: 36px;
    padding: 0 16px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
}

/* Responsive */
/* Responsive */
/* Removed stacking media query to force inline scrolling as requested */

.filter-actions {
    margin-left: auto;
    /* Push to right */
    display: flex;
    align-items: center;
    flex-shrink: 0;
    /* Never shrink the Clear button */
}

/* Ensure inputs don't look weird */
.input-wrapper input:focus,
.input-wrapper select:focus {
    background: transparent;
}

.clear-btn:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
    border-color: var(--text-secondary);
}

/* Sidebar Footer & User Panel */
.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    padding: 16px;
}

.sidebar-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    padding-left: 4px;
    opacity: 0.6;
}

.user-panel {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 11px;
    color: var(--text-secondary);
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.logout-btn:hover {
    color: var(--status-due-text);
    background-color: rgba(255, 59, 48, 0.1);
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Main Content Area */
.main-content {
    flex: 1;
    background-color: var(--bg-main);
    padding: 0 40px 40px;
    height: 100vh;
    overflow-y: auto;
    position: relative;
}

/* Page Header - Fixed at Top */
.page-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(10, 10, 18, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.header-top {
    display: flex;
    align-items: center;
    min-width: 150px;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 150px;
}

.page-header h1 {
    font-size: 24px;
    color: white;
    margin: 0;
}

/* Header User Panel Styles */
.header-user-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 6px 16px;
    border-radius: 50px;
    display: flex;
    align-items: center;
}

.header-user-panel .user-info {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 12px;
}

.header-user-panel .user-name {
    font-size: 13px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
}

.header-user-panel .user-role {
    font-size: 11px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
}

.header-user-panel .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--accent-blue);
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 10% auto;
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}

.user-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.user-row:hover {
    background-color: var(--hover-bg);
}

/* --- Responsive Media Queries --- */

/* Mobile Header Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    margin-right: 12px;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 998;
}

@media screen and (max-width: 1200px) {
    .header-center {
        display: none;
        /* Move tabs below h1 on smaller screens if needed, or hide to prevent overlap */
    }
}

/* Tablet & Mobile (Below 1024px) */
@media screen and (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: -240px;
        top: 0;
        bottom: 0;
        z-index: 999;
        transition: left 0.3s ease;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-content {
        padding: 0 20px 20px;
    }

    .page-header {
        padding: 12px 0;
    }

    .header-user-panel .user-info {
        display: none;
        /* Hide name/role on small mobile to save space */
    }
}

/* Small Screens (Below 768px) */
@media screen and (max-width: 768px) {
    .page-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .header-top {
        flex: 1;
    }

    .header-right {
        order: 2;
    }

    /* Keep filter bar inline even on mobile, allow scroll */
    .filter-bar {
        overflow-x: auto;
        padding-bottom: 24px;
        flex-direction: row;
        /* Force row */
        flex-wrap: nowrap;
    }

    .date-filters {
        flex-shrink: 0;
        display: flex;
        gap: 16px;
    }
}

/* Table Stability & Alignment */
.sales-table {
    width: 100%;
    border-collapse: separate;
    /* Required for sticky */
    border-spacing: 0;
    table-layout: auto;
}

.sales-table th {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    /* Cover content when scrolling */
    z-index: 10;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    box-shadow: 0 1px 0 var(--border-color);
    /* Sharper border */
}

.sales-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 13px;
    white-space: nowrap;
}

/* Specific Column Stability */
.sales-table th[data-sort="name"],
.sales-table th[data-sort="email"] {
    min-width: 180px;
}

.sales-table th[data-sort="id"] {
    min-width: 100px;
}

.sales-table th[data-sort="service"] {
    min-width: 150px;
}

.sales-table th[data-sort="country"] {
    min-width: 120px;
}

.sales-table th[data-sort="phone"] {
    min-width: 140px;
}

.sales-table th[data-sort="payment"] {
    text-align: right;
}

.sales-table td:nth-child(9) {
    text-align: right;
}

/* Payment Column */


.input-wrapper input,
.input-wrapper select {
    width: 100%;
}

.modal-content {
    width: 90%;
    margin: 20% auto;
    padding: 16px;
}
}

/* Extra Small (Below 480px) */
@media screen and (max-width: 480px) {
    .date-filters {
        grid-template-columns: 1fr;
    }

    .page-header h1 {
        font-size: 20px;
    }
}