:root {
  --bg: #10151b;
  --panel: #1b232d;
  --border: #303b48;
  --text: #f5f6f7;
  --text-muted: #9aa6b3;
  --gold: #e5b94f;
  --gold-hover: #f3c75d;
  --green: #63c990;
  --red: #d75b5b;
  --red-hover: #e56d6d;
  --blue: #4a90e2;
  --font: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* App Container */
.app-container {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.app-container.wide {
  max-width: 900px;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.brand {
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.brand small {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.08em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  background: #222c38;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.badge.online {
  color: var(--green);
  border-color: rgba(99, 201, 144, 0.4);
}

.badge.offline {
  color: var(--red);
  border-color: rgba(215, 91, 91, 0.4);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* Buttons & Inputs */
button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none;
  transition: opacity 0.15s, transform 0.05s, background-color 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

button:active {
  transform: scale(0.98);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  text-decoration: none;
}

.btn:hover { background: #263240; }
.btn-primary { background: var(--gold); color: #16130c; border: none; }
.btn-primary:hover { background: var(--gold-hover); }
.btn-danger { background: var(--red); color: white; border: none; }
.btn-danger:hover { background: var(--red-hover); }
.btn-sm { padding: 6px 10px; font-size: 11px; }

input[type="text"], input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #141b22;
  color: var(--text);
  font-size: 14px;
  outline: none;
}

input[type="text"]:focus, input[type="password"]:focus {
  border-color: var(--gold);
}

/* Device Alert Banner */
.device-warning-banner {
  background: rgba(229, 185, 79, 0.15);
  border: 1px solid rgba(229, 185, 79, 0.4);
  color: #ffde7a;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.device-warning-banner .actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* Cue Grid / List */
.cue-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.cue-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cue-card.on {
  border-color: var(--green);
  box-shadow: inset 4px 0 var(--green), 0 0 10px rgba(99, 201, 144, 0.2);
}

.cue-btn-num {
  height: 48px;
  border-radius: 8px;
  background: var(--gold);
  color: #16130c;
  font-size: 22px;
  font-weight: 900;
}

.cue-card.on .cue-btn-num {
  background: var(--green);
  color: #0b2214;
}

.cue-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.cue-name {
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

.cue-sub {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Master Volume */
.volume-panel {
  display: grid;
  grid-template-columns: 46px 1fr 46px 52px;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.volume-panel button {
  height: 40px;
  border-radius: 8px;
  background: #2a3542;
  color: white;
  font-size: 20px;
  font-weight: 900;
}

.volume-panel input[type="range"] {
  width: 100%;
  accent-color: var(--gold);
  cursor: pointer;
}

.volread {
  text-align: center;
  font-size: 12px;
  font-weight: 900;
  color: var(--gold);
}

/* Master Controls Sticky Bottom */
.master-actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 10px;
  background: var(--bg);
  z-index: 10;
}

.master-actions button {
  height: 52px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.btn-fade {
  background: var(--gold);
  color: #16130c;
}

.btn-stop {
  background: var(--red);
  color: white;
}

/* Mobile Remote Large Touch Layout */
.mobile-remote .cue-list {
  gap: 8px;
}

.mobile-remote .cue-card {
  padding: 10px 12px;
  grid-template-columns: 56px 1fr;
}

.mobile-remote .cue-btn-num {
  height: 56px;
  font-size: 26px;
}

.mobile-remote .cue-name {
  font-size: 15px;
}

.mobile-remote .master-actions button {
  height: 60px;
  font-size: 16px;
}

/* Host Audio Arm Screen Overlay */
.audio-arm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 21, 27, 0.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 24px;
  text-align: center;
}

.audio-arm-card {
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.audio-arm-card h2 {
  color: var(--gold);
  margin-bottom: 10px;
  font-size: 20px;
}

.audio-arm-card p {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 18px;
}

/* Admin Dashboard Table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.admin-table th, .admin-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.admin-table th {
  background: #141b22;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

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

.card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  max-width: 440px;
  width: 90%;
}

