:root {
    /** Theme primary colors */
    --cffy-theme-primary-a0: #546d64;
    --cffy-theme-primary-a10: #485e56;
    --cffy-theme-primary-a20: #3c4f48;
    --cffy-theme-primary-a30: #31413b;
    --cffy-theme-primary-a40: #26332e;
    --cffy-theme-primary-a50: #1b2622;

    /** Theme accent colors */
    --cffy-theme-accent-a0: #72b01d;
    --cffy-theme-accent-a10: #629918;
    --cffy-theme-accent-a20: #538213;
    --cffy-theme-accent-a30: #446c0e;
    --cffy-theme-accent-a40: #365609;
    --cffy-theme-accent-a50: #284205;

    /** Theme surface colors */
    --cffy-theme-surface-a0: #fff;
    --cffy-theme-surface-a10: #f2f2f2;
    --cffy-theme-surface-a20: #e4e4e4;
    --cffy-theme-surface-a30: #d7d7d7;
    --cffy-theme-surface-a40: #cacaca;
    --cffy-theme-surface-a50: #bdbdbd;

    /** Theme tonal surface colors */
    --cffy-theme-surface-tonal-a0: #edefee;
    --cffy-theme-surface-tonal-a10: #e2e3e2;
    --cffy-theme-surface-tonal-a20: #d6d8d7;
    --cffy-theme-surface-tonal-a30: #cbcccc;
    --cffy-theme-surface-tonal-a40: #c0c1c1;
    --cffy-theme-surface-tonal-a50: #b5b6b5;

    /** Success colors */
    --cffy-theme-success-a0: #7dff95;
    --cffy-theme-success-a10: #95ffa6;
    --cffy-theme-success-a20: #abffb7;

    /** Warning colors */
    --cffy-theme-warning-a0: #ffbc5e;
    --cffy-theme-warning-a10: #ffc77a;
    --cffy-theme-warning-a20: #ffd194;

    /** Danger colors */
    --cffy-theme-danger-a0: #ff8080;
    --cffy-theme-danger-a10: #ff9493;
    --cffy-theme-danger-a20: #ffa8a5;

    /** Info colors */
    --cffy-theme-info-a0: #87d1ff;
    --cffy-theme-info-a10: #9ad8ff;
    --cffy-theme-info-a20: #addfff;

    /* Semantic Mappings */
    --bg: var(--cffy-theme-surface-a20);
    /* #e4e4e4 */
    --surface: var(--cffy-theme-surface-a0);
    /* #ffffff */
    --surface-hover: var(--cffy-theme-surface-a30);
    --border: var(--cffy-theme-surface-a40);

    --text-primary: #111511;
    /* Dark text for light mode */
    --text-secondary: #485e56;

    --accent: var(--cffy-theme-primary-a0);
    --accent-hover: var(--cffy-theme-primary-a10);

    --success: #28631b;
    /* Dark green for light mode contrast */
    --warning: var(--cffy-theme-warning-a0);
    --danger: var(--cffy-theme-danger-a0);

    --font-main: 'Aptos', 'Aptos Light', 'Aptos Body', sans-serif;
}

