:root {
    /* Darker color scheme inspired by reference */
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --surface: #242424;
    --surface-hover: #2d2d2d;

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    /* Accents */
    --accent-teal: #4db8b8;
    --accent-teal-hover: #5fcfcf;
    --accent-orange: #ff7a4d;
    --accent-orange-hover: #ff9470;

    /* Status colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    /* Borders */
    --border-color: #333333;
    --border-hover: #444444;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
    --glow-teal: 0 0 20px rgba(77, 184, 184, 0.3);
    --glow-orange: 0 0 20px rgba(255, 122, 77, 0.3);

    /* Spacing */
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 0px;
    --right-sidebar-width: 320px;
    --right-sidebar-min-width: 250px;
    --right-sidebar-max-width: 600px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Dashboard Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr 0;
    grid-template-rows: 1fr auto;
    grid-template-areas:
        "sidebar main rightsidebar"
        "sidebar footer footer";
    min-height: 100vh;
    transition: grid-template-columns 0.3s ease;
}

.dashboard-layout.right-sidebar-active {
    grid-template-columns: var(--sidebar-width) 1fr var(--right-sidebar-width);
}

.dashboard-layout.sidebar-collapsed {
    grid-template-columns: var(--sidebar-collapsed-width) 1fr;
}

/* Left Sidebar */
.left-sidebar {
    grid-area: sidebar;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    transition: transform 0.3s ease;
    z-index: 100;
}

.sidebar-collapsed .left-sidebar {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(var(--glow-orange));
}

