:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: #1a1a1a;
  --border: #222222;
  --text-primary: #ffffff;
  --text-secondary: #888888;
  --text-muted: #555555;
  --accent: #2cc970;
  --accent-dim: rgba(44, 201, 112, 0.1);
  --accent-hover: #24b05f;
  --red: #ff4444;
  --red-dim: rgba(255, 68, 68, 0.1);
  --yellow: #f0b429;
  --yellow-dim: rgba(240, 180, 41, 0.08);
  --blue: #5b8def;
  --blue-dim: rgba(91, 141, 239, 0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px;
  flex: 1;
  width: 100%;
}

header {
  margin-bottom: 48px;
  text-align: center;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.logo-icon {
  font-size: 28px;
  color: var(--accent);
}

.logo h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo h1 span {
  color: var(--accent);
  font-weight: 300;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 15px;
}

section {
  margin-bottom: 40px;
}

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

.section-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.section-badge {
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}

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

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

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

.btn-danger:hover {
  background: #d43b3b;
}

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

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

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

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

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

.form-group input,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s;
}

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

.form-group input:hover,
.form-group select:hover {
  border-color: #333;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-green {
  color: var(--accent);
  background: var(--accent-dim);
}

.badge-green::before {
  background: var(--accent);
}

.badge-red {
  color: var(--red);
  background: var(--red-dim);
}

.badge-red::before {
  background: var(--red);
}

.badge-yellow {
  color: var(--yellow);
  background: var(--yellow-dim);
}

.badge-yellow::before {
  background: var(--yellow);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  z-index: 300;
  animation: toastIn 0.3s ease;
  pointer-events: none;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.toast-success {
  color: var(--accent);
  background: var(--bg-card);
  border: 1px solid rgba(44, 201, 112, 0.2);
}

.toast-error {
  color: var(--red);
  background: var(--bg-card);
  border: 1px solid rgba(255, 68, 68, 0.2);
}

.toast-info {
  color: var(--blue);
  background: var(--bg-card);
  border: 1px solid rgba(91, 141, 239, 0.2);
}

.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  text-align: center;
  max-width: 360px;
  width: 100%;
}

.login-card h1 {
  font-size: 32px;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
  font-weight: 700;
}

.login-card h1 span {
  color: var(--accent);
  font-weight: 300;
}

.login-card p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.7;
}

.login-card .btn {
  width: 100%;
  padding: 12px 24px;
  font-size: 15px;
}

.login-card .btn svg {
  transition: transform 0.2s;
}

.login-card .btn:hover svg {
  transform: scale(1.12);
}

.content-area {
  display: none;
}

.content-area.visible {
  display: block;
}

.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.header-bar .user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-bar .user img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.header-bar .user span {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.header-bar .nav-links {
  display: flex;
  gap: 8px;
}

.header-bar .nav-links a {
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: all 0.2s;
}

.header-bar .nav-links a:hover,
.header-bar .nav-links a.active {
  color: var(--accent);
  background: var(--accent-dim);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 8px;
}

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

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.loading p {
  font-size: 13px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 16px;
}

footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

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

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

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

::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}

.modal h2 {
  font-size: 18px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.input-group input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

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

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

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

/* === DASHBOARD SPECIFIC === */

.live-clock {
  text-align: center;
  margin-bottom: 32px;
  animation: fadeInUp 0.5s ease;
}

.live-clock .time {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1;
  color: var(--text-primary);
}

.live-clock .date {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.greeting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  animation: fadeInUp 0.5s ease;
}

.greeting-row .greeting-text h2 {
  font-size: 22px;
  font-weight: 700;
}

.greeting-row .greeting-text p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

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

.shift-card {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 32px;
  animation: fadeInUp 0.5s ease;
  position: relative;
  overflow: hidden;
}

.shift-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.3;
}

.shift-card.on-shift {
  border-color: rgba(44, 201, 112, 0.2);
}

.shift-card .shift-btn-area {
  flex-shrink: 0;
}

.shift-btn {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: relative;
}

.shift-btn .btn-icon {
  font-size: 28px;
  line-height: 1;
}

.shift-btn .btn-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.shift-btn.start {
  background: var(--accent);
  color: #000;
}

.shift-btn.start:hover {
  transform: scale(1.05);
}

.shift-btn.start:active {
  transform: scale(0.97);
}

.shift-btn.stop {
  background: var(--red);
  color: #fff;
}

.shift-btn.stop:hover {
  transform: scale(1.05);
}

.shift-btn.stop:active {
  transform: scale(0.97);
}

.shift-card .shift-info {
  flex: 1;
  min-width: 0;
}

.shift-card .shift-status {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 4px;
}

.shift-card .shift-status.idle { color: var(--text-muted); }
.shift-card .shift-status.active { color: var(--accent); }

.shift-card .shift-timer-display {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.shift-card .shift-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.shift-card .shift-meta span {
  color: var(--text-muted);
}

.progress-ring-container {
  flex-shrink: 0;
  position: relative;
  width: 100px;
  height: 100px;
}

.progress-ring-container svg {
  transform: rotate(-90deg);
}

.progress-ring-container .ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}

.progress-ring-container .ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s ease;
}

.progress-ring-container .ring-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.progress-ring-container .ring-center .pct {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.progress-ring-container .ring-center .label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 32px;
  animation: fadeInUp 0.5s ease;
  animation-delay: 0.1s;
  animation-fill-mode: both;
}

.stat-tile {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: border-color 0.2s, transform 0.2s;
}

.stat-tile:hover {
  border-color: #333;
  transform: translateY(-1px);
}

.stat-tile .stat-tile-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-tile .stat-tile-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.stat-tile .stat-tile-value.green { color: var(--accent); }
.stat-tile .stat-tile-value.red { color: var(--red); }
.stat-tile .stat-tile-value.yellow { color: var(--yellow); }
.stat-tile .stat-tile-value.blue { color: var(--blue); }

.day-bars {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  height: 100px;
  padding: 12px 0;
}

.day-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}

.day-bar {
  width: 100%;
  max-width: 36px;
  border-radius: 4px 4px 0 0;
  transition: height 0.6s ease;
  min-height: 4px;
  position: relative;
}

.day-bar.has-shift {
  background: var(--accent);
}

.day-bar.no-shift {
  background: var(--border);
}

.day-bar.today {
  background: var(--accent);
}

.day-bar-wrap .day-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.day-bar-wrap .day-bar-value {
  font-size: 9px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  animation: fadeIn 0.3s ease;
}

table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

table td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

table tbody tr {
  transition: background 0.2s;
}

table tbody tr:hover {
  background: var(--accent-dim);
}

table td strong {
  color: var(--text-primary);
  font-weight: 600;
}

table .day-cell {
  font-weight: 500;
}

.quick-note {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  animation: fadeInUp 0.5s ease;
  animation-delay: 0.2s;
  animation-fill-mode: both;
}

.quick-note .note-icon {
  font-size: 18px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .shift-card { flex-direction: column; text-align: center; padding: 24px; gap: 20px; }
  .shift-card .shift-btn-area { order: -1; }
  .shift-btn { width: 100px; height: 100px; }
  .shift-card .shift-timer-display { font-size: 32px; }
  .progress-ring-container { width: 80px; height: 80px; }
  .greeting-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .live-clock .time { font-size: 36px; }
}

@media (max-width: 600px) {
  .container { padding: 24px 16px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-tile { padding: 12px; }
  .stat-tile .stat-tile-value { font-size: 18px; }
  .shift-card .shift-timer-display { font-size: 28px; }
  .day-bars { height: 80px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
