:root {
    --bg-dark: #161616;
    --bg-card: #1e1e1e;
    --brand-red: #e72f3c;
    --brand-red-dark: #c61a27;
    --text-white: #fefefe;
    --text-muted: #acacac;
    --border-color: rgba(255, 255, 255, 0.08);
}

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

body {
    background: var(--bg-dark);
    color: var(--text-white);
    font-family: 'Onest', sans-serif;
    overflow: hidden;
    height: 100vh;
}

h1,h2,h3,h4,h5,h6,.font-rockstar {
    font-family: 'Russo One', sans-serif;
    letter-spacing: 0.5px;
}

::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--brand-red); }

/* Layout */
.app-layout { display: flex; height: 100vh; width: 100vw; }

/* Sidebar */
.sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--bg-dark);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 20;
}
.sidebar-logo { padding: 24px 24px 16px; }
.sidebar-logo-icon {
    width: 32px; height: 32px;
    background: var(--brand-red);
    display: flex; align-items: center; justify-content: center;
    clip-path: polygon(0 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%);
}
.sidebar-content { flex: 1; overflow-y: auto; padding: 0 24px; }
.sidebar-footer {
    padding: 16px 24px;
    font-size: 0.7rem;
    color: #555;
    border-top: 1px solid rgba(255,255,255,0.04);
}

/* Mini calendar */
.mini-cal { margin-bottom: 24px; }
.mini-cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.mini-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: 0.7rem; }
.mini-cal-day {
    padding: 4px 0;
    cursor: pointer;
    transition: all 0.15s;
}
.mini-cal-day:hover { background: var(--brand-red); color: white; }
.mini-cal-day.today { background: var(--brand-red); color: white; box-shadow: 0 0 8px rgba(231,47,60,0.5); }
.mini-cal-day.other { color: #333; }
.mini-cal-day.has-entries { color: var(--brand-red); font-weight: 700; }
.mini-cal-weekday { color: var(--text-muted); padding: 4px 0; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }

/* User card in sidebar */
.sidebar-user {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 0; margin-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-user-avatar {
    width: 36px; height: 36px;
    background: #333; display: flex; align-items: center; justify-content: center;
    font-family: 'Russo One', sans-serif; font-size: 0.7rem;
    border: 1px solid var(--border-color);
}
.sidebar-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-user-name { font-size: 0.85rem; font-weight: 500; }
.sidebar-user-role { font-size: 0.65rem; color: var(--text-muted); }

/* Sidebar nav */
.sidebar-nav { margin-bottom: 24px; }
.sidebar-nav-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; cursor: pointer;
    font-size: 0.85rem; color: var(--text-muted);
    transition: all 0.15s; border-right: 2px solid transparent;
}
.sidebar-nav-item:hover { color: white; background: rgba(255,255,255,0.02); }
.sidebar-nav-item.active {
    color: white;
    border-right-color: var(--brand-red);
    background: linear-gradient(90deg, transparent, rgba(231,47,60,0.05));
}

/* Main area */
.main-area { flex: 1; display: flex; flex-direction: column; height: 100%; overflow: hidden; }

/* Header */
.main-header {
    height: 72px; min-height: 72px;
    border-bottom: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 32px;
    background: var(--bg-dark);
}
.main-header h2 { font-size: 1.6rem; }
.header-nav-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer; transition: all 0.15s;
}
.header-nav-btn:hover { border-color: var(--brand-red); color: var(--brand-red); }
.header-today-btn {
    padding: 4px 12px; height: 32px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer; font-size: 0.85rem; transition: all 0.15s;
}
.header-today-btn:hover { border-color: var(--text-muted); color: white; }
.header-stats {
    display: flex; gap: 24px; font-size: 0.8rem; color: var(--text-muted);
}
.header-stats strong { color: var(--brand-red); }

/* Calendar grid */
.calendar-wrap { flex: 1; overflow: auto; }
.calendar-inner { min-width: 900px; height: 100%; display: flex; flex-direction: column; }

.calendar-header-row {
    display: grid; grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-dark);
    position: sticky; top: 0; z-index: 5;
}
.calendar-header-cell {
    padding: 10px; text-align: right;
    font-size: 0.75rem; font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
    border-right: 1px solid rgba(255,255,255,0.04);
}
.calendar-header-cell.weekend { color: var(--brand-red); }

.calendar-grid {
    display: grid; grid-template-columns: repeat(7, 1fr);
    flex: 1;
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    background: var(--bg-card);
}

