/* TowerEdge HR CMS — theme aligned with the portfolio design tokens. */
:root {
  --bg-base: #0B0D10;
  --bg-elevated: #14181F;
  --bg-surface: #1A1F29;
  --bg-surface-hi: #222835;
  --brand-indigo: #4F56C9;
  --brand-indigo-deep: #363CA0;
  --brand-periwinkle: #AEB3F0;
  --accent-blue: #00C2FF;
  --accent-blue-deep: #0091CC;
  --accent-green: #7DFF9B;
  --text-primary: #EAEDF5;
  --text-secondary: #A7AEC0;
  --text-muted: #6C7488;
  --line-soft: rgba(174, 179, 240, 0.14);
  --line-hard: rgba(174, 179, 240, 0.28);
  --radius-md: 10px;
  --radius-lg: 18px;
  --sidebar-w: 256px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-family: 'Sora', system-ui, sans-serif; font-weight: 600; line-height: 1.2; }

/* --- Auth pages (login, setup, reset) --- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: var(--bg-base);
  background-image:
    linear-gradient(180deg, rgba(11, 13, 16, 0.78) 0%, rgba(11, 13, 16, 0.62) 42%, rgba(11, 13, 16, 0.85) 100%),
    url('../login_background.png');
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(20, 24, 31, 0.92);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.auth-card--wide { max-width: 640px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-brand img { height: 34px; }
.auth-title { font-size: 1.4rem; margin: 0 0 4px; }
.auth-sub { color: var(--text-secondary); margin: 0 0 24px; font-size: 0.9rem; }

/* --- Forms --- */
.form-group { margin-bottom: 16px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > .form-group { flex: 1 1 200px; }
label { display: block; font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.required label::after, label.required::after { content: ' *'; color: var(--accent-blue); }
input, select, textarea {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(0, 194, 255, 0.15);
}
textarea { resize: vertical; min-height: 90px; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent-blue);
  color: #04222c;
  border: none;
  border-radius: var(--radius-md);
  padding: 11px 20px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { background: #2dd0ff; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--block { width: 100%; }
.btn--ghost { background: transparent; color: var(--text-primary); border: 1px solid var(--line-hard); }
.btn--ghost:hover { background: rgba(255,255,255,0.05); }
.btn--danger { background: #ff5a6a; color: #2a0008; }
.btn--danger:hover { background: #ff7280; }
.btn--sm { padding: 6px 12px; font-size: 0.82rem; }
.btn--success { background: var(--accent-green); color: #053216; }

/* --- Alerts / flash --- */
.alert { padding: 12px 16px; border-radius: var(--radius-md); margin-bottom: 16px; font-size: 0.88rem; border: 1px solid transparent; }
.alert--success { background: rgba(125,255,155,0.1); border-color: rgba(125,255,155,0.3); color: #bfffce; }
.alert--error { background: rgba(255,90,106,0.1); border-color: rgba(255,90,106,0.35); color: #ffc2c8; }
.alert--info { background: rgba(0,194,255,0.08); border-color: rgba(0,194,255,0.25); color: #bdeeff; }

/* --- App shell --- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-base);
  border-right: 1px solid var(--line-soft);
  padding: 20px 14px;
  position: fixed;
  inset: 0 auto 0 0;
  overflow-y: auto;
}
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 20px; }
.sidebar__brand img { height: 28px; }
.sidebar__brand span { font-family: 'Sora', sans-serif; font-weight: 600; font-size: 1rem; }
.nav-section { margin-top: 18px; }
.nav-section__label { font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--text-muted); padding: 0 10px 8px; }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-md);
  color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 2px;
}
.nav-link:hover { background: var(--bg-surface); color: var(--text-primary); text-decoration: none; }
.nav-link.is-active { background: rgba(79,86,201,0.18); color: #fff; }

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; border-bottom: 1px solid var(--line-soft);
  background: var(--bg-elevated); position: sticky; top: 0; z-index: 10;
}
.topbar__title { font-size: 1.05rem; margin: 0; }
.topbar__user { display: flex; align-items: center; gap: 14px; font-size: 0.88rem; color: var(--text-secondary); }
.content { padding: 28px; flex: 1; }

/* --- Cards / stats --- */
.card { background: var(--bg-elevated); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); padding: 22px; }
.card + .card { margin-top: 20px; }
.card__title { margin: 0 0 16px; font-size: 1.05rem; }
.grid { display: grid; gap: 18px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.stat { background: var(--bg-elevated); border: 1px solid var(--line-soft); border-radius: var(--radius-lg); padding: 20px; }
.stat__value { font-family: 'Sora', sans-serif; font-size: 2rem; font-weight: 700; }
.stat__label { color: var(--text-secondary); font-size: 0.85rem; margin-top: 4px; }
.stat--accent .stat__value { color: var(--accent-blue); }

/* --- Tables --- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
table.data th, table.data td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
table.data th { color: var(--text-muted); font-weight: 600; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; }
table.data tr:hover td { background: rgba(255,255,255,0.02); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.badge--pending { background: rgba(255,193,77,0.15); color: #ffd98a; }
.badge--approved { background: rgba(125,255,155,0.15); color: #bfffce; }
.badge--rejected, .badge--closed { background: rgba(255,90,106,0.15); color: #ffc2c8; }
.badge--cancelled, .badge--draft { background: rgba(108,116,136,0.2); color: var(--text-secondary); }
.badge--published { background: rgba(0,194,255,0.15); color: #bdeeff; }

/* --- Misc --- */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.5rem; margin: 0; }
.muted { color: var(--text-muted); }
.fieldset { border: 1px solid var(--line-soft); border-radius: var(--radius-md); padding: 18px; margin-bottom: 20px; }
.fieldset > legend { padding: 0 8px; font-family: 'Sora', sans-serif; font-size: 0.95rem; color: var(--brand-periwinkle); }
.balance-card { background: var(--bg-surface); border: 1px solid var(--line-soft); border-radius: var(--radius-md); padding: 16px; }
.balance-card__type { font-size: 0.8rem; color: var(--text-secondary); }
.balance-card__num { font-family: 'Sora', sans-serif; font-size: 1.6rem; font-weight: 700; }
.balance-card__meta { font-size: 0.75rem; color: var(--text-muted); }
.steps { display: flex; gap: 8px; margin-bottom: 28px; flex-wrap: wrap; }
.step { flex: 1; min-width: 90px; text-align: center; padding: 8px; border-radius: var(--radius-md); background: var(--bg-surface); font-size: 0.75rem; color: var(--text-muted); border: 1px solid var(--line-soft); }
.step.is-active { background: rgba(0,194,255,0.12); color: var(--accent-blue); border-color: rgba(0,194,255,0.3); }
.step.is-done { color: var(--accent-green); }
.inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s; z-index: 100; }
  .sidebar.is-open { transform: translateX(0); }
  .main { margin-left: 0; }
  .burger { display: inline-flex !important; }
}
.burger { display: none; background: none; border: 1px solid var(--line-hard); border-radius: 8px; color: #fff; padding: 6px 10px; cursor: pointer; }
