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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    color: #000000;
    padding: 0;
    line-height: 1.6;
    display: flex;
    justify-content: center;
}

/* Sidebar Styles */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    background: #f5f5f5;
    border-right: 1px solid #e5e5e5;
    transition: width 0.3s ease;
    width: 50px;
    z-index: 100;
}

.sidebar.open {
    width: 220px;
}

.sidebar-toggle {
    padding: 15px;
    cursor: pointer;
    text-align: center;
    font-size: 1.2em;
    border-bottom: 1px solid #e5e5e5;
    background: #ffffff;
}

.sidebar-toggle:hover {
    background: #f5f5f5;
}

.sidebar-content {
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.menu-item {
    padding: 12px 13px;
    cursor: pointer;
    font-size: 0.95em;
    color: #000000;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    position: relative;
}

.menu-item-text {
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.sidebar:not(.open) .menu-item-text {
    opacity: 0;
    pointer-events: none;
}

.menu-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.menu-item:hover {
    background: #e5e5e5;
}

.menu-item.active {
    background: #000000;
    color: #ffffff;
    font-weight: 600;
}

.menu-item.active .menu-icon {
    filter: brightness(0) invert(1);
}

.container {
    margin-left: 50px;
    padding: 40px 20px;
    transition: margin-left 0.3s ease;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    width: 66.666%;
}

.sidebar.open ~ .container {
    margin-left: auto;
    margin-right: auto;
}

header {
    background: #ffffff;
    padding: 40px 0;
    margin-bottom: 40px;
    border-bottom: 1px solid #e5e5e5;
}

h1 {
    font-size: 2em;
    margin-bottom: 8px;
    font-weight: 600;
    color: #000000;
}

.subtitle {
    color: #737373;
    font-size: 0.95em;
    font-weight: 400;
    margin-bottom: 16px;
}

.current-date {
    font-size: 1.5em;
    font-weight: 700;
    color: #000000;
    margin-top: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: #f5f5f5;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
}

.stat-label {
    color: #737373;
    font-size: 0.85em;
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    font-size: 2em;
    font-weight: 600;
    color: #000000;
    display: flex;
    align-items: center;
}

.stat-icon {
    width: 32px;
    height: 32px;
    vertical-align: middle;
    margin-right: 8px;
    flex-shrink: 0;
}

.client-stat-value {
    display: flex;
    align-items: center;
    gap: 8px;
}

.client-controls {
    display: flex;
    gap: 12px;
    margin-left: auto;
}

.client-btn {
    width: 36px;
    height: 36px;
    background: #ffffff;
    border: 2px solid #e5e5e5;
    color: #000000;
    border-radius: 6px;
    font-size: 1.2em;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.client-btn:first-child {
    justify-content: flex-start;
    padding-left: 6px;
}

.client-btn:last-child {
    justify-content: flex-end;
    padding-right: 6px;
}

.client-btn:hover {
    background: #f5f5f5;
    border-color: #000000;
}

.client-btn:active {
    background: #e5e5e5;
}

.arrow-icon {
    width: 20px;
    height: 20px;
}

.card {
    background: #f5f5f5;
    padding: 32px;
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid #e5e5e5;
    width: 100%;
    overflow: visible;
}

h2 {
    color: #000000;
    margin-bottom: 24px;
    font-size: 1.4em;
    font-weight: 600;
}

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

label,
.form-label {
    display: block;
    margin-bottom: 8px;
    color: #000000;
    font-weight: 500;
    font-size: 0.9em;
}

input[type="date"],
input[type="time"],
input[type="number"],
input[type="text"],
textarea {
    width: 100%;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    color: #000000;
    font-size: 0.95em;
    font-family: inherit;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #000000;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.timeframe-select {
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    color: #000000;
    font-size: 0.9em;
    cursor: pointer;
}

.timeframe-select:focus {
    outline: none;
    border-color: #000000;
}

/* Custom Dropdown Styles */
.mood-dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
}

.mood-dropbtn {
    width: 100%;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    color: #000000;
    font-size: 0.95em;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mood-dropbtn:hover {
    border-color: #000000;
}

.mood-dropdown-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    width: 100%;
    box-shadow: 0px 4px 8px 0px rgba(0,0,0,0.1);
    z-index: 1;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    margin-top: 4px;
}

.mood-dropdown-content.show {
    display: block;
}

.mood-dropdown-content a {
    color: #000000;
    padding: 12px;
    text-decoration: none;
    display: block;
    font-size: 0.95em;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.mood-dropdown-content a:hover {
    background-color: #f5f5f5;
}

.mood-dropdown-content a:active {
    background-color: #e5e5e5;
}

.dropdown-arrow {
    font-size: 0.8em;
    color: #737373;
}

.mood-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

.mood-option {
    display: flex;
    align-items: center;
}

.mood-dropdown-content a {
    display: flex;
    align-items: center;
}

/* Task Icons */
.task-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Calendar Styles */
.calendar-grid {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 20px;
    margin-top: 20px;
}

.calendar-months {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding-top: 40px;
}

.calendar-month-label {
    font-size: 0.85em;
    font-weight: 600;
    color: #000000;
    text-transform: uppercase;
    writing-mode: horizontal-tb;
}

.calendar-content {
    overflow-x: visible;
    overflow-y: visible;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 12px;
    padding-left: 0;
}

.calendar-weekday {
    text-align: center;
    font-size: 0.75em;
    font-weight: 600;
    color: #737373;
    text-transform: uppercase;
}

.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 40px;
    position: relative;
}

.calendar-day {
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    min-width: 60px;
    min-height: 60px;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-day-icon {
    width: 40px;
    height: 40px;
    opacity: 0.9;
}

.calendar-day-icon.icon-white {
    filter: brightness(0) invert(1);
}

.calendar-day-icon.icon-black {
    filter: brightness(0);
}

.calendar-day:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 100;
}

.calendar-day.score-excellent {
    background: #000000;
}

.calendar-day.score-good {
    background: #737373;
}

.calendar-day.score-okay {
    background: #ffffff;
    border: 1px solid #e5e5e5;
}

.calendar-day.score-poor {
    background: #ffb3b3;
}

.calendar-day.score-bad {
    background: #ff4444;
}

.calendar-day.today {
    border: 3px solid #000000;
    box-shadow: 0 0 0 1px #000000;
}

.calendar-tooltip {
    position: fixed;
    background: #000000;
    color: #ffffff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10000;
}

.calendar-day:hover .calendar-tooltip {
    opacity: 1;
}

/* Tasks List */
.tasks-list {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 12px;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    margin-bottom: 8px;
    background: #f5f5f5;
    border-radius: 4px;
}

.task-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #ffffff;
    border: 2px solid #e5e5e5;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

.task-checkbox:hover {
    border-color: #000000;
}

.task-checkbox:checked {
    background: #ffffff;
    border-color: #000000;
}

.task-checkbox:checked::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.task-checkbox.todo-type:checked::after {
    background-image: url('/images/check.svg');
}

.task-checkbox.nottodo-type:checked::after {
    background-image: url('/images/wrong.svg');
}

.task-checkbox.critical-type:checked::after {
    background-image: url('/images/frustrated.svg');
}

.task-name {
    flex-grow: 1;
    font-size: 0.95em;
}

.task-completed {
    text-decoration: line-through;
    opacity: 0.6;
}

.daily-score {
    font-size: 1.1em;
    font-weight: 600;
    color: #000000;
    margin-top: 12px;
}

/* Wins List */
.wins-list {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 12px;
    min-height: 60px;
}

.win-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    margin-bottom: 6px;
    background: #f5f5f5;
    border-radius: 4px;
}

.win-text {
    flex-grow: 1;
    font-size: 0.95em;
}

.win-input {
    flex-grow: 1;
    padding: 6px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 0.95em;
}

.delete-btn {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    color: #000000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
}

.delete-btn:hover {
    background: #f5f5f5;
}

.add-btn {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    color: #000000;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9em;
    cursor: pointer;
}

.add-btn:hover {
    background: #f5f5f5;
}

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

button {
    background: #000000;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
}

button:hover {
    background: #262626;
}

button:active {
    background: #404040;
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.secondary-btn {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    color: #000000;
}

.secondary-btn:hover {
    background: #f5f5f5;
}

.chart-container {
    position: relative;
    height: 350px;
    margin-top: 24px;
}

.single-chart-container {
    background: #ffffff;
    padding: 24px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    margin-top: 24px;
    height: 350px;
    position: relative;
}

.single-chart-container canvas {
    width: 100% !important;
    height: 300px !important;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 32px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-tasks-list {
    margin: 20px 0;
}

.modal-task-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    cursor: move;
}

.task-type-selector {
    display: flex;
    gap: 8px;
}

.type-btn {
    width: 36px;
    height: 36px;
    border: 2px solid #e5e5e5;
    background: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: none;
    position: relative;
}

.type-btn:hover {
    /* Removed hover effect */
}

.type-btn.active {
    border-color: #000000;
    border-width: 3px;
}

.modal-task-input {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 0.95em;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.drag-handle {
    cursor: move;
    color: #737373;
    font-size: 1.2em;
}

/* Entry Display */
.entry {
    background: #ffffff;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid #e5e5e5;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e5e5;
}

.entry-date {
    font-size: 1.1em;
    font-weight: 600;
    color: #000000;
}

.entry-actions {
    display: flex;
    gap: 8px;
}

.entry-mood {
    font-size: 0.9em;
    color: #737373;
    font-weight: 500;
}

.entry-metrics {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
    color: #737373;
}

.metric {
    display: flex;
    gap: 6px;
    align-items: center;
}

.metric-label {
    color: #737373;
    font-size: 0.85em;
}

.metric-value {
    color: #000000;
    font-weight: 600;
    font-size: 1em;
}

.entry-section {
    margin-bottom: 12px;
}

.entry-section-title {
    color: #737373;
    font-size: 0.75em;
    text-transform: uppercase;
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.wins,
.challenges,
.notes {
    color: #000000;
    line-height: 1.7;
}

.no-entries {
    text-align: center;
    padding: 60px;
    color: #737373;
    font-size: 0.95em;
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 20px 15px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 2em;
    }

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

    header {
        padding: 28px 0;
    }

    .card {
        padding: 24px;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
}

@media (max-width: 480px) {
    .entry-metrics {
        flex-direction: column;
        gap: 12px;
    }
    
    .container {
        width: 100%;
        padding: 20px 10px;
    }
}