.calendar-cell {
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    min-height: 120px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    background: var(--bg-card);
    padding: 0;
}
.calendar-cell:hover { background: rgba(255,255,255,0.02); }
.calendar-cell-day-num {
    padding: 8px 10px 0;
    text-align: right;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.calendar-cell.weekend { background: rgba(0,0,0,0.15); }
.calendar-cell.weekend .calendar-cell-day-num { color: #555; }
.calendar-cell.other-month { background: var(--bg-dark); }
.calendar-cell.other-month .calendar-cell-day-num { color: #333; }

.calendar-cell.today {
    box-shadow: inset 0 0 0 1px var(--brand-red), 0 0 15px rgba(231,47,60,0.15);
}
.calendar-cell.today .calendar-cell-day-num span {
    background: var(--brand-red);
    color: white;
    width: 28px; height: 28px;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700;
    box-shadow: 0 0 10px rgba(231,47,60,0.5);
}

.calendar-cell-entries { padding: 4px 6px; }
.calendar-entry-bar {
    padding: 2px 6px;
    margin-bottom: 2px;
    font-size: 0.65rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-left: 2px solid;
    transition: background 0.15s;
}
.calendar-entry-bar:hover { filter: brightness(1.2); }
.calendar-cell-hours-badge {
    position: absolute; top: 6px; left: 6px;
    font-size: 0.65rem; font-weight: 700;
    padding: 1px 5px;
}
.hours-full { background: rgba(46,204,113,0.2); color: #2ecc71; }
.hours-partial { background: rgba(241,196,15,0.2); color: #f1c40f; }
.hours-over { background: rgba(231,47,60,0.2); color: var(--brand-red); }
.calendar-cell-more {
    font-size: 0.6rem; color: var(--text-muted);
    padding: 0 6px 4px;
}

/* Slide panel (replaces offcanvas) */
.slide-panel {
    position: fixed; top: 0; right: -520px;
    width: 500px; height: 100vh;
    background: var(--bg-dark);
    border-left: 1px solid var(--border-color);
    z-index: 100;
    transition: right 0.3s ease;
    display: flex; flex-direction: column;
    box-shadow: -10px 0 40px rgba(0,0,0,0.5);
}
.slide-panel.open { right: 0; }
.slide-panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
}
.slide-panel-body {
    flex: 1; overflow-y: auto; padding: 20px 24px;
}
.slide-panel-close {
    background: none; border: 1px solid var(--border-color);
    color: var(--text-muted); cursor: pointer;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.slide-panel-close:hover { border-color: var(--brand-red); color: var(--brand-red); }

/* Overlay */
.overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 90; opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
}
.overlay.open { opacity: 1; pointer-events: auto; }

/* Entry cards in panel */
.entry-card-dark {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    margin-bottom: 8px;
    transition: all 0.15s;
}
.entry-card-dark:hover { border-color: rgba(255,255,255,0.15); }

/* Quick Add preview cards */
.qa-preview {
    background: var(--bg-card);
    border: 1px solid rgba(231,47,60,0.2);
    padding: 10px 12px;
    margin-bottom: 6px;
    position: relative;
}
.qa-preview-remove {
    position: absolute; top: 6px; right: 6px;
    background: none; border: none; color: #555;
    cursor: pointer; font-size: 1rem; line-height: 1;
}
.qa-preview-remove:hover { color: var(--brand-red); }
.qa-save-all {
    background: var(--brand-red); color: white;
    border: none; padding: 8px 20px;
    cursor: pointer; font-weight: 600; font-size: 0.85rem;
    clip-path: polygon(0 0,100% 0,100% calc(100% - 6px),calc(100% - 6px) 100%,0 100%);
    transition: background 0.15s;
}
.qa-save-all:hover { background: var(--brand-red-dark); }
.qa-save-all:disabled { opacity: 0.5; cursor: default; }

/* Form styling */
.form-dark-label {
    font-size: 0.75rem; color: var(--text-muted);
    margin-bottom: 4px; display: block;
}
.form-dark-input {
    width: 100%;
    padding: 6px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: white;
    font-size: 0.85rem;
    font-family: 'Onest', sans-serif;
    outline: none;
    transition: border-color 0.15s;
}
.form-dark-input:focus { border-color: var(--brand-red); }
.form-dark-input::placeholder { color: #555; }
select.form-dark-input { cursor: pointer; }
select.form-dark-input option { background: var(--bg-card); color: white; }
textarea.form-dark-input { resize: vertical; }

.btn-red {
    background: var(--brand-red); color: white;
    border: none; padding: 6px 16px;
    cursor: pointer; font-weight: 600; font-size: 0.8rem;
    transition: background 0.15s;
}
.btn-red:hover { background: var(--brand-red-dark); }
.btn-red:disabled { opacity: 0.5; }

.btn-ghost {
    background: none; color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 6px 16px; cursor: pointer;
    font-size: 0.8rem; transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--text-muted); color: white; }

.btn-danger-ghost {
    background: none; color: var(--brand-red);
    border: 1px solid rgba(231,47,60,0.3);
    padding: 6px 16px; cursor: pointer;
    font-size: 0.8rem; transition: all 0.15s;
}
.btn-danger-ghost:hover { border-color: var(--brand-red); background: rgba(231,47,60,0.1); }

/* Badge */
.activity-badge {
    font-size: 0.65rem; font-weight: 600;
    padding: 2px 8px; display: inline-block;
}

/* Section label */
.section-label {
    font-size: 0.65rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-muted); margin-bottom: 10px;
}

/* Divider */
.dark-divider {
    border: none; border-top: 1px solid var(--border-color);
    margin: 16px 0;
}

/* Modal (project) */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 200; display: none;
    align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    width: 420px; max-width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-box-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-box-body { padding: 20px; }
.modal-box-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex; justify-content: flex-end; gap: 8px;
}

/* Admin table */
.admin-table {
    width: 100%; border-collapse: collapse;
    font-size: 0.85rem;
}
.admin-table th {
    text-align: left; padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted); font-size: 0.75rem;
    text-transform: uppercase; letter-spacing: 0.05em;
}
.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}
.admin-table tr:hover td { background: rgba(255,255,255,0.02); }