[data-theme="dark"] {
    /** Theme primary colors */
    --cffy-theme-primary-a0: #546d64;
    --cffy-theme-primary-a10: #647b72;
    --cffy-theme-primary-a20: #748881;
    --cffy-theme-primary-a30: #849690;
    --cffy-theme-primary-a40: #95a59f;
    --cffy-theme-primary-a50: #a6b3ae;

    /** Theme accent colors */
    --cffy-theme-accent-a0: #72b01d;
    --cffy-theme-accent-a10: #80b841;
    --cffy-theme-accent-a20: #8ec05b;
    --cffy-theme-accent-a30: #9cc971;
    --cffy-theme-accent-a40: #aad187;
    --cffy-theme-accent-a50: #b8d99b;

    /** Theme surface colors */
    --cffy-theme-surface-a0: #020402;
    --cffy-theme-surface-a10: #111511;
    --cffy-theme-surface-a20: #262a26;
    --cffy-theme-surface-a30: #3d413d;
    --cffy-theme-surface-a40: #565956;
    --cffy-theme-surface-a50: #6f726f;

    /** Theme tonal surface colors */
    --cffy-theme-surface-tonal-a0: #060b07;
    --cffy-theme-surface-tonal-a10: #181e1a;
    --cffy-theme-surface-tonal-a20: #2d332e;
    --cffy-theme-surface-tonal-a30: #444945;
    --cffy-theme-surface-tonal-a40: #5c605d;
    --cffy-theme-surface-tonal-a50: #757976;

    /** Success colors */
    --cffy-theme-success-a0: #7dff95;
    --cffy-theme-success-a10: #9dffac;
    --cffy-theme-success-a20: #b8ffc1;

    /** Warning colors */
    --cffy-theme-warning-a0: #ffbc5e;
    --cffy-theme-warning-a10: #ffca83;
    --cffy-theme-warning-a20: #ffd8a4;

    /** Danger colors */
    --cffy-theme-danger-a0: #ff8080;
    --cffy-theme-danger-a10: #ff9b99;
    --cffy-theme-danger-a20: #ffb5b2;

    /** Info colors */
    --cffy-theme-info-a0: #87d1ff;
    --cffy-theme-info-a10: #a1dbff;
    --cffy-theme-info-a20: #b9e4ff;

    /* Semantic Mappings Overrides */
    --bg: var(--cffy-theme-surface-a0);
    /* #020402 */
    --surface: var(--cffy-theme-surface-a10);
    /* #111511 */
    --surface-hover: var(--cffy-theme-surface-a20);
    --border: var(--cffy-theme-surface-a30);

    --text-primary: #ffffff;
    /* White text for dark mode */
    --text-secondary: var(--cffy-theme-surface-a50);

    --accent: var(--cffy-theme-primary-a0);
    --accent-hover: var(--cffy-theme-primary-a10);

    --success: var(--cffy-theme-success-a0);
    --warning: var(--cffy-theme-warning-a0);
    --danger: var(--cffy-theme-danger-a0);
}

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

body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text-primary);
    height: 100dvh;
    overflow: hidden;
}

/* App Layout */
.app-container {
    display: flex;
    height: 100dvh;
    width: 100vw;
}

/* --- Left Sidebar --- */
.sidebar {
    width: 240px;
    background: var(--surface);
    border-right: none;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    position: relative;
    z-index: 50;
    overflow-x: hidden;
    white-space: nowrap;
}

.sidebar.collapsed {
    width: 68px;
}

.sidebar-text {
    transition: opacity 0.2s ease, width 0.2s ease;
    opacity: 1;
}

.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .user-info {
    opacity: 0;
    pointer-events: none;
}

.sidebar-header {
    height: 68px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
    justify-content: flex-start;
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
    white-space: nowrap;
}

.logo-icon {
    min-width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 6px;
}

.logo h2 {
    font-size: 1.1rem;
    font-weight: 400;
}

.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    transition: background 0.2s;
}

.toggle-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.nav-menu {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item svg {
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent);
    color: #ffffff;
}

.user-profile {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    overflow: hidden;
}

.avatar {
    min-width: 32px;
    height: 32px;
    background: var(--surface-hover);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
}

.user-info p {
    font-size: 0.85rem;
    font-weight: 500;
}

/* --- Center Content --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    min-width: 0;
    /* allows flex shrinking */
}

.top-header {
    height: 68px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border);
}

.month-selector {
    display: flex;
    align-items: center;
    gap: 16px;
}

.month-selector h1 {
    font-size: 1.25rem;
    font-weight: 600;
    min-width: 150px;
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

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

/* Content Sections */
.section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
}

.hidden {
    display: none !important;
}

/* Calendar */
.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    text-align: right;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding-bottom: 8px;
}

.calendar-header div {
    padding-right: 8px;
}

.calendar-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    /* Fill vertical space */
    background: var(--border);
    gap: 1px;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow-y: auto;
}

.calendar-day {
    background: var(--bg);
    padding: 8px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: background 0.2s;
    min-height: 0;
    overflow: hidden;
}

.calendar-day:hover {
    background: var(--surface);
}

.calendar-day.sunday {
    background: var(--surface-hover);
    cursor: default;
}

