/* ================================================================
   FORGE DESIGN SYSTEM
   Typography: Urbanist (Google Fonts)
   Dark mode (default): charcoal greys, white text, amber-orange accents
   Light mode (alternate): white/light grey, black text, amber-orange accents
   ================================================================ */

/* ===== DESIGN TOKENS ===== */

:root {
    /* Brand — overridden by BrandingSettings inline --primary */
    --primary: #E8740C;
    --primary-hover: #FF8C2A;
    --primary-muted: rgba(232, 116, 12, 0.10);
    --primary-subtle: rgba(232, 116, 12, 0.06);

    /* Surfaces */
    --bg-base: #111114;
    --bg-surface: #18181c;
    --bg-elevated: #222228;
    --bg-input: #1e1e24;
    --bg-hover: rgba(255, 255, 255, 0.04);

    /* Borders */
    --border: #2a2a32;
    --border-light: #343440;

    /* Text */
    --text: #f0f0f2;
    --text-secondary: #9a9aa8;
    --text-muted: #636370;

    /* Status */
    --danger: #ef4444;
    --danger-muted: rgba(239, 68, 68, 0.12);
    --success: #22c55e;
    --success-muted: rgba(34, 197, 94, 0.12);
    --warning: #f59e0b;
    --warning-muted: rgba(245, 158, 11, 0.12);
    --info: #3b82f6;
    --info-muted: rgba(59, 130, 246, 0.12);

    /* Layout */
    --sidebar-bg: #141418;
    --sidebar-width: 260px;
    --topbar-height: 56px;

    /* Effects */
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
    --transition: 0.15s ease;
}

[data-theme="light"] {
    --bg-base: #f4f4f6;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;
    --bg-input: #f0f0f3;
    --bg-hover: rgba(0, 0, 0, 0.03);

    --border: #e0e0e6;
    --border-light: #eaeaef;

    --text: #1a1a1e;
    --text-secondary: #55555f;
    --text-muted: #8a8a96;

    --sidebar-bg: #ffffff;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.10);
}

/* ===== RESET & BASE ===== */

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

html, body {
    font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base);
    color: var(--text);
    height: 100%;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primary-hover);
}

::selection {
    background: var(--primary);
    color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== APP LAYOUT ===== */

.forge-app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg-base);
    color: var(--text-muted);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== SIDEBAR ===== */

.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    z-index: 10;
}

.sidebar-header {
    padding: 1.25rem 1.15rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 1.15rem;
    right: 1.15rem;
    height: 1px;
    background: linear-gradient(90deg, var(--primary) 0%, transparent 100%);
    opacity: 0.5;
}

.sidebar-logo {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-logo-placeholder {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: var(--primary-muted);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.sidebar-subtitle {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sidebar-nav {
    flex: 1;
    padding: 0.25rem 0;
}

.nav-section-label {
    padding: 1.1rem 1.15rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 1.15rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.855rem;
    font-weight: 500;
    transition: all var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    position: relative;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    color: var(--text);
    background: var(--bg-hover);
    text-decoration: none;
}

.nav-item.active {
    color: var(--primary);
    background: var(--primary-muted);
    border-left-color: var(--primary);
}

.nav-item.sub {
    padding-left: 2.9rem;
    font-size: 0.82rem;
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.65;
}

.nav-item:hover .nav-icon,
.nav-item.active .nav-icon {
    opacity: 1;
}

.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.5rem 1.15rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    border-left: 3px solid transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.855rem;
    font-weight: 500;
    font-family: inherit;
    transition: all var(--transition);
}

.nav-group-toggle:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.nav-group-toggle .nav-icon {
    opacity: 0.65;
}

.nav-group-toggle:hover .nav-icon {
    opacity: 1;
}

.nav-chevron {
    margin-left: auto;
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
    opacity: 0.4;
}

.nav-chevron.expanded {
    transform: rotate(180deg);
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: 0.5rem 0;
    margin-top: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-footer .nav-item.external {
    font-size: 0.8rem;
    gap: 0.5rem;
}

.sidebar-footer .nav-item.external svg:last-child {
    margin-left: auto;
    opacity: 0.4;
    width: 14px;
    height: 14px;
}

.logout-btn {
    color: var(--danger) !important;
}

.logout-btn:hover {
    background: var(--danger-muted) !important;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0.35rem 1.15rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
}

.theme-toggle:hover {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-muted);
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
}

/* ===== MAIN CONTENT ===== */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-base);
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    height: var(--topbar-height);
    min-height: var(--topbar-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
}

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

.topbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-muted);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.content-area > * {
    animation: contentFadeIn 0.2s ease;
}

@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== BUTTONS ===== */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.855rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 2px 12px rgba(232, 116, 12, 0.3);
}

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

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

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

.btn-danger:hover {
    filter: brightness(1.1);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
}

.btn-ghost:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 0.7rem 1.5rem;
    font-size: 0.95rem;
}