.sidebar-branding h1 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    background: linear-gradient(135deg, var(--accent-teal), var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-branding p {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

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

.nav-item.active {
    background: var(--surface);
    color: var(--accent-teal);
    border-left-color: var(--accent-teal);
    box-shadow: var(--glow-teal);
}

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

.nav-label {
    font-size: 0.9375rem;
    font-weight: 500;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px 0;
    border-top: 1px solid var(--border-color);
}

.toggle-mode {
    width: 100%;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

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

/* Sidebar Toggle Button */
.sidebar-toggle {
    position: fixed;
    left: 16px;
    top: 16px;
    z-index: 101;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sidebar-toggle:hover {
    background: var(--surface-hover);
    box-shadow: var(--shadow-md);
}

.sidebar-collapsed .sidebar-toggle {
    display: flex;
}

/* Main Content */
.main-content {
    grid-area: main;
    padding: 32px;
    min-height: calc(100vh - 60px);
    transition: margin-right 0.3s ease;
}

.right-sidebar.active~.main-content {
    margin-right: var(--right-sidebar-width);
}

/* Right Sidebar (Contextual) */
.right-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    padding: 0;
    overflow: hidden;
    transition: width 0.3s ease, padding 0.3s ease;
}

.right-sidebar.active {
    width: var(--right-sidebar-width);
    padding: 24px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.sidebar-close {
    position: absolute;
    right: 16px;
    top: 16px;
    font-size: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    background: var(--surface);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.sidebar-close:hover {
    color: var(--danger);
    background: var(--surface-hover);
}

/* Footer */
.app-footer {
    grid-area: footer;
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

/* Container & Common Elements  */
.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Buttons */
.btn-primary {
    background: var(--accent-teal);
    color: #000;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--accent-teal-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--glow-teal);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-delete,
.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--danger);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-delete:hover,
.btn-danger:hover {
    background: var(--danger);
    color: #fff;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.summary-card {
    background: linear-gradient(135deg, var(--surface) 0%, var(--bg-secondary) 100%);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.summary-card h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    font-weight: 600;
}

.summary-card p {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-teal);
    margin: 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 0 1fr;
    }

    .left-sidebar {
        transform: translateX(-100%);
    }

    .sidebar-toggle {
        display: flex;
    }

    .dashboard-layout.sidebar-collapsed .left-sidebar {
        transform: translateX(0);
    }

    .main-content {
        padding: 20px;
    }

    .right-sidebar {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: 16px;
    }

    .summary-cards {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   CALENDAR SPECIFIC STYLES
   ============================================ */

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    gap: 16px;
    flex-wrap: wrap;
}

.dashboard-header h2 {
    margin: 0;
    font-weight: 600;
    font-size: 1.75rem;
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.nav-btn {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-block;
}

.nav-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

/* Calendar Grid */
.calendar-grid {
    background: var(--surface);
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 32px;
}

.calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-color);
}

.calendar-day-name {
    padding: 16px;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calendar-body {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: var(--border-color);
}

.calendar-day {
    background: var(--surface);
    min-height: 120px;
    padding: 10px;
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
}

.calendar-day:hover {
    background: var(--surface-hover);
    box-shadow: inset 0 0 0 2px var(--accent-teal);
}

.calendar-day.other-month {
    opacity: 0.4;
}

.calendar-day.today {
    background: linear-gradient(135deg, rgba(77, 184, 184, 0.1), rgba(255, 122, 77, 0.1));
    border: 2px solid var(--accent-teal);
}

.day-number {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.calendar-day.today .day-number {
    color: var(--accent-teal);
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.event-badge {
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    gap: 6px;
    align-items: center;
    border-left: 3px solid;
}

.event-badge:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.event-time {
    font-weight: 600;
    white-space: nowrap;
}

.event-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.event-more {
    font-size: 0.6875rem;
    color: var(--text-muted);
    padding: 2px 8px;
    font-style: italic;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--surface);
    padding: 32px;
    border-radius: 16px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

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

.modal-close {
    position: absolute;
    right: 16px;
    top: 16px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.modal-close:hover {
    color: var(--danger);
    background: var(--bg-secondary);
}

.modal-content h3 {
    margin: 0 0 24px;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.modal-content .entry-form {
    box-shadow: none;
    padding: 0;
    border: none;
    background: transparent;
}

/* Forms */
.entry-form {
    background: var(--surface);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.9375rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-teal);
    box-shadow: 0 0 0 3px rgba(77, 184, 184, 0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
}

input[type="color"] {
    height: 45px;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.6;
    cursor: pointer;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

th,
td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

tbody tr {
    transition: background-color 0.2s ease;
}

tbody tr:hover {
    background-color: var(--surface-hover);
}

/* Budget Styles */
.budget-breakdown {
    margin-bottom: 32px;
}

.budget-section {
    margin-bottom: 32px;
}

.budget-section h4 {
    margin: 0 0 16px;
    font-size: 1.125rem;
    font-weight: 600;
}

.budget-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.budget-category-card {
    background: var(--surface);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.budget-category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

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

.category-name {
    font-weight: 600;
    color: var(--text-primary);
}

.category-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-teal);
}

.progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    background: linear-gradient(90deg, var(--accent-teal), var(--accent-orange));
}

.category-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

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

/* Utility Classes */
.text-success {
    color: var(--success);
}

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

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

.text-teal {
    color: var(--accent-teal);
}

.text-orange {
    color: var(--accent-orange);
}


/* ============================================
   WORK HOURS SPECIFIC STYLES
   ============================================ */

.entries-list {
    margin-bottom: 32px;
}

.entries-list h3 {
    margin-bottom: 20px;
    font-size: 1.25rem;
    font-weight: 600;
}

.quick-timer-section {
    margin-bottom: 32px;
}

.quick-timer-section h3 {
    margin-bottom: 16px;
    font-size: 1.25rem;
    font-weight: 600;
}

.timer-card {
    background: var(--surface);
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.timer-display {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-teal);
    margin-bottom: 20px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}

.timer-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
}

.btn-timer {
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.timer-status {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    min-height: 24px;
}

.timer-status.active {
    color: var(--accent-teal);
}

.timer-status.success {
    color: var(--success);
}

.add-entry {
    margin-bottom: 32px;
}

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

.section-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.settings-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.settings-link:hover {
    color: var(--accent-teal);
}

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Make sure summary cards work properly */
.summary-cards .card h3 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
    font-weight: 600;
}

.summary-cards .card p {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-teal);
    margin: 0;
}
/* Resize Handle for Right Sidebar */
.resize-handle {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    cursor: col-resize;
    background: transparent;
    z-index: 10;
    transition: background 0.2s ease;
}

.resize-handle:hover,
.resize-handle.resizing {
    background: var(--accent-teal);
}

.resize-handle::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 40px;
    background: var(--border-color);
    border-radius: 2px;
}

.resize-handle:hover::before,
.resize-handle.resizing::before {
    background: var(--accent-teal);
}


/* Disable transitions during sidebar resize for instant feedback */
body.resizing-sidebar .dashboard-layout,
body.resizing-sidebar .right-sidebar {
    transition: none !important;
}


/* Settings Page Styling */
.settings-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.settings-section h3 {
    margin: 0 0 8px 0;
    color: var(--text-primary);
    font-size: 1.125rem;
}

.form-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9375rem;
}

.form-group input,
.form-group select,
.form-input {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-input:focus {
    outline: none;
    border-color: var(--accent-teal);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-teal);
}

.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert-success {
    background: rgba(77, 184, 184, 0.1);
    border: 1px solid var(--accent-teal);
    color: var(--accent-teal);
}

.alert-info {
    background: rgba(100, 100, 100, 0.1);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