.calendar-day.sunday:hover {
    background: var(--surface-hover);
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.empty:hover {
    background: transparent;
}

.day-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.day-number {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.calendar-day.today .day-number {
    color: var(--bg);
    background: var(--accent);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.holiday-label {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    margin-left: 4px;
}

.shift-card {
    background: var(--surface);
    border-radius: 6px;
    padding: 6px;
    margin-bottom: 4px;
    font-size: 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
    cursor: pointer;
    border-left: 4px solid var(--accent);
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    transition: transform 0.1s, filter 0.1s;
}

.shift-card:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
}

.shift-card.unconfirmed {
    background: repeating-linear-gradient(-45deg,
            rgba(255, 255, 255, 0.03),
            rgba(255, 255, 255, 0.03) 10px,
            rgba(255, 255, 255, 0) 10px,
            rgba(255, 255, 255, 0) 20px);
    border: 1px dashed var(--warning);
    border-left: 4px solid var(--warning) !important;
}

.sc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sc-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-rate {
    font-family: var(--font-main);
    color: var(--text-secondary);
}

.sc-total {
    font-weight: 600;
    color: var(--success);
}

/* --- Hamburger Animation --- */
.hamburger-btn {
    background: transparent;
    border: none;
    width: 20px;
    height: 14px;
    position: relative;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

.hamburger-btn .line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger-btn .line-1 {
    top: 0;
    transform-origin: left center;
}

.hamburger-btn .line-2 {
    top: 50%;
    transform: translateY(-50%);
}

.hamburger-btn .line-3 {
    bottom: 0;
    transform-origin: left center;
}

.hamburger-btn.open .line-1 {
    transform: rotate(-45deg);
    top: 50%;
    margin-top: -1px;
    width: 50%;
}

.hamburger-btn.open .line-2 {
    opacity: 1;
}

.hamburger-btn.open .line-3 {
    transform: rotate(45deg);
    bottom: 50%;
    margin-bottom: -1px;
    width: 50%;
}

/* --- Navigation --- */
.right-sidebar {
    width: 320px;
    background: transparent;
    border-left: none;
    display: flex;
    flex-direction: column;
}

.right-sidebar.hidden {
    display: none !important;
}

.rs-header {
    height: 68px;
    display: flex;
    align-items: center;
    padding: 0 0 0 24px;
    border-bottom: none;
    font-size: 1.25rem;
    font-weight: 600;
}

.rs-content {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.metric-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.metric-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.metric-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-value.highlight {
    color: var(--success);
}

.rs-divider {
    height: 1px;
    background: var(--border);
}

/* Buttons & Inputs */
.btn-primary {
    background: var(--accent);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: normal;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: normal;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

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

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: normal;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

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

label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 6px;
    display: block;
}

.setting-group input[type="text"].basic-txt,
.setting-group input[type="number"],
select {
    width: 120px;
    padding: 8px 12px;
    background: var(--bg);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    transition: all 0.2s ease;
    outline: none;
}

/* Hide default number arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

input[type="number"] {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

/* Custom Number Input Wrapper */
.number-input-wrapper {
    display: inline-flex;
    align-items: center;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    height: 36px;
}

.number-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(84, 109, 100, 0.2);
}

.number-input-wrapper button {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    width: 32px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    font-size: 16px;
    font-weight: bold;
}

.number-input-wrapper button:hover {
    background: var(--surface-hover);
}

.number-input-wrapper input[type="number"] {
    border: none;
    background: transparent;
    text-align: center;
    width: 50px;
    padding: 0;
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    font-weight: 600;
}

select,
input[type="text"],
input[type="number"],
input[type="date"] {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 12px;
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
    appearance: none;
}

select {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22%23a1a1aa%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpolyline%20points%3D%226%209%2012%2015%2018%209%22%3E%3C%2Fpolyline%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
}

select:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus {
    border-color: var(--accent);
}

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

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

.modal {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.2s;
}

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

.modal-header {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

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

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 4px;
}

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

.close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.shift-preview {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    margin-top: 8px;
}

.preview-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 4px;
}

.preview-item:last-child {
    margin-bottom: 0;
}

.preview-item.total {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 1rem;
    font-weight: 600;
}

.modal-actions {
    margin-top: 24px;
    display: flex;
    justify-content: space-between;
}

.modal-actions .right-actions {
    display: flex;
    gap: 12px;
}

/* Tables (Ledger) */
.ledger-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.ledger-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    font-weight: 500;
}

.ledger-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.ledger-table tr:last-child td {
    border-bottom: none;
}

.month-dropdown {
    font-family: var(--font-main);
    font-size: 1.5rem;
    color: var(--text-primary);
    background: transparent;
    border: none;
    cursor: pointer;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    text-align: center;
}

.month-dropdown option {
    background: var(--surface);
    color: var(--text-primary);
    font-size: 1rem;
}

/* PDF Upload UI & Paid State */
#pdf-drop-zone.dragover {
    border-color: var(--accent) !important;
    background: var(--surface-hover) !important;
}

