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

:root {
    --bg: #ffffff;
    --surface: #f8fafc;
    --border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent: #0d9488;
    --accent-hover: #0f766e;
    --accent-light: #ccfbf1;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --radius: 6px;
    --transition: 0.15s ease;
}

.dark {
    --bg: #0f172a;
    --surface: #1e293b;
    --border: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-light: #134e4a;
    --danger: #f87171;
    --danger-hover: #fca5a5;
}

body, html {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 24px;
    transition: background var(--transition), color var(--transition);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ==================== HEADER ==================== */
header {
    margin-bottom: 32px;
}

.luxury-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    gap: 20px;
    flex-wrap: wrap;
}

.header-left {
    flex: 1;
    min-width: 200px;
}

.luxury-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

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

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.875rem;
}

.user-icon {
    color: var(--accent);
}

.user-name {
    font-weight: 500;
    color: var(--text-primary);
}

.language-selector {
    position: relative;
}

.language-selector select {
    padding: 8px 32px 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
}

.language-selector::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid var(--text-secondary);
    pointer-events: none;
}

.theme-btn,
.luxury-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-primary);
}

.theme-btn:hover,
.luxury-btn:hover {
    background: var(--surface);
    border-color: var(--accent);
    color: var(--accent);
}

.theme-btn svg,
.luxury-btn svg {
    width: 16px;
    height: 16px;
}

.luxury-btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.luxury-btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    color: white;
}

.luxury-btn-danger:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* ==================== TABS ==================== */
.tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.tab {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 12px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab svg {
    width: 18px;
    height: 18px;
}

.tab:hover {
    color: var(--accent);
}

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==================== STATS ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* ==================== CHARTS ==================== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.chart-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.chart-container canvas {
    max-height: 280px;
}

/* ==================== FORMS & CARDS ==================== */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.form-card h3 {
    margin-bottom: 16px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color var(--transition);
}

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

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* ==================== BUTTONS ==================== */
.btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn svg {
    width: 16px;
    height: 16px;
}

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

.btn-primary {
    width: 100%;
    justify-content: center;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

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

.btn-delete,
.btn-edit {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 4px;
    transition: color var(--transition);
    display: inline-flex;
    align-items: center;
}

.btn-delete:hover,
.btn-edit:hover {
    color: var(--accent);
}

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

.btn-delete svg,
.btn-edit svg {
    width: 16px;
    height: 16px;
}

/* ==================== LISTS ==================== */
.management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

.list {
    margin-top: 16px;
    max-height: 400px;
    overflow-y: auto;
}

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

.list-item-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.list-item-content strong {
    word-break: break-word;
    font-weight: 500;
}

.list-item-content small {
    color: var(--text-secondary);
    font-size: 0.8rem;
    white-space: nowrap;
}

.color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    white-space: nowrap;
}

.list-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==================== ENTRIES ==================== */
.entry-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.entry-form-column,
.entry-list-column {
    display: flex;
    flex-direction: column;
}

.entry-form-column .form-card {
    margin-bottom: 0;
}

.recent-entries {
    margin-top: 0;
}

.recent-entries h3 {
    margin-bottom: 16px;
    font-size: 1rem;
    font-weight: 600;
}

.entry-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.entry-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.entry-header strong {
    font-weight: 500;
}

.entry-duration {
    margin-left: auto;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
}

.entry-date {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.entry-notes {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.entry-actions {
    margin-top: 12px;
    text-align: right;
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 32px 20px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px dashed var(--border);
    font-size: 0.9rem;
}

/* ==================== ENTRIES LIST (all entries tab) ==================== */
.entries-controls {
    margin-bottom: 20px;
}

.filter-controls {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.filter-controls label {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.filter-controls input[type="date"],
.filter-controls input[type="text"] {
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* ==================== REPORTS ==================== */
.report-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    align-items: center;
}

.report-controls select,
.report-controls input {
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.report-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.report-total {
    font-size: 1.25rem;
    color: var(--accent);
    font-weight: 700;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
}

.report-table th,
.report-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.report-table th {
    background: var(--bg);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

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

.report-table tr:hover td {
    background: var(--bg);
}

/* ==================== CHECKBOX ==================== */
.checkbox-label {
    display: flex !important;
    align-items: center;
    cursor: pointer;
    font-weight: normal !important;
    margin-bottom: 0 !important;
    color: var(--text-primary) !important;
    font-size: 0.9rem !important;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    accent-color: var(--accent);
    cursor: pointer;
}

/* ==================== MODALS ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    margin: 5% auto;
    width: 90%;
    max-width: 480px;
    border: 1px solid var(--border);
    animation: modalFadeIn 0.2s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
    border-radius: 4px;
    line-height: 1;
    transition: color var(--transition);
}

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

.modal .form-group {
    margin-bottom: 16px;
}

.modal .form-group:last-of-type {
    margin-bottom: 0;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.modal .btn {
    flex: 0 0 auto;
}

/* ==================== NOTIFICATIONS ==================== */
#notificationContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1100;
    max-width: 360px;
}

.notification {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-left: 3px solid;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.25s ease;
    font-size: 0.9rem;
    border: 1px solid var(--border);
}

.notification.success {
    border-left-color: var(--accent);
}

.notification.error {
    border-left-color: var(--danger);
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .entry-layout {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        padding: 16px;
    }
    
    .luxury-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .header-controls {
        width: 100%;
    }
    
    .luxury-title {
        font-size: 1.5rem;
    }
    
    .tabs {
        gap: 0;
    }
    
    .tab {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .tab span:not(.tab-icon) {
        display: none;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .management-grid {
        grid-template-columns: 1fr;
    }
    
    .report-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .report-controls select,
    .report-controls input,
    .report-controls .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .tab span:not(.tab-icon) {
        display: none;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==================== LOGIN PAGE ==================== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.login-subtitle {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
    font-size: 0.9rem;
}

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

.login-card .btn {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
    font-size: 1rem;
}

.login-links {
    text-align: center;
    margin-top: 20px;
}

.login-links a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
}

.login-links a:hover {
    text-decoration: underline;
}

/* ==================== THEME TOGGLE ICON ==================== */
#themeToggle {
    background: none;
    border: 1px solid var(--border);
    padding: 8px;
    cursor: pointer;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

#themeToggle svg {
    width: 18px;
    height: 18px;
    color: var(--text-primary);
}

#themeToggle:hover {
    border-color: var(--accent);
}

#themeToggle:hover svg {
    color: var(--accent);
}

/* ==================== FOOTER ==================== */
footer {
    margin-top: 48px;
    padding: 24px 0;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

footer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

footer a:hover {
    text-decoration: underline;
}