.btn[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== CARDS ===== */

.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

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

.card-header h2,
.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

/* ===== FORMS ===== */

input, select, textarea {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.855rem;
    font-family: inherit;
    font-weight: 500;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

input::placeholder, textarea::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

input[type="color"] {
    padding: 0.25rem;
    height: 40px;
    cursor: pointer;
}

input[type="checkbox"] {
    width: auto;
    cursor: pointer;
    accent-color: var(--primary);
}

label {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ===== TABLES ===== */

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

td {
    font-size: 0.855rem;
}

tbody tr {
    transition: background var(--transition);
}

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

.clickable-row {
    cursor: pointer;
}

.clickable-row td:first-child {
    color: var(--primary);
}

.sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sortable-th:hover {
    color: var(--primary);
}

/* ===== BADGES ===== */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-admin {
    background: var(--primary-muted);
    color: var(--primary);
}

.badge-manager {
    background: var(--warning-muted);
    color: var(--warning);
}

.badge-employee {
    background: var(--info-muted);
    color: var(--info);
}

.badge-active {
    background: var(--success-muted);
    color: var(--success);
}

.badge-inactive {
    background: var(--danger-muted);
    color: var(--danger);
}

/* ===== PAGE LAYOUT ===== */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* ===== ALERTS & MESSAGES ===== */

.success-msg {
    background: var(--success-muted);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--success);
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.error-msg,
.login-error {
    background: var(--danger-muted);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger);
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.warning-msg {
    background: var(--warning-muted);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: var(--warning);
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ===== MODALS ===== */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: modalBgIn 0.15s ease;
}

@keyframes modalBgIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.2s ease;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal h2 {
    margin-bottom: 1.25rem;
    font-size: 1.15rem;
    font-weight: 700;
}

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

/* ===== LOGIN PAGE ===== */

.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg-base);
    position: relative;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 116, 12, 0.07) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.login-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-hover));
}

.login-card h1 {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.2rem;
    color: var(--primary);
    letter-spacing: -0.03em;
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.login-card .btn-primary {
    height: 42px;
    font-size: 0.9rem;
}

/* ===== PLACEHOLDER PAGES ===== */

.placeholder-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    color: var(--text-muted);
}

.placeholder-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    opacity: 0.15;
    color: var(--primary);
}

.placeholder-page h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text);
}

.placeholder-page p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ===== BRANDING UTILITIES ===== */

.color-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.color-row input[type="color"] {
    width: 60px;
    flex-shrink: 0;
}

.color-row input[type="text"] {
    flex: 1;
}

.logo-preview {
    margin-top: 0.5rem;
}

.logo-preview img {
    max-width: 200px;
    max-height: 80px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
    padding: 0.25rem;
}

/* ===== STAT CARDS (dashboard & future pages) ===== */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.stat-card .stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.stat-card .stat-change {
    font-size: 0.8rem;
    font-weight: 500;
}

.stat-card .stat-change.positive {
    color: var(--success);
}

.stat-card .stat-change.negative {
    color: var(--danger);
}

/* ===== EMPTY STATE ===== */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    text-align: center;
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.2;
}

.empty-state h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 0.85rem;
    max-width: 300px;
}

/* ===== TIMESHEET CALENDAR ===== */

.ts-employee-select {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
    font-family: inherit;
}

.ts-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.ts-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.ts-nav-label {
    font-size: 0.95rem;
    font-weight: 700;
    margin-left: 0.5rem;
    color: var(--text);
}

.ts-view-toggle {
    display: flex;
    gap: 0.25rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px;
}

.ts-view-toggle .btn {
    border-radius: var(--radius-sm);
    min-width: 56px;
}

.ts-calendar {
    overflow: hidden;
    padding: 0 !important;
}

/* Week header */
.ts-week-header {
    display: grid;
    grid-template-columns: 56px repeat(7, 1fr);
    border-bottom: 1px solid var(--border);
}

.ts-week-gutter {
    border-right: 1px solid var(--border);
}

.ts-week-day-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 0.25rem;
    border-right: 1px solid var(--border);
    gap: 0.15rem;
}

.ts-week-day-header:last-child {
    border-right: none;
}

.ts-day-name {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.ts-day-number {
    font-size: 1rem;
    font-weight: 700;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.ts-today-number {
    background: var(--primary);
    color: #fff;
}

.ts-day-hours {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.ts-weekend .ts-day-name,
.ts-weekend .ts-day-number {
    color: var(--text-muted);
}

/* Day/Week body */
.ts-day-view,
.ts-week-body {
    display: grid;
    position: relative;
    overflow-y: auto;
    max-height: 960px;
}

.ts-day-view {
    grid-template-columns: 56px 1fr;
}

.ts-week-body {
    grid-template-columns: 56px repeat(7, 1fr);
}

.ts-time-gutter {
    position: relative;
    height: calc(17 * 60px); /* 6:00-22:00 = 17 hours */
    border-right: 1px solid var(--border);
}

.ts-hour-label {
    position: absolute;
    right: 8px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    transform: translateY(-50%);
    user-select: none;
}

.ts-day-column {
    position: relative;
    height: calc(17 * 60px);
    border-right: 1px solid var(--border);
}

.ts-day-column:last-child {
    border-right: none;
}

.ts-weekend-col {
    background: var(--bg-hover);
}

.ts-hour-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 60px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.ts-hour-line:hover {
    background: var(--primary-subtle);
}

.ts-hour-line.ts-drag-active {
    background: var(--primary-muted);
    border-color: var(--primary);
}

/* Time blocks */
.ts-block {
    position: absolute;
    left: 3px;
    right: 3px;
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1px;
    z-index: 1;
    transition: filter 0.15s ease, transform 0.1s ease;
    border-left: 3px solid rgba(0, 0, 0, 0.2);
}

.ts-block:hover {
    filter: brightness(1.15);
    transform: scale(1.01);
    z-index: 2;
}

.ts-block-time {
    font-size: 0.68rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
}

.ts-block-project {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ts-block-desc {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

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