.history-item {
    padding: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.payment-match-item {
    margin-bottom: 8px;
    background: var(--surface);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.history-item-left {
    display: flex;
    gap: 16px;
    align-items: center;
}

.history-date-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface-hover);
    border-radius: 8px;
    padding: 8px 12px;
    min-width: 70px;
    border: 1px solid var(--border);
}

.history-item-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Calendar Paid Indicator */
.calendar-day .shift-card.is-paid {
    background: var(--accent);
    color: #fff;
    border-left-color: var(--accent) !important;
    border-color: var(--accent);
}

.calendar-day .shift-card.is-paid .sc-title,
.calendar-day .shift-card.is-paid .sc-rate,
.calendar-day .shift-card.is-paid .sc-total,
.calendar-day .shift-card.is-paid span,
.calendar-day .shift-card.is-paid label {
    color: #fff !important;
}

/* Settings Grid Default */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

/* Default Agency Grid */
.agency-grid-responsive {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Mobile Overlay */
#mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    transition: opacity 0.3s;
}

.mobile-weekday {
    display: none;
}

/* Responsive Overrides */
/* Base rule to hide mobile elements on desktop */
.mobile-dots-container,
.mobile-paid-tick {
    display: none;
}

@media (max-width: 768px) {
    .mobile-paid-tick {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 14px;
        height: 14px;
        background: var(--success);
        color: #fff;
        border-radius: 50%;
        margin-left: 4px;
        margin-top: 2px;
    }

    body {
        overflow: hidden;
        height: 100dvh;
        min-height: 100dvh;
    }

    .app-container,
    .main-content {
        height: 100dvh;
        min-height: 100dvh;
        overflow: hidden;
    }

    .section {
        overflow-y: auto;
        height: 100%;
        padding-bottom: 80px !important;
    }

    #calendar-view {
        overflow-y: hidden !important;
    }

    #payments-section {
        overflow-y: hidden !important;
        display: flex;
        flex-direction: column;
    }
    
    #payments-section > div {
        overflow-y: auto;
        flex: 1;
        padding-bottom: 80px;
    }

    /* Hide Sidebar and top menu button entirely */
    .sidebar {
        display: none !important;
    }

    #mobile-menu-btn {
        display: none !important;
    }

    /* Bottom Navigation Styles */
    #mobile-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 64px;
        background: var(--surface);
        border-top: 1px solid var(--border);
        display: flex !important;
        justify-content: space-around;
        align-items: center;
        z-index: 50;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        color: var(--text-secondary);
        border-radius: 50%;
        cursor: pointer;
        transition: color 0.2s, background 0.2s;
    }

    .nav-btn.active {
        color: var(--accent);
    }

    .nav-btn.add-btn {
        background: var(--accent);
        color: var(--bg);
        width: 56px;
        height: 56px;
        transform: translateY(-16px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .app-container {
        flex-direction: column;
        padding-bottom: 70px;
        /* space for bottom nav */
    }

    .calendar-container {
        flex-direction: column !important;
    }

    .right-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: 85% !important;
        height: 100dvh !important;
        border-left: 1px solid var(--border) !important;
        border-top: none !important;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        display: flex !important;
        flex-direction: column !important;
        background: var(--bg);
        will-change: transform;
    }

    .right-sidebar.drawer-open {
        transform: translateX(0);
        box-shadow: -4px 0 15px rgba(0, 0, 0, 0.2);
    }

    .right-sidebar .rs-header {
        padding: 24px 20px 16px 20px;
    }

    .right-sidebar .rs-content {
        display: flex !important;
        flex-direction: column !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        gap: 0 !important;
        padding: 0 20px 120px 20px !important;
        /* padding for bottom nav */
    }

    .right-sidebar .rs-content>div {
        margin-bottom: 8px !important;
    }

    .rs-handle {
        position: absolute;
        top: 50%;
        left: -20px;
        width: 20px;
        height: 60px;
        background: var(--surface);
        border: 1px solid var(--border);
        border-right: none;
        border-radius: 8px 0 0 8px;
        transform: translateY(-50%);
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: -2px 0 5px rgba(0, 0, 0, 0.05);
        cursor: grab;
        touch-action: none;
        /* Prevent vertical scrolling on handle */
    }

    .rs-handle:active {
        cursor: grabbing;
    }

    .rs-handle .handle-bar {
        width: 4px;
        height: 30px;
        background: var(--border);
        border-radius: 2px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .settings-card {
        grid-column: 1 / -1 !important;
    }

    .settings-card>div[style*="display: flex"] {
        flex-wrap: wrap;
    }

    .settings-card>div[id$="-list"] {
        max-height: none !important;
        overflow-y: visible !important;
    }

    .agency-grid-responsive {
        grid-template-columns: 1fr;
    }

    .calendar-header {
        display: grid !important;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        font-size: 0.7rem;
    }

    .calendar-grid {
        display: grid !important;
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
        grid-auto-rows: 1fr !important;
        background: var(--border);
        border: 1px solid var(--border);
        gap: 1px;
        overflow: hidden;
        /* Prevent internal scroll */
    }

    .calendar-day.empty {
        display: flex !important;
        background: transparent;
    }

    .calendar-day {
        min-height: 0;
        padding: 4px;
        background: var(--bg);
        border: none;
        border-radius: 0;
        align-items: center;
        justify-content: flex-start;
    }

    .mobile-weekday {
        display: none !important;
    }

    .calendar-day .day-number {
        font-size: 0.85rem;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        margin-bottom: 4px;
    }

    .calendar-day.today .day-number {
        background: var(--accent);
        color: var(--bg);
        font-weight: bold;
    }

    .calendar-day.selected .day-number {
        background: var(--surface-hover);
        color: var(--text-primary);
    }

    .calendar-day.today.selected .day-number {
        background: var(--accent);
        box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
    }

    /* Hide full shift cards on mobile calendar */
    .calendar-day .shift-card {
        display: none !important;
    }

    /* Show mobile dots container */
    .mobile-dots-container {
        display: flex;
        flex-direction: column;
        gap: 2px;
        align-items: center;
        width: 100%;
    }

    .mobile-shift-pill {
        width: 100%;
        max-width: 40px;
        font-size: 0.55rem;
        font-weight: bold;
        color: white;
        text-align: center;
        border-radius: 4px;
        padding: 1px 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Mobile Day Details Section */
    #mobile-day-details .shift-card {
        display: flex !important;
        /* show cards in details section */
        flex-direction: column;
        padding: 16px;
        font-size: 0.95rem;
        background: var(--surface-hover);
        border-left-width: 6px;
        margin-bottom: 8px;
        position: relative;
    }

    .holiday-label {
        font-size: 0.6rem;
        padding: 1px 4px;
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.top-header {
    flex-wrap: wrap;
    padding: 12px;
}

/* Bottom Sheet Modal for Mobile */
.modal-container {
    align-items: flex-end;
}

.modal {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 24px;
    border-radius: 24px 24px 0 0;
    animation: slideUp 0.3s ease forwards;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-body {
    max-height: 100%;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

/* Payment history smaller on mobile */
.history-item {
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.history-item-left {
    gap: 12px;
}

.history-date-box {
    min-width: 55px;
    padding: 6px 8px;
}

.history-date-box span:nth-child(2) {
    font-size: 1.15rem !important;
    /* The day number */
}

.payment-match-item>div:last-child {
    align-self: flex-end;
}

.setting-action-btn {
    padding: 10px !important;
}

.setting-action-btn svg {
    width: 18px;
    height: 18px;
}
}

@media (min-width: 769px) {
    .mobile-shift-pill {
        display: none !important;
    }
}