/* Login page */
.login-container {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-dark);
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 48px; text-align: center;
    width: 420px;
}
.login-card h4 { margin-bottom: 8px; }
.login-card p { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 24px; }
.login-btn {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 32px;
    background: white; color: #333;
    border: none; cursor: pointer;
    font-weight: 600; font-size: 0.95rem;
    transition: all 0.15s;
}
.login-btn:hover { background: #eee; }
.login-btn img { width: 20px; height: 20px; }

/* Loading */
.loading-screen {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    height: 100vh;
}
.loader {
    width: 36px; height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--brand-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Contact fields */
.contact-fields { display: none; }
.contact-fields.visible { display: block; }

/* Hidden utility */
.hidden { display: none !important; }

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.ml-1 { margin-left: 4px; }
.ml-2 { margin-left: 8px; }
.text-xs { font-size: 0.7rem; }
.text-sm { font-size: 0.8rem; }
.text-muted { color: var(--text-muted); }
.text-red { color: var(--brand-red); }
.text-green { color: #2ecc71; }
.text-yellow { color: #f1c40f; }
.fw-bold { font-weight: 700; }

/* Dashboard */
.dash-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 24px;
}
.dash-summary {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
    margin-bottom: 28px;
}
.dash-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 20px 24px;
    text-align: center;
}
.dash-summary-value {
    font-family: 'Russo One', sans-serif;
    font-size: 1.6rem;
    margin-bottom: 4px;
}
.dash-summary-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    font-weight: 700;
}
.dash-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.dash-user-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 14px 16px;
    transition: border-color 0.15s;
}
.dash-user-card:hover { border-color: rgba(255,255,255,0.15); }
.dash-user-card.no-entries { opacity: 0.5; }
.dash-user-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 8px;
}
.dash-user-avatar {
    width: 32px; height: 32px; min-width: 32px;
    background: #333;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Russo One', sans-serif; font-size: 0.6rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
}
.dash-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.dash-user-name {
    flex: 1; font-size: 0.8rem; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dash-user-hours {
    font-family: 'Russo One', sans-serif;
    font-size: 0.85rem;
    color: var(--brand-red);
}
.dash-progress {
    height: 4px;
    background: #222;
    margin-bottom: 8px;
    overflow: hidden;
}
.dash-progress-bar {
    height: 100%;
    transition: width 0.3s ease;
}
.dash-entries {
    font-size: 0.7rem;
}
.dash-entry-line {
    display: flex; align-items: center; gap: 6px;
    padding: 2px 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Dashboard tabs */
.dash-tabs { display: flex; gap: 2px; }
.dash-tab {
    padding: 5px 16px;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer; font-size: 0.8rem; font-weight: 600;
    transition: all 0.15s;
}
.dash-tab:hover { border-color: var(--text-muted); color: white; }
.dash-tab.active {
    background: var(--brand-red);
    border-color: var(--brand-red);
    color: white;
}

/* Dashboard projects view */
.dash-projects-list {
    display: flex; flex-direction: column; gap: 12px;
}
.dash-proj-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    transition: border-color 0.15s;
}
.dash-proj-card:hover { border-color: rgba(255,255,255,0.15); }
.dash-proj-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 10px;
}
.dash-proj-name {
    font-family: 'Russo One', sans-serif;
    font-size: 0.95rem;
}
.dash-proj-hours {
    font-family: 'Russo One', sans-serif;
    font-size: 1.1rem;
    color: var(--brand-red);
}
.dash-proj-bar-track {
    height: 8px;
    display: flex;
    margin-bottom: 12px;
    min-width: 4px;
    overflow: hidden;
}
.dash-proj-bar-segment {
    height: 100%;
    min-width: 2px;
}
.dash-proj-breakdown {
    display: flex; flex-wrap: wrap; gap: 8px 20px;
}
.dash-proj-activity {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.75rem;
}
.dash-proj-activity-dot {
    width: 8px; height: 8px;
    display: inline-block;
}

/* Activity chips for month view */
.dash-act-chips {
    display: flex; flex-wrap: wrap; gap: 4px;
}
.dash-act-chip {
    font-size: 0.6rem; font-weight: 600;
    padding: 1px 6px;
    display: inline-block;
}
