* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #fff; color: #1a1a1a; font-size: 14px; }
.hidden { display: none !important; }

/* Login */
.login-view { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #fafafa; }
.login-box { width: 100%; max-width: 380px; padding: 48px 40px; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; }
.login-box h1 { font-size: 24px; font-weight: 600; margin-bottom: 8px; }
.login-logo { display: block; margin: 0 0 24px 0; }
.login-box .subtitle { color: #666; margin-bottom: 32px; }
.login-box label { display: block; font-weight: 500; margin-bottom: 6px; color: #333; }
.login-box input { width: 100%; padding: 12px 14px; margin-bottom: 20px; border: 1px solid #d0d0d0; border-radius: 6px; font-size: 14px; transition: border-color 0.2s; }
.login-box input:focus { outline: none; border-color: #1a1a1a; }
.login-box button { width: 100%; padding: 14px; background: #1a1a1a; color: #fff; border: none; border-radius: 6px; font-size: 15px; font-weight: 500; cursor: pointer; transition: background 0.2s; }
.login-box button:hover { background: #333; }
.error { color: #d32f2f; text-align: center; margin-top: 16px; font-size: 13px; }

/* Layout */
.app-layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #1a1a1a; color: #fff; padding: 24px 0; flex-shrink: 0; position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; }
.sidebar-logo { padding: 0 24px 24px; font-size: 20px; font-weight: 600; border-bottom: 1px solid #333; }
.sidebar-nav { padding: 16px 0; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 24px; color: #999; text-decoration: none; font-size: 14px; transition: all 0.2s; cursor: pointer; }
.sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,0.05); }
.sidebar-nav a.active { color: #fff; background: rgba(255,255,255,0.1); border-left: 3px solid #fff; }
.sidebar-nav a svg { width: 18px; height: 18px; }
.sidebar-user { position: absolute; bottom: 0; width: 220px; padding: 16px 24px; border-top: 1px solid #333; }
.sidebar-user .user-name { font-size: 13px; color: #fff; }
.sidebar-user .user-role { font-size: 11px; color: #666; text-transform: uppercase; }
.sidebar-user .logout { color: #666; font-size: 12px; cursor: pointer; margin-top: 8px; }
.sidebar-user .logout:hover { color: #fff; }

/* Main Content */
.main-content { flex: 1; background: #fafafa; margin-left: 220px; }
.top-bar { display: flex; justify-content: space-between; align-items: center; padding: 20px 32px; background: #fff; border-bottom: 1px solid #e0e0e0; }
.top-bar h1 { font-size: 20px; font-weight: 600; }
.content { padding: 32px; }

/* Timer Section */
.timer-section { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 24px; margin-bottom: 24px; }
.timer-row { display: flex; gap: 16px; align-items: center; }
.timer-input { flex: 1; }
.timer-input input, .timer-input select { width: 100%; padding: 12px 14px; border: 1px solid #e0e0e0; border-radius: 6px; font-size: 14px; }
.timer-input input:focus, .timer-input select:focus { outline: none; border-color: #1a1a1a; }
.timer-input input::placeholder { color: #999; }
.timer-display { display: flex; align-items: center; gap: 12px; }
.timer-time { font-size: 24px; font-weight: 600; font-family: 'SF Mono', Monaco, monospace; min-width: 90px; }
.timer-btn { width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.timer-btn.start { background: #1a1a1a; color: #fff; }
.timer-btn.start:hover { background: #333; }
.timer-btn.stop { background: #d32f2f; color: #fff; }
.timer-btn.stop:hover { background: #b71c1c; }
.timer-btn svg { width: 20px; height: 20px; }

/* Week Navigation */
.week-nav { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.week-nav button { padding: 8px 12px; border: 1px solid #e0e0e0; background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; }
.week-nav button:hover { background: #f5f5f5; }
.week-nav .week-label { font-weight: 500; }
.week-total { margin-left: auto; font-size: 14px; color: #666; }
.week-total strong { color: #1a1a1a; font-size: 18px; }

/* Week Days */
.week-days { display: flex; gap: 8px; margin-bottom: 24px; }
.week-day { flex: 1; padding: 12px 8px; text-align: center; background: #fff; border: 1px solid #e0e0e0; border-radius: 6px; cursor: pointer; transition: all 0.2s; }
.week-day:hover { background: #f5f5f5; }
.week-day.active { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.week-day.has-entries { border-color: #1a1a1a; }
.week-day .day-name { font-size: 11px; text-transform: uppercase; opacity: 0.6; }
.week-day .day-num { font-size: 18px; font-weight: 600; margin: 4px 0; }
.week-day .day-hrs { font-size: 11px; opacity: 0.6; }

/* Day Groups */
.day-group { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; margin-bottom: 16px; overflow: hidden; }
.day-header { display: flex; justify-content: space-between; padding: 14px 20px; background: #fafafa; border-bottom: 1px solid #e0e0e0; font-weight: 500; }
.day-header .day-total { color: #666; }
.entries-header { display: flex; align-items: center; padding: 10px 20px; border-bottom: 1px solid #f0f0f0; font-size: 11px; text-transform: uppercase; color: #999; font-weight: 500; }
.entry-project-header { width: 200px; }
.entry-user-header { width: 180px; }
.entry-desc-header { flex: 1; padding: 0 20px; }
.entry-hours-header { width: 80px; text-align: right; }
.entry-actions-header { width: 80px; }
.entry-row { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid #f0f0f0; transition: background 0.2s; }
.entry-row:last-child { border-bottom: none; }
.entry-row:hover { background: #fafafa; }
.entry-project { width: 200px; }
.entry-project .project-name { font-weight: 500; }
.entry-project .client-name { font-size: 12px; color: #666; }
.entry-user { width: 180px; font-size: 13px; color: #666; }
.entry-desc { flex: 1; color: #666; padding: 0 20px; }
.task-name { color: #1a1a1a; font-weight: 500; }
.task-comments { font-size: 12px; color: #999; margin-top: 4px; }
.entry-desc .task-name { color: #1a1a1a; font-weight: 500; margin-bottom: 4px; }
.entry-desc .task-comments { font-size: 12px; color: #999; font-style: italic; }
.entry-hours { width: 80px; text-align: right; font-weight: 500; font-family: 'SF Mono', Monaco, monospace; }
.entry-actions { width: 80px; text-align: right; opacity: 0; transition: opacity 0.2s; }
.entry-row:hover .entry-actions { opacity: 1; }
.entry-actions button { padding: 6px 10px; border: none; background: none; cursor: pointer; color: #666; font-size: 12px; }
.entry-actions button:hover { color: #1a1a1a; }
.entry-actions .delete:hover { color: #d32f2f; }

/* Tables */
.data-table { width: 100%; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
.data-table th { text-align: left; padding: 14px 20px; background: #fafafa; font-weight: 500; font-size: 12px; text-transform: uppercase; color: #666; border-bottom: 1px solid #e0e0e0; }
.data-table td { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #fafafa; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 11px; font-weight: 500; }
.badge-active { background: #e8f5e9; color: #2e7d32; }
.badge-inactive { background: #f5f5f5; color: #666; }
.badge-role { background: #f5f5f5; color: #333; }

/* Buttons */
.btn { padding: 10px 20px; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.2s; border: none; }
.btn-primary { background: #1a1a1a; color: #fff; }
.btn-primary:hover { background: #333; }
.btn-success { background: #22c55e; color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-secondary { background: #fff; color: #1a1a1a; border: 1px solid #e0e0e0; }
.btn-secondary:hover { background: #f5f5f5; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-icon { padding: 8px; background: none; border: none; cursor: pointer; color: #666; }
.btn-icon:hover { color: #1a1a1a; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: #fff; border-radius: 12px; width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px; border-bottom: 1px solid #e0e0e0; }
.modal-header h3 { font-size: 18px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: #666; line-height: 1; }
.modal-close:hover { color: #1a1a1a; }
.modal-body { padding: 24px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 8px; color: #333; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px 14px; border: 1px solid #e0e0e0; border-radius: 6px; font-size: 14px; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #1a1a1a; }
.form-row { display: flex; gap: 16px; }
.form-row .form-group { flex: 1; }
.checkbox-group { display: flex; align-items: center; gap: 10px; }
.checkbox-group input[type="checkbox"] { width: auto; }

/* iOS Toggle Switch */
.toggle-switch { position: relative; width: 50px; height: 28px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #e0e0e0; transition: 0.3s; border-radius: 28px; }
.toggle-slider:before { position: absolute; content: ""; height: 22px; width: 22px; left: 3px; bottom: 3px; background-color: white; transition: 0.3s; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle-switch input:checked + .toggle-slider { background-color: #22c55e; }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(22px); }
.toggle-group { display: flex; align-items: center; gap: 12px; margin-bottom: 15px; }
.toggle-group label { font-weight: 500; font-size: 14px; cursor: pointer; }
.modal-error { background: #fef2f2; color: #dc2626; padding: 12px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid #e0e0e0; display: flex; justify-content: flex-end; gap: 12px; }

/* Reports */
.report-filters { display: flex; gap: 16px; margin-bottom: 24px; align-items: flex-end; }
.report-filters .form-group { margin-bottom: 0; }
.report-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.summary-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 20px; }
.summary-card .label { font-size: 12px; color: #666; text-transform: uppercase; margin-bottom: 8px; }
.summary-card .value { font-size: 28px; font-weight: 600; }

.project-link { color: #1a1a1a; text-decoration: none; }
.project-link:hover { text-decoration: underline; }

.project-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 24px; }
.kpi-card .kpi-label { font-size: 12px; color: #666; text-transform: uppercase; margin-bottom: 8px; }
.kpi-card .kpi-value { font-size: 32px; font-weight: 600; }
.kpi-card .kpi-change { font-size: 12px; margin-top: 8px; }
.kpi-card .kpi-change.positive { color: #22c55e; }
.kpi-card .kpi-change.negative { color: #dc2626; }

/* Charts */
.charts-container { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.chart-box { background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 20px; }
.chart-box h3 { font-size: 14px; font-weight: 500; margin-bottom: 16px; color: #333; }
.chart-box canvas { max-height: 250px; width: 100% !important; height: 250px !important; }

/* Empty State */
.empty-state { text-align: center; padding: 60px 20px; color: #666; }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 15px; }

/* Password Generator */
.password-field-wrapper { position: relative; }
.password-field-wrapper input { padding-right: 40px; }
.generate-password-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 6px; color: #666; transition: color 0.2s; }
.generate-password-btn:hover { color: #1a1a1a; }
.generate-password-btn svg { width: 20px; height: 20px; }

/* Copy Password Button */
.copy-password-btn { position: absolute; right: 38px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; padding: 6px; color: #666; transition: color 0.2s; }
.copy-password-btn:hover { color: #22c55e; }
.copy-password-btn svg { width: 18px; height: 18px; }
