/* ==========================================================================
   Aurora Computer Care - tracker styles
   All visual choices live here. Colors are CSS variables at the top so
   you can restyle the whole app from one place.
   ========================================================================== */

:root {
  --bg:          #f4f6fb;
  --surface:     #ffffff;
  --surface-2:   #f8fafc;
  --border:      #e4e8f0;
  --text:        #1e2430;
  --text-soft:   #5b6472;
  --text-faint:  #8b95a5;
  --accent:      #3b5bdb;
  --accent-dark: #324db8;
  --accent-soft: #ebefff;
  --danger:      #d64545;
  --danger-soft: #fbeaea;

  --radius:    12px;
  --shadow-sm: 0 1px 2px rgba(20, 30, 60, .06), 0 1px 3px rgba(20, 30, 60, .04);
  --shadow-md: 0 10px 30px rgba(20, 30, 60, .16);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
}

/* --- Topbar ------------------------------------------------------------- */

.topbar {
  padding: 18px 28px;
  color: #fff;
  background: linear-gradient(120deg, #2b3a8c 0%, #3b5bdb 48%, #5a86e0 100%);
}

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

.brand-mark {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .16);
  font-weight: 700;
  letter-spacing: .5px;
}

.brand-text h1 { margin: 0; font-size: 17px; font-weight: 650; }
.brand-text p  { margin: 0; font-size: 12.5px; opacity: .82; }

/* --- Layout ----------------------------------------------------------- */

.layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 28px 48px;
  align-items: start;
}

/* --- Sidebar -------------------------------------------------------- */

.sidebar {
  position: sticky;
  top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.sidebar-head {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid var(--border);
}

#search {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
#search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.customer-list {
  list-style: none;
  margin: 0;
  padding: 6px;
  max-height: calc(100vh - 210px);
  overflow-y: auto;
}

.customer-list li {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s ease;
}
.customer-list li:hover  { background: var(--surface-2); }
.customer-list li.active { background: var(--accent-soft); }

.customer-list .c-name { font-weight: 600; }
.customer-list .c-sub  { font-size: 12px; color: var(--text-faint); }

.list-empty {
  padding: 22px 14px;
  text-align: center;
  color: var(--text-faint);
  cursor: default;
}
.list-empty:hover { background: none; }

/* --- Detail pane -------------------------------------------------- */

.detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-height: 440px;
  padding: 24px 28px;
}

.detail-empty {
  height: 400px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-faint);
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.detail-head h2 { margin: 0 0 2px; font-size: 20px; }
.detail-head .muted { color: var(--text-faint); font-size: 12.5px; }

.detail-actions { display: flex; gap: 8px; flex-shrink: 0; }

.info-grid {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 9px 16px;
  margin: 0 0 28px;
}
.info-grid dt { color: var(--text-faint); }
.info-grid dd { margin: 0; white-space: pre-wrap; word-break: break-word; }

.section-title { margin-bottom: 12px; }
.section-title h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-soft);
}

/* --- Interaction timeline ------------------------------------- */

.timeline { display: flex; flex-direction: column; gap: 10px; }

.event {
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.event:hover { border-color: var(--accent); background: #fff; }

.event-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.event-date { font-weight: 600; }

.badge {
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.event-desc { color: var(--text-soft); white-space: pre-wrap; word-break: break-word; }

.timeline-empty { padding: 6px 0; color: var(--text-faint); }

/* --- Buttons ------------------------------------------------ */

.btn {
  font: inherit;
  font-weight: 550;
  padding: 8px 14px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--surface-2); }

.btn-primary {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.btn-danger-ghost { color: var(--danger); border-color: transparent; background: transparent; }
.btn-danger-ghost:hover { background: var(--danger-soft); }

/* --- Dialogs --------------------------------------------- */

dialog {
  width: min(480px, 92vw);
  padding: 0;
  border: none;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
}
dialog::backdrop { background: rgba(18, 24, 45, .38); }

dialog form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px 24px;
}

dialog h2 { margin: 0 0 4px; font-size: 17px; }

dialog label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text-soft);
}

dialog input,
dialog select,
dialog textarea {
  font: inherit;
  color: var(--text);
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
dialog input:focus,
dialog select:focus,
dialog textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
dialog textarea { resize: vertical; }

dialog .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.dialog-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.dialog-actions .spacer { flex: 1; }

.req { color: var(--danger); }

/* --- Login page (new: this app is now reachable over the internet, unlike
   the original local-only version, so it needs a passcode gate) ---------- */

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: linear-gradient(120deg, #2b3a8c 0%, #3b5bdb 48%, #5a86e0 100%);
}

.login-card {
  width: min(360px, 92vw);
  padding: 32px 28px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.login-card h1 { margin: 0 0 4px; font-size: 19px; }
.login-sub { margin: 0 0 20px; color: var(--text-faint); font-size: 13px; }

.login-card form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-card input {
  font: inherit;
  font-size: 16px;
  text-align: center;
  letter-spacing: 2px;
  padding: 10px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.login-card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-card button {
  font: inherit;
  font-weight: 600;
  padding: 10px;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
.login-card button:hover { background: var(--accent-dark); }

.login-error {
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 13px;
}
