:root {
  --bg: #0a0e1a;
  --card: #131a2b;
  --accent: #00e5c7;
  --dim: #7f93a8;
  --warn: #ffb020;
  --good: #00c78c;
  --text: #eaf1f8;
  --border: #1f2a40;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

.hidden { display: none !important; }

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

/* ---- Desktop / wide screens: same layout, centered in a comfortable
   column instead of stretching edge-to-edge. Nothing below this changes
   on mobile - this only kicks in above 700px. ---- */
@media (min-width: 700px) {
  body {
    background:
      radial-gradient(ellipse 900px 600px at 50% 0%, rgba(0, 229, 199, 0.06), transparent 70%),
      var(--bg);
  }
  .screen {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 40px 28px;
  }
  .card {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  }
  .login-card {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
  }
  button, input, select {
    cursor: pointer;
  }
  input, select {
    cursor: text;
  }
  .action-row button:hover,
  .tab-btn:hover:not(.active) {
    filter: brightness(1.15);
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

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

h1 { color: var(--accent); margin: 0 0 4px; letter-spacing: 1px; }
h2 { margin: 0 0 12px; font-size: 16px; color: var(--accent); }
.dim { color: var(--dim); font-size: 13px; }
.small { font-size: 11px; }

label { display: block; font-size: 12px; color: var(--dim); margin-bottom: 4px; margin-top: 10px; }

input, select {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}

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

button {
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  color: #06251f;
  border: none;
  font-weight: 600;
  width: 100%;
  margin-top: 16px;
}

button.primary.big { padding: 16px; font-size: 17px; margin-top: 14px; }
button.accent { background: var(--accent); color: #06251f; border: none; font-weight: 600; flex: 1; }
button.text-btn { background: none; border: none; color: var(--dim); text-decoration: underline; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
header strong { color: var(--accent); margin-right: 8px; }

.status-bar {
  background: var(--card);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
}

.row { margin-bottom: 2px; }

.flash {
  min-height: 20px;
  text-align: center;
  font-size: 14px;
  margin: 4px 0;
}
.flash.ok { color: var(--good); }
.flash.error { color: var(--warn); }

.action-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: auto;
  padding-top: 8px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.tab-btn {
  flex: 0 0 auto;
  padding: 7px 12px;
  font-size: 12.5px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--dim);
  border-radius: 20px;
}
.tab-btn.active {
  background: var(--accent);
  color: #06251f;
  border-color: var(--accent);
  font-weight: 600;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}
.modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  max-width: 360px;
  width: 100%;
  text-align: center;
}
.modal-card h2 { font-size: 17px; margin-bottom: 8px; }
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.mydata-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap: 6px;
  font-size: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.mydata-row:last-child { border-bottom: none; }

.mydata-dl-btn {
  width: 100%;
  margin-bottom: 8px;
}

.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 8px;
  overflow-x: auto;
  display: block;
}
.sheet-table th, .sheet-table td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.sheet-table th { color: var(--dim); font-weight: 600; }
.cell-flag-green { background: rgba(0, 199, 140, 0.18); color: var(--good); }
.cell-flag-red { background: rgba(255, 90, 90, 0.18); color: #ff6b6b; font-weight: 700; }

.msg-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}
.msg-worker { background: var(--card); align-items: flex-start; }
.msg-admin { background: rgba(0, 229, 199, 0.10); align-items: flex-start; border: 1px solid rgba(0, 229, 199, 0.2); }
.msg-from { font-weight: 700; font-size: 11px; color: var(--accent); }
.msg-ts { font-size: 10px; }

.thread-pick-btn {
  padding: 6px 12px;
  margin: 0 6px 6px 0;
  border-radius: 16px;
  font-size: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--dim);
}
.thread-pick-btn.active { background: var(--accent); color: #06251f; border-color: var(--accent); font-weight: 600; }

#msg-unread-dot { color: var(--warn); font-size: 10px; margin-left: 2px; }

.team-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.team-row:last-child { border-bottom: none; }
.team-row button.team-dl-btn {
  padding: 6px 12px;
  font-size: 12px;
  background: var(--accent);
  color: #06251f;
  border: none;
  font-weight: 600;
  border-radius: 6px;
  flex: none;
}

