/* ==================================================================
   GSM DASHBOARD — STYLES v0.2
   Modern sans everywhere. Bolder weights. No serifs.
   Dark navy / wood / chrome palette.
   ================================================================== */

:root {
  --bg:         #0f1821;
  --bg-2:       #162230;
  --bg-3:       #1d2c3d;
  --bg-elev:    #22334a;
  --line:       #2a3a4f;
  --line-2:     #3a4c64;
  --text:       #f2f5fa;
  --text-2:     #c8d1dd;
  --text-3:     #8a96a8;
  --chrome:     #eef1f6;
  --chrome-dark:#9ea7b5;
  --wood:       #d4a368;
  --wood-light: #ecc795;
  --wood-dark:  #9b7542;
  --walnut:     #6b4423;
  --gold:       #e0b66c;
  --green:      #8fbc7a;
  --red:        #d47474;
  --radius:     10px;
  --radius-sm:  6px;
  --shadow:     0 4px 24px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
  min-height: -webkit-fill-available;
}

/* Texture overlay */
body::before {
  content: ''; position: fixed; inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(212, 163, 104, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(42, 58, 79, 0.4) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}
body::after {
  content: ''; position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.12 0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 1; opacity: 0.5; mix-blend-mode: overlay;
}

[hidden] { display: none !important; }

/* ==================================================================
   LOGIN SCREEN
   ================================================================== */
.login-screen {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, var(--bg-3) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  padding: 48px 40px 40px;
  box-shadow: var(--shadow);
  position: relative;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--wood), transparent);
  border-radius: 16px 16px 0 0;
}

.login-brand {
  text-align: center;
  margin-bottom: 36px;
}

.login-brand-mark {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 46px;
  letter-spacing: -0.02em;
  color: var(--chrome);
  line-height: 1;
  margin-bottom: 12px;
  background: linear-gradient(180deg, var(--chrome) 0%, var(--chrome-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.login-brand-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--wood-light);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-2);
}

.field input {
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.field input:focus {
  outline: none;
  border-color: var(--wood);
  background: var(--bg-2);
  box-shadow: 0 0 0 3px rgba(212, 163, 104, 0.15);
}

.btn-primary {
  margin-top: 10px;
  background: linear-gradient(180deg, var(--wood-light) 0%, var(--wood) 50%, var(--wood-dark) 100%);
  color: #1a1208;
  border: 1px solid var(--wood-dark);
  border-radius: var(--radius-sm);
  padding: 15px 20px;
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
  box-shadow: 0 2px 10px rgba(212, 163, 104, 0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212, 163, 104, 0.4);
  filter: brightness(1.06);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: wait;
}

.login-error {
  background: rgba(212, 116, 116, 0.15);
  border: 1px solid rgba(212, 116, 116, 0.45);
  color: #f4c4c4;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

/* ==================================================================
   APP SHELL
   ================================================================== */
.app {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.control-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 24, 33, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-2);
  padding: 14px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.control-bar-left,
.control-bar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  height: 55px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.user-chip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line-2);
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text);
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-ghost:hover {
  color: var(--wood-light);
  border-color: var(--wood);
  background: rgba(212, 163, 104, 0.08);
}

/* ==================================================================
   TAB NAV
   ================================================================== */
.tab-nav {
  background: var(--bg-2);
  border-bottom: 1px solid var(--line-2);
  padding: 0 14px;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: sticky;
  top: 57px;
  z-index: 99;
}

.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-2);
  padding: 16px 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color 0.15s;
  border-bottom: 2px solid transparent;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--wood-light);
  border-bottom-color: var(--wood);
}

/* ==================================================================
   TAB PANELS
   ================================================================== */
.tab-container {
  flex: 1;
  padding: 36px 28px 80px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel-header {
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-2);
}

.panel-title {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 34px;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.1;
}

.panel-subtitle {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--wood-light);
}

.placeholder-card {
  background: linear-gradient(180deg, var(--bg-3) 0%, var(--bg-2) 100%);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  padding: 56px 32px;
  text-align: center;
}

.placeholder-icon {
  font-size: 44px;
  margin-bottom: 16px;
  opacity: 0.85;
}

.placeholder-card h2 {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 12px;
}

.placeholder-card p {
  color: var(--text);
  max-width: 520px;
  margin: 0 auto;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
}

.user-info-card {
  margin-top: 24px;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 22px 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.9;
}

.user-info-card strong {
  color: var(--wood-light);
  font-weight: 700;
  display: inline-block;
  min-width: 110px;
}

/* ==================================================================
   FOOTER
   ================================================================== */
.app-footer {
  margin-top: auto;
  padding: 18px 28px;
  border-top: 1px solid var(--line-2);
  background: var(--bg-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-2);
}

.connection-status {
  color: var(--green);
  font-weight: 700;
}

.connection-status.offline {
  color: var(--red);
}

/* ==================================================================
   RESPONSIVE
   ================================================================== */
@media (max-width: 640px) {
  .control-bar { padding: 12px 18px; }
  .brand-logo { height: 45px; }
  .user-chip { display: none; }
  .tab-container { padding: 24px 18px 60px; }
  .panel-title { font-size: 28px; }
  .tab-btn { padding: 13px 15px; font-size: 11px; }
  .login-card { padding: 40px 28px 32px; }
  .login-brand-mark { font-size: 40px; }
}

/* Safe area for iOS notch / home indicator */
@supports (padding: max(0px)) {
  .control-bar { padding-top: max(14px, env(safe-area-inset-top)); }
  .app-footer { padding-bottom: max(18px, env(safe-area-inset-bottom)); }
}
