/* ============================================================
   KELLEY OS — Styles
   Dark industrial retail ops aesthetic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Syne:wght@400;600;700;800&display=swap');

/* ============================================================
   CSS VARIABLES
   ============================================================ */

:root {
  --bg:           #0d0d0f;
  --bg-card:      #141416;
  --bg-raised:    #1a1a1e;
  --bg-hover:     #202026;
  --border:       #2a2a32;
  --border-light: #333340;

  --text:         #f0f0f4;
  --text-muted:   #7a7a8c;
  --text-dim:     #4a4a58;

  --accent:       #00e5a0;
  --accent-dim:   rgba(0, 229, 160, 0.12);
  --accent-hover: #00ffb3;

  --red:          #ff4466;
  --red-dim:      rgba(255, 68, 102, 0.12);
  --yellow:       #ffc940;
  --yellow-dim:   rgba(255, 201, 64, 0.12);
  --blue:         #4488ff;
  --blue-dim:     rgba(68, 136, 255, 0.12);

  --sidebar-w:    220px;
  --header-h:     56px;

  --radius:       8px;
  --radius-lg:    12px;

  --font-display: 'Syne', sans-serif;
  --font-mono:    'DM Mono', monospace;

  --shadow:       0 2px 12px rgba(0,0,0,0.4);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.6);
}

/* ============================================================
   RESET
   ============================================================ */

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

html, body {
  height: 100%;
  font-family: var(--font-mono);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(0,229,160,0.04) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(68,136,255,0.04) 0%, transparent 60%);
}

.login-container {
  width: 100%;
  max-width: 380px;
  padding: 0 24px;
  animation: fadeUp 0.4s ease both;
}

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

.login-header {
  text-align: center;
  margin-bottom: 40px;
}

.login-logo {
  width: 56px;
  height: 56px;
  background: var(--accent);
  color: var(--bg);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 16px;
  box-shadow: 0 0 32px rgba(0,229,160,0.25);
}

.login-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.login-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 16px;
}

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

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.form-group input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-group input::placeholder {
  color: var(--text-dim);
}

.btn-primary {
  width: 100%;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 13px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  margin-top: 4px;
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 0 20px rgba(0,229,160,0.3);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.error-message {
  background: var(--red-dim);
  border: 1px solid var(--red);
  border-radius: var(--radius);
  color: var(--red);
  font-size: 12px;
  padding: 10px 12px;
  margin-top: 12px;
}

.login-help {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}

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

.app-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Header */
.app-header {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
  z-index: 100;
}

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

.app-logo {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: var(--bg);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
}

.app-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-username {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-logout:hover {
  border-color: var(--red);
  color: var(--red);
}

/* Layout */
.app-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.app-sidebar {
  width: var(--sidebar-w);
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  flex-shrink: 0;
  overflow-y: auto;
}

.nav-list {
  list-style: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  border-left: 2px solid transparent;
  user-select: none;
}

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

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

.nav-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
}

.lasermode-nav {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 18px !important;
  color: var(--yellow) !important;
}

.lasermode-nav:hover {
  background: var(--yellow-dim) !important;
  color: var(--yellow) !important;
}

.lasermode-nav.active {
  background: var(--yellow-dim) !important;
  color: var(--yellow) !important;
  border-left-color: var(--yellow) !important;
}

/* Content */
.app-content {
  flex: 1;
  overflow-y: auto;
  padding: 28px;
  background: var(--bg);
}

/* Section header */
.section-header {
  margin-bottom: 24px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

.section-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

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

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: border-color 0.15s, transform 0.15s;
}

.stat-card:hover {
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 8px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.5px;
}

.period-stamp {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 8px;
}

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

.perf-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.perf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.perf-table thead tr {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}

.perf-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.perf-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}

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

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

/* ============================================================
   ROSTER
   ============================================================ */

.roster-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.roster-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.roster-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.roster-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.roster-position {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.roster-action {
  font-size: 11px;
  color: var(--accent);
  margin-top: 10px;
}

/* ============================================================
   NOTES
   ============================================================ */

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.note-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-light);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.note-type-general      { border-left-color: var(--blue); }
.note-type-coaching     { border-left-color: var(--accent); }
.note-type-needs-attention { border-left-color: var(--red); }
.note-type-positive     { border-left-color: var(--yellow); }

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

.note-type {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.note-date {
  font-size: 11px;
  color: var(--text-dim);
}

.note-author {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.note-body {
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
}

/* Add note form */
.add-note-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 20px;
}

.add-note-form select,
.add-note-form textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}

.add-note-form select:focus,
.add-note-form textarea:focus {
  border-color: var(--accent);
}

.add-note-form textarea {
  resize: vertical;
  min-height: 90px;
}

.add-note-form .btn-primary {
  width: auto;
  padding: 10px 20px;
}

/* Coaching select */
.coaching-header {
  margin-bottom: 16px;
}

.coaching-header select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 14px;
  outline: none;
  width: 100%;
  max-width: 360px;
  transition: border-color 0.15s;
}

.coaching-header select:focus {
  border-color: var(--accent);
}

/* ============================================================
   LASERMODE
   ============================================================ */

.lasermode-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lasermode-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  transition: transform 0.15s;
}

.lasermode-card:hover {
  transform: translateY(-1px);
}

.risk-high   { border-left: 3px solid var(--red); }
.risk-medium { border-left: 3px solid var(--yellow); }
.risk-low    { border-left: 3px solid var(--blue); }

.lasermode-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.lasermode-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.lasermode-risk {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: 20px;
}

.risk-badge-risk-high   { background: var(--red-dim);    color: var(--red);    }
.risk-badge-risk-medium { background: var(--yellow-dim); color: var(--yellow); }
.risk-badge-risk-low    { background: var(--blue-dim);   color: var(--blue);   }

.lasermode-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lasermode-flag {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 8px;
}

.lasermode-clean {
  text-align: center;
  padding: 60px 20px;
}

.lasermode-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.lasermode-msg {
  font-size: 14px;
  color: var(--text-muted);
}

.lasermode-footer {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 16px;
}

/* ============================================================
   STATES
   ============================================================ */

.loading {
  font-size: 13px;
  color: var(--text-dim);
  padding: 40px 0;
  text-align: center;
}

.loading::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  margin-left: 8px;
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.3; transform: scale(0.8); }
}

.empty {
  font-size: 13px;
  color: var(--text-dim);
  padding: 40px 0;
  text-align: center;
}

.error {
  font-size: 13px;
  color: var(--red);
  padding: 40px 0;
  text-align: center;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */

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

::-webkit-scrollbar-track {
  background: var(--bg);
}

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

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

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
  }

  .app-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 8px 0;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .nav-list {
    display: flex;
    flex-direction: row;
    gap: 0;
  }

  .nav-item {
    padding: 8px 16px;
    white-space: nowrap;
    border-left: none;
    border-bottom: 2px solid transparent;
    font-size: 12px;
  }

  .nav-item.active {
    border-left: none;
    border-bottom-color: var(--accent);
  }

  .app-content {
    padding: 16px;
  }

  .overview-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-value {
    font-size: 20px;
  }

  .header-username {
    display: none;
  }
}






