* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --green: #10b981;
    --purple: #8b5cf6;
    --red: #ef4444;
    --orange: #f59e0b;
    --text: #1e1b4b;
    --text-light: #6b7280;
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.25);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
}

body {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text);
    overflow-x: hidden;
}

/* Background Animation */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.6;
    animation: float 20s infinite ease-in-out;
}

.orb-1 { width: 300px; height: 300px; background: #a78bfa; top: -50px; left: -50px; }
.orb-2 { width: 250px; height: 250px; background: #f472b6; bottom: -50px; right: -50px; animation-delay: -5s; }
.orb-3 { width: 200px; height: 200px; background: #60a5fa; top: 40%; left: 60%; animation-delay: -10s; }
.orb-4 { width: 150px; height: 150px; background: #34d399; bottom: 20%; left: 10%; animation-delay: -15s; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

/* App Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    padding: 24px 16px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 24px;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 20px;
}

.logo-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.logo-text h2 {
    font-size: 20px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
}

.logo-text span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(4px);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar-user {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
}

.sidebar-user-top {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    transition: background 0.25s ease;
}

.sidebar-user-top:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-user-avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 15px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}

.sidebar-user-text {
    flex: 1;
    min-width: 0;
}

.sidebar-user-text span {
    display: block;
    color: white;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-text em {
    display: block;
    font-style: normal;
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-logout {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

/* Profile Modal */
.profile-avatar {
    width: 72px;
    height: 72px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.profile-name {
    color: white;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2px;
}

.profile-email {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    text-align: center;
    margin-bottom: 20px;
}

.profile-section {
    margin-top: 18px;
}

.profile-section-title {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 10px;
}

.profile-field {
    margin-bottom: 14px;
}

.profile-field label {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    margin-bottom: 6px;
}

.profile-field input {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: #fff;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.profile-field input:focus {
    border-color: #a78bfa;
}

.profile-logout {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
}

.profile-message {
    color: #6ee7b7;
    font-size: 13px;
    text-align: center;
    min-height: 18px;
    margin-top: 10px;
}

/* Salesperson sidebar section */
.sp-manage-head {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
    padding: 14px;
    background: rgba(167, 139, 250, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.25);
    border-radius: 12px;
}

.sp-add-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.sp-add-row input {
    flex: 1;
    max-width: 340px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 14px;
    outline: none;
}

.sp-add-row input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.sp-add-row input:focus {
    border-color: #a78bfa;
}

.sp-manage-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sp-manage-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px 16px;
}

.sp-row-name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    flex: 1;
    min-width: 0;
}

.sp-row-name i {
    color: #a78bfa;
}

.sp-row-count {
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    white-space: nowrap;
}

.sp-manage-empty {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 32px 16px;
    font-size: 14px;
}

.sp-manage-empty i {
    display: block;
    font-size: 28px;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 10px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 24px 32px;
    overflow-y: auto;
    max-height: 100vh;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.topbar h1 {
    font-size: 28px;
    font-weight: 700;
    color: white;
}

.topbar-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.25);
}

.btn-danger {
    background: linear-gradient(135deg, #f87171, var(--red));
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Glass Cards */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--glass-shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.glass-inset {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
}

/* Sections */
.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 18px;
    color: white;
    font-weight: 600;
}

.section-header h2 i {
    margin-right: 8px;
    color: rgba(255, 255, 255, 0.7);
}

.month-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 14px;
    border-radius: 20px;
}

.pnl-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.month-picker {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    color-scheme: dark;
}

.month-picker::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.sm-code {
    display: inline-block;
    background: rgba(167, 139, 250, 0.2);
    color: #c4b5fd;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.icon-green { background: linear-gradient(135deg, #34d399, var(--green)); }
.stat-icon.icon-purple { background: linear-gradient(135deg, #a78bfa, var(--purple)); }
.stat-icon.icon-red { background: linear-gradient(135deg, #fb7185, var(--red)); }

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: white;
}

.stat-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 2px;
}

.stat-card.clickable {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card.clickable:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.4);
}

/* Pending modal */
.pending-modal {
    max-width: 760px;
}

.pending-summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    color: #fca5a5;
    font-size: 14px;
    font-weight: 600;
}

.pending-summary i {
    font-size: 18px;
}

.pending-summary strong {
    color: #fff;
    margin-left: auto;
    font-size: 16px;
}

/* P&L Section */
.data-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin: 12px 0 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    display: inline-block;
}

.pnl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.pnl-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pnl-item span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.pnl-item strong {
    font-size: 20px;
    color: white;
}

.pnl-item.highlight {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
}

.text-green { color: #6ee7b7 !important; }
.text-purple { color: #c4b5fd !important; }
.text-orange { color: #fcd34d !important; }
.text-red { color: #fca5a5 !important; }

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead {
    background: rgba(255, 255, 255, 0.1);
}

.data-table th {
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    border-bottom: 1px solid var(--glass-border);
}

.data-table td {
    padding: 12px 16px;
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.08);
}

.data-table td .amount-paid { color: #6ee7b7; font-weight: 600; }
.data-table td .amount-share { color: #c4b5fd; font-weight: 600; }
.data-table td .amount-gst { color: #fcd34d; font-weight: 600; }
.data-table td .amount-net { color: white; font-weight: 600; }
.data-table td .amount-red { color: #fca5a5; font-weight: 600; }

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-paid { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-pending { background: rgba(245, 158, 11, 0.2); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.3); }
.status-partial { background: rgba(139, 92, 246, 0.2); color: #c4b5fd; border: 1px solid rgba(139, 92, 246, 0.3); }
.status-cancelled { background: rgba(239, 68, 68, 0.18); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); text-decoration: line-through; }

/* Action buttons in table */
.action-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 4px 8px;
    margin: 0 2px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.action-btn.edit:hover { color: #6ee7b7; }
.action-btn.delete:hover { color: #fca5a5; }
.action-btn.cancel:hover { color: #fca5a5; }
.action-btn.green:hover { color: #6ee7b7; }

.pending-actions { white-space: nowrap; }

.proof-missing {
    color: rgba(255, 255, 255, 0.35);
    opacity: 0.5;
}

.amount-orange {
    color: #fcd34d !important;
    font-weight: 600;
}

/* Filter Card */
.filter-card {
    display: flex;
    align-items: center;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
    align-items: center;
}

.filter-row input,
.filter-row select {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: white;
    font-size: 13px;
    outline: none;
    min-width: 140px;
    flex: 1;
}

.filter-row input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.filter-row select {
    cursor: pointer;
}

.filter-row select option {
    color: var(--text);
    background: white;
}

input[type="date"] {
    color-scheme: dark;
}

.filter-row button {
    white-space: nowrap;
}

.count-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
}

.req-star {
    color: #fca5a5;
    font-size: 15px;
}

.field-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 6px;
}
.field-hint strong {
    color: #7dd3fc;
}

.expense-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
}

/* Salesperson Performance grid */
.np-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.np-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 18px;
}

.np-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.np-header h3 {
    margin: 0;
    color: #fff;
    font-size: 16px;
}

.np-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
}

.np-row strong {
    color: #fff;
}

.np-net {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 6px;
    padding-top: 10px;
    font-weight: 600;
}

.np-net strong {
    color: #6ee7b7;
}

/* Supermarket Grid */
.supermarket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.supermarket-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.supermarket-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(31, 38, 135, 0.25);
}

.sm-detail-summary {
    padding: 12px 4px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 14px;
}
.sm-detail-summary strong {
    color: #6ee7b7;
}

.supermarket-card .sm-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.supermarket-card .sm-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
}

.supermarket-card .sm-head-info {
    min-width: 0;
}

.supermarket-card h3 {
    color: white;
    font-size: 16px;
    margin-bottom: 4px;
    line-height: 1.2;
}

.supermarket-card p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    margin-bottom: 0;
}

.supermarket-card .sm-stats {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.supermarket-card .sm-stat {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
}

.supermarket-card .sm-stat span {
    display: block;
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 6px;
}

.supermarket-card .sm-stat strong {
    color: white;
    font-size: 20px;
    line-height: 1.1;
}

.supermarket-card .sm-stat-main strong {
    color: #6ee7b7;
    font-size: 24px;
    display: block;
}

.supermarket-card .sm-stat-main em {
    display: block;
    font-style: normal;
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    margin-top: 6px;
}

.supermarket-card .sm-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border-top: 1px solid var(--glass-border);
    padding-top: 12px;
}

.supermarket-card .sm-view {
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.supermarket-card .sm-actions {
    display: flex;
    gap: 8px;
}

/* Distribution Grid */
.distribution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.distribution-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px;
}

.distribution-item .d-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.distribution-item .d-name {
    color: white;
    font-size: 13px;
    font-weight: 600;
}

.distribution-item .d-amount {
    color: #c4b5fd;
    font-weight: 700;
    font-size: 14px;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--purple));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: linear-gradient(160deg, rgba(255,255,255,0.2), rgba(255,255,255,0.1));
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal.small-modal {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: white;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Form */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-group label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group select option {
    color: var(--text);
    background: white;
}

input[type="date"] {
    color-scheme: dark;
}

/* Calc Preview */
.calc-preview {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calc-preview > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.calc-preview span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

.calc-preview strong {
    color: white;
    font-size: 14px;
}

.calc-preview .calc-net {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 4px;
    padding-top: 8px;
}

.calc-preview .calc-net strong {
    color: #6ee7b7;
    font-size: 18px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

/* Upload Area */
.upload-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-input.hidden {
    display: none;
}

.upload-preview {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    min-height: 44px;
}

.upload-preview-hint {
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-preview i {
    font-size: 18px;
    color: #c4b5fd;
}

.upload-preview.has-file {
    border-color: rgba(16, 185, 129, 0.5);
    color: #6ee7b7;
}

.upload-preview.has-file i {
    color: #34d399;
}

.upload-files {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
}

.proof-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 14px;
    font-size: 12px;
    max-width: 100%;
}

.proof-file-chip i:first-child {
    font-size: 13px;
    color: #c4b5fd;
}

.proof-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}

.proof-file-remove {
    cursor: pointer;
    opacity: 0.6;
    font-size: 11px;
}

.proof-file-remove:hover {
    opacity: 1;
    color: #fca5a5;
}

.proof-group {
    position: relative;
    display: inline-flex;
    gap: 2px;
    margin: 0 2px;
}

.proof-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #a78bfa;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    border-radius: 10px;
    padding: 1px 5px;
    line-height: 1.3;
}

.upload-error {
    color: #fca5a5;
    font-size: 13px;
    margin-top: 6px;
    min-height: 18px;
    font-weight: 500;
}

.upload-error:empty {
    display: none;
}

/* Supermarket Multi-select */
.muted {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-weight: 400;
}

.sm-multiselect {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    max-height: 160px;
    overflow-y: auto;
}

.sm-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.sm-chip i {
    font-size: 12px;
    opacity: 0.6;
}

.sm-chip:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sm-chip.selected {
    background: linear-gradient(135deg, var(--primary), var(--purple));
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sm-chip.selected i {
    opacity: 1;
}

.sm-share-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.share-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
}

.share-row-label {
    flex: 1;
    color: white;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-row-label i {
    color: #c4b5fd;
}

.share-row input {
    width: 90px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: white;
    font-size: 13px;
    outline: none;
    text-align: right;
}

.share-row .share-amount {
    min-width: 90px;
    text-align: right;
    color: #c4b5fd;
    font-weight: 700;
    font-size: 13px;
}

/* Share breakdown in preview */
.preview-split-header {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 6px;
    padding-top: 8px;
    font-weight: 600;
}

.share-breakdown {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.share-breakdown .bd-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 0 2px 14px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
}

.share-breakdown .bd-row strong {
    color: #c4b5fd;
}

/* Confirm text */
.confirm-text {
    color: white;
    font-size: 15px;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Delete protection modal */
.modal-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.modal-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.modal-input:focus {
    border-color: #a78bfa;
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

.delete-error {
    color: #fca5a5;
    font-size: 14px;
    margin: 0 0 4px 0;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(16, 185, 129, 0.9);
    color: white;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transform: translateX(120%);
    transition: transform 0.4s ease;
    z-index: 2000;
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.toast.show {
    transform: translateX(0);
}

.toast.error {
    background: rgba(239, 68, 68, 0.9);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.6);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 15px;
}

/* MT utility */
.mt-2 {
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .pnl-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 80px;
        padding: 24px 8px;
    }
    .logo-text, .nav-item span {
        display: none;
    }
    .nav-item {
        justify-content: center;
    }
    .main-content {
        padding: 16px;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .pnl-grid {
        grid-template-columns: 1fr;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .form-group.full {
        grid-column: auto;
    }
    .topbar {
        flex-direction: column;
        gap: 16px;
    }
}

/* Phone-specific responsiveness */
@media (max-width: 640px) {
    .main-content {
        padding: 10px;
    }
    .glass, .glass-modal {
        padding: 16px;
        border-radius: 14px;
    }
    .section-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    .section-header h2 {
        font-size: 15px;
    }
    .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
    .table-responsive {
        margin: 0 -6px;
        padding: 0 6px;
    }
    .data-table {
        min-width: 560px;
        font-size: 12px;
    }
    .data-table th, .data-table td {
        padding: 7px 8px;
    }
    .auth-card {
        padding: 24px 18px;
    }
    .topbar-title h1 {
        font-size: 18px;
    }
    .topbar-actions {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }
    .pagination, .filter-row {
        flex-wrap: wrap;
    }
    .modal .glass-modal {
        max-width: 100%;
        margin: 8px;
        max-height: 92vh;
        overflow-y: auto;
    }
    .invoice-sheet {
        padding: 16px;
    }
    .invoice-head {
        flex-direction: column;
        gap: 12px;
    }
    .invoice-meta {
        text-align: left;
    }
    .stats-grid {
        gap: 10px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Auth Screen */
.auth-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at 30% 20%, rgba(99, 102, 241, 0.25), transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.2), transparent 50%),
                #0f0f23;
}

.auth-screen.active {
    display: flex;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 34px 30px;
    border-radius: 20px;
    text-align: center;
}

.auth-logo {
    margin-bottom: 24px;
}

.auth-logo .logo-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
}

.auth-logo h2 {
    color: white;
    font-size: 26px;
    letter-spacing: 0.5px;
}

.auth-logo span {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    letter-spacing: 1px;
}

.auth-tabs {
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    padding: 5px;
    border-radius: 12px;
    margin-bottom: 22px;
}

.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    padding: 9px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab.active {
    background: var(--primary);
    color: white;
}

.auth-form {
    text-align: left;
}

.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-form input {
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--glass-border);
    color: #fff;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.auth-form input:focus {
    border-color: #a78bfa;
}

.auth-submit {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    font-size: 15px;
}

.auth-error {
    color: #fca5a5;
    font-size: 13px;
    min-height: 18px;
    margin: 4px 0 10px;
    text-align: center;
}

.auth-note {
    margin-top: 18px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 12px;
}

/* User chip in topbar */
.user-chip {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    white-space: nowrap;
}

.hidden {
    display: none !important;
}

/* Auth reset */
.auth-forgot {
    text-align: center;
    margin-top: 8px;
}
.link-btn {
    background: none;
    border: none;
    color: var(--accent, #4fb3ff);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    text-decoration: underline;
}
.link-btn:hover {
    color: #8fd0ff;
}
.reset-title {
    margin: 4px 0 14px;
    font-size: 16px;
    color: #eee;
}
.reset-desc {
    font-size: 13px;
    color: #bbb;
    margin: 0 0 14px;
}

/* Invoice */
.invoice-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.invoice-sheet {
    background: #fff;
    color: #111;
    border-radius: 12px;
    padding: 28px;
    max-height: 70vh;
    overflow-y: auto;
}

.invoice-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #333;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.invoice-brand {
    font-size: 22px;
    font-weight: 800;
}

.invoice-sub {
    color: #555;
    font-size: 13px;
    margin-top: 2px;
}

.invoice-meta {
    text-align: right;
    font-size: 13px;
    line-height: 1.7;
}

.invoice-meta .status-badge {
    font-size: 11px;
}

.invoice-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 12px;
}

.invoice-table td,
.invoice-table th {
    border: 1px solid #ddd;
    padding: 8px 10px;
    text-align: left;
}

.invoice-table .label {
    width: 26%;
    background: #f4f4f4;
    font-weight: 600;
}

.invoice-table th {
    background: #efefef;
}

.invoice-table.right td:last-child {
    text-align: right;
}

.invoice-table .total {
    font-weight: 800;
    background: #f0f0f0;
}

.invoice-subhead {
    margin: 16px 0 6px;
    font-size: 14px;
    color: #333;
}

.invoice-notes {
    margin-top: 12px;
    font-size: 12px;
    color: #444;
}


/* Google sign-in ------------------------------------------------ */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #fff;
    color: #3c4043;
    border: 1px solid rgba(255, 255, 255, 0.6);
    font-weight: 600;
}

.btn-google:hover:not(:disabled) {
    background: #f1f3f4;
}

.btn-google .fa-google {
    color: #ea4335;
}

.btn-google:disabled {
    opacity: 0.7;
    cursor: default;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0 4px;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.18);
}
