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

body {
  background: #0f0f1a;
  color: #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  background: #1a1a2e; border: 1px solid #2d2d44; border-radius: 8px;
  padding: 40px; width: 340px;
}
.login-card h1 { color: #7eb8f7; font-size: 20px; margin-bottom: 24px; text-align: center; }

/* Top nav */
.topnav {
  background: #1a1a2e; border-bottom: 1px solid #2d2d44;
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 20px;
}
.brand { color: #7eb8f7; font-size: 16px; font-weight: 700; }
.logout-link { color: #888; font-size: 13px; text-decoration: none; }
.logout-link:hover { color: #e0e0e0; }

/* Flash messages */
.flash { border-left: 4px solid; font-size: 13px; padding: 10px 20px; }
.flash-success { background: #1b3a1b; border-color: #4caf50; color: #a5d6a7; }
.flash-error   { background: #3a1b1b; border-color: #e57373; color: #ef9a9a; }
.flash-skipped { background: #2a2a1b; border-color: #ffc107; color: #ffe082; }

/* Tabs */
.tab-bar {
  background: #16213e; border-bottom: 1px solid #2d2d44;
  display: flex; padding: 0 20px;
}
.tab-btn {
  background: none; border: none; border-bottom: 2px solid transparent;
  color: #888; cursor: pointer; font-size: 13px; padding: 10px 18px;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover { color: #e0e0e0; }
.tab-btn.active { border-bottom-color: #7eb8f7; color: #7eb8f7; font-weight: 600; }

.tab-content { display: none; padding: 20px; }
.tab-content.active { display: block; }

/* Cards */
.card {
  background: #1a1a2e; border: 1px solid #2d2d44; border-radius: 8px;
  margin-bottom: 16px; padding: 20px;
}
.card h3 {
  color: #7eb8f7; font-size: 12px; letter-spacing: .8px;
  margin-bottom: 16px; text-transform: uppercase;
}

/* Settings grid */
.settings-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.card-full { grid-column: 1 / -1; }
@media (max-width: 700px) { .settings-grid { grid-template-columns: 1fr; } }

/* Form fields */
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field label {
  color: #888; display: block; font-size: 11px; letter-spacing: .5px;
  margin-bottom: 5px; text-transform: uppercase;
}
input[type="text"], input[type="email"], input[type="password"],
input[type="time"], select, textarea {
  background: #0d1117; border: 1px solid #333; border-radius: 4px;
  color: #e0e0e0; font-size: 13px; outline: none;
  padding: 7px 10px; transition: border-color .15s; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: #7eb8f7; }
textarea { font-family: monospace; resize: vertical; }
select { appearance: none; cursor: pointer; }

/* Password show/hide */
.pw-wrap { display: flex; gap: 6px; }
.pw-wrap input { flex: 1; }
.show-hide {
  background: #2d2d44; border: 1px solid #333; border-radius: 4px;
  color: #aaa; cursor: pointer; font-size: 11px; padding: 0 10px; white-space: nowrap;
}

/* Schedule */
.schedule-grid { display: grid; gap: 20px; grid-template-columns: 1fr 1fr 1fr auto; align-items: start; }
@media (max-width: 700px) { .schedule-grid { grid-template-columns: 1fr; } }
.day-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.day-label {
  align-items: center; color: #ccc; cursor: pointer;
  display: flex; font-size: 13px; gap: 4px;
  letter-spacing: 0; text-transform: none;
}
.day-label input { width: auto; }
.time-row { display: flex; gap: 6px; margin-bottom: 6px; }
.time-row input { flex: 1; }
.field-toggle { align-self: end; padding-bottom: 4px; }
.toggle-label {
  align-items: center; color: #ccc; cursor: pointer;
  display: flex; font-size: 13px; gap: 8px;
  letter-spacing: 0; text-transform: none;
}
.toggle-label input { width: auto; }

/* Buttons */
.btn-primary {
  background: #2a6496; border: none; border-radius: 4px;
  color: #fff; cursor: pointer; font-size: 13px; font-weight: 600;
  padding: 8px 18px; transition: background .15s;
}
.btn-primary:hover { background: #3a7ab6; }
.btn-primary:disabled { background: #444; cursor: not-allowed; }
.btn-full { padding: 10px; width: 100%; }
.btn-secondary {
  background: transparent; border: 1px solid #444; border-radius: 4px;
  color: #aaa; cursor: pointer; font-size: 12px; margin-top: 4px; padding: 5px 12px;
}
.btn-secondary:hover { border-color: #7eb8f7; color: #7eb8f7; }
.btn-icon {
  background: transparent; border: 1px solid #444; border-radius: 4px;
  color: #888; cursor: pointer; font-size: 12px; padding: 5px 9px;
}
.btn-icon:hover { border-color: #e57373; color: #e57373; }

/* Status / Dashboard */
.status-indicator { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.status-success { color: #4caf50; }
.status-error   { color: #e57373; }
.status-skipped { color: #888; }
.status-meta { color: #888; font-size: 12px; margin-bottom: 4px; }
.status-msg  { color: #ccc; margin-bottom: 12px; }
.sms-preview {
  background: #0d1117; border-radius: 4px; color: #ccc;
  font-size: 12px; margin-bottom: 12px; padding: 10px; white-space: pre-wrap;
}
.run-now-row { align-items: center; display: flex; flex-wrap: wrap; gap: 14px; }
.next-run { color: #888; font-size: 12px; }

/* Tables */
.run-table { border-collapse: collapse; font-size: 13px; width: 100%; }
.run-table th {
  border-bottom: 1px solid #2d2d44; color: #888; font-size: 11px;
  letter-spacing: .5px; padding: 6px 8px; text-align: left; text-transform: uppercase;
}
.run-table td { border-bottom: 1px solid #1e1e30; padding: 8px; }
.log-row { cursor: pointer; }
.log-row:hover td { background: #16213e; }

/* Misc */
.save-row { padding: 4px 0 20px; text-align: right; }
.link-muted { color: #7eb8f7; display: inline-block; font-size: 12px;
              margin-top: 10px; text-decoration: none; }
.link-muted:hover { text-decoration: underline; }
.error { color: #e57373; font-size: 13px; margin: 8px 0; }
