/* Theme, layout, components and responsive work scheduler. */
:root {
  color-scheme:dark;
  --bg:#0b1220;
  --panel:#131e30;
  --line:#29364a;
  --text:#eaf0f8;
  --muted:#a2b0c4;
  --green:#34d399
}

* {
  box-sizing:border-box
}

body {
  margin:0;
  background:var(--bg);
  color:var(--text);
  font:15px system-ui,sans-serif
}

main {
  max-width:1200px;
  margin:auto;
  padding:28px
}

header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  gap:12px;
  margin-bottom:28px
}

h1,h2,h3,p {
  margin:0
}

h1 {
  font-size:27px;
  letter-spacing:-1px
}

h2 {
  font-size:18px;
  margin-bottom:16px
}

small,.muted {
  color:var(--muted)
}

.brand {
  color:var(--green)
}

.grid {
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px
}

.layout {
  display:grid;
  grid-template-columns:1.15fr 1fr;
  gap:16px;
  margin-top:16px
}

.panel,.metric {
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:15px;
  padding:20px
}

.metric strong {
  display:block;
  font-size:28px;
  margin-top:8px;
  letter-spacing:-1px
}

.positive {
  color:var(--green)
}

.negative {
  color:#fb7185
}

button,input,select {
  font:inherit;
  color:inherit;
  border:1px solid var(--line);
  border-radius:8px;
  background:#0b1424;
  padding:10px;
  min-width:0
}

button {
  cursor:pointer
}

button:hover {
  border-color:var(--green)
}

button.primary {
  background:var(--green);
  color:#052e24;
  font-weight:700;
  border:0
}

button.danger {
  color:#fda4af
}

label {
  display:block;
  color:var(--muted);
  font-size:12px
}

label input,label select {
  display:block;
  width:100%;
  margin-top:5px
}

.fields {
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:9px
}

.job {
  border-top:1px solid var(--line);
  padding:14px 0
}

.row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px
}

.expense {
  display:grid;
  grid-template-columns:1fr 105px 36px;
  gap:8px;
  margin:8px 0
}

.expense button {
  padding:4px
}

.stack {
  display:grid;
  gap:16px
}

.bar {
  height:16px;
  background:#263449;
  border-radius:20px;
  overflow:hidden;
  display:flex;
  margin:15px 0
}

.bar span {
  height:100%;
  display:block
}

.legend {
  display:flex;
  gap:15px;
  flex-wrap:wrap;
  font-size:12px;
  color:var(--muted)
}

.dot {
  display:inline-block;
  width:9px;
  height:9px;
  border-radius:50%;
  margin-right:5px
}

.scroll {
  overflow:auto
}

table {
  border-collapse:collapse;
  width:100%;
  white-space:nowrap
}

th,td {
  text-align:right;
  padding:12px;
  border-bottom:1px solid var(--line)
}

th:first-child,td:first-child {
  text-align:left
}

th {
  color:var(--muted);
  font-size:12px
}

footer {
  margin:20px 0;
  color:var(--muted);
  font-size:12px
}

.light {
  color-scheme:light;
  --bg:#f1f5f9;
  --panel:#fff;
  --line:#d5deea;
  --text:#142136;
  --muted:#53647b;
  --green:#059669
}

.light input,.light select,.light button:not(.primary) {
  background:#f8fafc
}

.light .positive {
  color:#047857
}

.light .negative {
  color:#be123c
}

@media(max-width:760px) {
  main {
    padding:14px
  }

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

  .layout {
    grid-template-columns:1fr
  }

  .metric strong {
    font-size:22px
  }

  .panel {
    padding:15px
  }

}

.schedule-table td,.schedule-table th {
  text-align:left;
  padding:8px
}

.schedule-table input {
  width:105px;
  padding:8px
}

.schedule-table .total {
  font-weight:700
}

.schedule-note {
  margin:12px 0;
  line-height:1.5
}

.saving-highlight {
  border-color:var(--green)
}

.schedule-table td:first-child {
  font-weight:600
}

.shift {
  display:flex;
  gap:5px;
  align-items:center
}

.shift label {
  font-size:11px
}

.shift input {
  width:108px
}

.schedule-table .break-input {
  width:70px
}


/* First-visit onboarding and local-data controls. */
[hidden] { display: none !important; }
.welcome { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.welcome-card { width: min(100%, 480px); display: grid; gap: 20px; padding: 32px; }
.welcome-card h2 { margin: 0; }
.welcome-card button { padding: 14px; }
.privacy-panel { margin-bottom: 16px; }
.privacy-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
#privacyStatus { margin-top: 8px; }

/* Authentication forms */
#authForm, #recoveryForm { display: grid; gap: 14px; text-align: left; }
#authStatus { overflow-wrap: anywhere; }

/* NocBridge branding: white logo plate works in both themes. */
.brand-heading { margin: 0; line-height: 1; }
.brand-logo { display: block; width: 270px; max-width: 100%; height: auto; background: white; border-radius: 10px; padding: 8px; }
.welcome-card .brand-logo { width: 100%; max-width: 360px; margin-inline: auto; }
header .muted { margin-top: 8px; }
