:root {
    /* Base Color Palette (Light - based on screenshot) */
    --bg-color: #f2f5fd;
    /* Soft blueish white */
    --card-bg: #ffffff;
    --text-color: #1c1c1e;
    --text-muted: #8e9bb0;
    --border-color: transparent;

    --primary: #8a4bff;
    /* Purple accent */
    --primary-light: rgba(138, 75, 255, 0.1);

    --shift-1-color: #ff527b;
    /* Pink */
    --shift-2-color: #00d2b9;
    /* Green/Teal */

    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.04);
    --shadow-fab: 0 8px 20px rgba(0, 0, 0, 0.2);
    --shadow-nav: 0 4px 25px rgba(0, 0, 0, 0.06);

    --cell-active: #000000;
    --cell-text-active: #ffffff;
    --cell-bg: transparent;
}

[data-theme="dark"] {
    --bg-color: #0b0c10;
    --card-bg: #15161b;
    --text-color: #ffffff;
    --text-muted: #727a8a;
    --border-color: transparent;

    --primary: #9d6cff;
    --primary-light: rgba(157, 108, 255, 0.15);

    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-fab: 0 8px 20px rgba(0, 0, 0, 0.6);
    --shadow-nav: 0 4px 25px rgba(0, 0, 0, 0.4);

    --cell-active: #ffffff;
    --cell-text-active: #000000;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    padding-bottom: 110px;
    min-height: 100vh;
    transition: background-color 0.3s ease;
}

#app {
    padding: 110px 20px 24px 20px;
    max-width: 500px;
    margin: 0 auto;
}

/* Typography elements */
.welcome-text {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
}

.page-title {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 24px;
    letter-spacing: -0.5px;
}

/* Header & Theme Toggle */
.overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.theme-toggle {
    background: var(--card-bg);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: transform 0.2s;
}

.theme-toggle:active {
    transform: scale(0.9);
}

.screen {
    display: none;
    animation: fadeIn 0.4s ease;
}

.screen.active {
    display: block;
}

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

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

/* Dashboard Overview Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 30px;
}

.dash-card {
    border-radius: 20px;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.dash-value {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

.dash-title {
    font-size: 13px;
    font-weight: 600;
}

.bg-purple {
    background-color: #f4f0ff;
}

.bg-orange {
    background-color: #fff4ed;
}

.bg-blue {
    background-color: #ebf5fb;
}

.bg-green {
    background-color: #eafaf1;
}

[data-theme="dark"] .bg-purple {
    background-color: rgba(138, 75, 255, 0.15);
}

[data-theme="dark"] .bg-orange {
    background-color: rgba(255, 159, 67, 0.15);
}

[data-theme="dark"] .bg-blue {
    background-color: rgba(41, 128, 185, 0.15);
}

[data-theme="dark"] .bg-green {
    background-color: rgba(39, 174, 96, 0.15);
}

/* Calendar Section */
.calendar-container {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow-soft);
    margin-bottom: 24px;
}

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

.calendar-title-wrap h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.calendar-nav {
    display: flex;
    gap: 12px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: color 0.2s;
}

.icon-btn:active {
    color: var(--text-color);
}

.calendar-grid-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 50px;
    gap: 8px 0;
}

.calendar-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
}

.calendar-cell .day-number {
    font-size: 16px;
    font-weight: 600;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
}

.calendar-cell.inactive .day-number {
    color: var(--text-muted);
    opacity: 0.4;
}

/* Selected / Today State */
.calendar-cell.today .day-number {
    background-color: var(--cell-active);
    color: var(--cell-text-active);
}

/* Shift Markers (Dots) */
.shift-dots {
    display: flex;
    gap: 4px;
    position: absolute;
    bottom: 2px;
}

.dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.dot.type-1 {
    background-color: var(--shift-1-color);
}

.dot.type-2 {
    background-color: var(--shift-2-color);
}

.dot.half {
    border-radius: 5px 0 0 5px;
    width: 2.5px;
}

.dot.penalty {
    background-color: var(--text-muted);
}

/* Floating Bottom Navigation */
.bottom-nav-wrapper {
    position: fixed;
    bottom: 24px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    z-index: 100;
    padding: 0 20px;
}

.tabs-floating {
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 400px;
    border-radius: 40px;
    padding: 10px 24px;
    box-shadow: var(--shadow-nav);
    position: relative;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    width: 40px;
    height: 40px;
}

.tab-btn svg.icon {
    width: 24px;
    height: 24px;
}

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

/* Center Black FAB */
.fab-center {
    background: var(--cell-active);
    color: var(--cell-text-active);
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-fab);
    cursor: pointer;
    transition: transform 0.2s;
    margin: 0 10px;
}

.fab-center:active {
    transform: scale(0.9);
}


/* Lists and Items */
.list-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.list-item {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.list-item:active {
    transform: scale(0.98);
}

.list-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: var(--primary);
    border-radius: 4px 0 0 4px;
}

/* Variations based on shift type */
.list-item.shift-type-1::before {
    background-color: var(--shift-1-color);
}

.list-item.shift-type-2::before {
    background-color: var(--shift-2-color);
}

.list-item-left .date {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 6px;
}

.list-item-left .details {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

.list-item-right {
    text-align: right;
}

.list-item-right .salary {
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 4px;
}

.list-item-right .subtext {
    font-size: 12px;
    color: var(--text-muted);
}

/* Payouts Grouping */
.payout-group {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-soft);
}

.payout-header {
    font-weight: 800;
    font-size: 18px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.payout-header::before {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--primary);
}

.payout-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
}

.payout-total {
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    font-size: 20px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed rgba(142, 155, 176, 0.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    align-items: flex-end;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-color);
    width: 100%;
    padding: 30px 24px;
    border-radius: 32px 32px 0 0;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding-bottom: calc(30px + env(safe-area-inset-bottom));
}

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

    to {
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 16px 20px;
    border-radius: 16px;
    border: none;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 16px;
    font-weight: 500;
    outline: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.form-group input[type="date"] {
    position: relative;
    text-align: left;
    appearance: none;
    -webkit-appearance: none;
}

.form-group input[type="date"]::-webkit-date-and-time-value {
    text-align: left;
}

.form-group input:focus,
.form-group select:focus {
    box-shadow: 0 0 0 2px var(--primary);
}

/* Segmented Control */
.segmented-control {
    display: flex;
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 6px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
    gap: 4px;
}

.segment-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 14px 8px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.segment-btn.active {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Form Buttons */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 32px;
}

.main-btn {
    width: 100%;
    background: var(--primary);
    color: #ffffff;
    border: none;
    padding: 18px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-soft);
    transition: opacity 0.2s;
}

.main-btn:active {
    opacity: 0.8;
}

.danger-btn {
    width: 100%;
    background: rgba(255, 82, 123, 0.1);
    color: var(--shift-1-color);
    border: none;
    padding: 18px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.secondary-btn {
    width: 100%;
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 18px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}