@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* ═══ Cyber Teal Master Design Tokens ═══ */
:root {
  --bg: #070e17;
  --bg-sidebar: #0b1623;
  --bg-card: #101e30;
  --bg-card-hover: #15273e;
  --bg-input: #15273e;
  --border: rgba(45, 212, 191, 0.2);
  --border-focus: #14b8a6;
  --text: #f0fdfa;
  --text-dim: #99f6e4;
  --text-muted: #5eead4;
  --accent: #14b8a6;
  --accent-glow: rgba(20, 184, 166, 0.25);
  --accent-glow2: rgba(20, 184, 166, 0.12);
  --red: #f43f5e;
  --green: #10b981;
  --yellow: #f59e0b;
  --amber: #f59e0b;
  --radius: 14px;
}

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

:root, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg) !important;
  color: var(--text) !important;
  height: 100vh;
  display: flex;
  overflow: hidden;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ═══ Global Form Controls Fix (Eliminates ALL white backgrounds/text) ═══ */
input, select, textarea, button {
  font-family: inherit;
  color: var(--text) !important;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="search"],
select,
textarea,
.input-field {
  background-color: var(--bg-input) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: 10px;
  padding: 10px 14px;
  outline: none;
  font-size: 14px;
  transition: all 0.2s ease;
  width: 100%;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim) !important;
  opacity: 0.65;
}

input:focus,
select:focus,
textarea:focus,
.input-field:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow) !important;
}

select option {
  background-color: var(--bg-card) !important;
  color: var(--text) !important;
  padding: 10px;
}

/* ═══ Views & Layout ═══ */
.view { display: none; width: 100%; height: 100vh; background: var(--bg); }
.view.active { display: flex; }

/* Login View */
#login-view { align-items: center; justify-content: center; background: var(--bg); width: 100vw; height: 100vh; }
.login-card { background: var(--bg-card); border: 1px solid var(--border); padding: 40px; border-radius: 20px; width: 380px; max-width: 90vw; box-shadow: 0 10px 40px rgba(0,0,0,0.5); text-align: center; }
.login-logo { width: 54px; height: 54px; background: linear-gradient(135deg,var(--accent),#6366f1); border-radius: 14px; display: grid; place-items: center; font-weight: 800; font-size: 24px; color: #fff; margin: 0 auto 16px; }
.login-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; color: #fff; }
.login-sub { font-size: 13.5px; color: var(--text-dim); margin-bottom: 24px; }
.form-group { text-align: left; margin-bottom: 18px; }
.form-group label { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--text-dim); display: block; margin-bottom: 6px; letter-spacing: 0.5px; }

/* Sidebar */
.side { width: 260px; background: var(--bg-sidebar); border-left: 1px solid var(--border); display: flex; flex-direction: column; padding: 20px 14px; flex-shrink: 0; z-index: 100; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand-icon { width: 34px; height: 34px; background: linear-gradient(135deg,var(--accent),#6366f1); border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 16px; color: #fff; flex-shrink: 0; }
.brand span { font-size: 17px; font-weight: 700; letter-spacing: -.3px; color: #fff; }
.nav-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; color: var(--text-dim); padding: 16px 10px 8px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; font-size: 14px; font-weight: 500; color: var(--text-dim); cursor: pointer; transition: all .18s; border: none; background: 0; width: 100%; text-align: left; margin-bottom: 3px; position: relative; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 2; }
.nav-item:hover { background: var(--accent-glow); color: var(--text); }
.nav-item.on { background: var(--accent-glow); color: var(--text); font-weight: 600; }
.nav-item.on::before { content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3.5px; background: var(--accent); border-radius: 0 4px 4px 0; }
.nav-item.on svg { stroke: var(--accent); }

.foot-card { padding: 12px 14px; background: var(--accent-glow2); border: 1px solid var(--border); border-radius: 12px; }
.foot-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); }
.foot-row+.foot-row { margin-top: 5px; }

/* Main Screen */
.main { flex: 1; display: flex; flex-direction: column; height: 100vh; overflow: hidden; background: var(--bg); position: relative; }
.top { height: 60px; border-bottom: 1px solid var(--border); padding: 0 32px; display: flex; align-items: center; justify-content: space-between; background: var(--bg-sidebar); flex-shrink: 0; }
.top-left { display: flex; align-items: center; gap: 14px; }
.top h2 { font-size: 17px; font-weight: 700; letter-spacing: -.2px; color: #ffffff; }

/* Content Area, Cards, Tables */
.content-area { flex: 1; overflow-y: auto; padding: 28px 36px; display: flex; flex-direction: column; gap: 20px; width: 100%; box-sizing: border-box; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); transition: all 0.3s; }
.card:hover { border-color: var(--accent); box-shadow: 0 8px 30px rgba(0,0,0,0.25); }

.table-wrap { overflow-x: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 20px rgba(0,0,0,0.15); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13.5px; }
th { background: rgba(0,0,0,0.3); padding: 14px 18px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; font-size: 11.5px; letter-spacing: 0.8px; border-bottom: 1px solid var(--border); }
td { padding: 14px 18px; border-bottom: 1px solid rgba(255,255,255,0.03); color: var(--text); vertical-align: middle; }
tr:hover td { background: var(--accent-glow2); }

/* Buttons & Badges */
.btn { padding: 8px 14px; border-radius: 8px; background: linear-gradient(135deg,var(--accent),#6366f1); border: 0; color: #fff !important; font-weight: 600; font-size: 13px; cursor: pointer; transition: all 0.25s; display: inline-flex; align-items: center; gap: 6px; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(129,140,248,0.4); filter: brightness(1.1); }
.btn-secondary { background: var(--bg-input) !important; border: 1px solid var(--border) !important; color: var(--text) !important; }
.btn-secondary:hover { background: var(--bg-card-hover) !important; border-color: var(--accent) !important; }
.btn-danger { background: var(--red) !important; color: #fff !important; }
.badge { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); background: var(--bg-card); border: 1px solid var(--border); padding: 6px 14px; border-radius: 20px; }

/* Toolbars */
.models-toolbar, .file-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; background: var(--bg-card); padding: 14px 18px; border-radius: 12px; border: 1px solid var(--border); }

/* Chat Drawer */
.chat-drawer { position: fixed; top: 0; right: -420px; width: 420px; max-width: 100vw; height: 100vh; background: var(--bg-card); border-left: 1px solid var(--border); z-index: 700; transition: right 0.3s; display: flex; flex-direction: column; }
.chat-drawer.open { right: 0; }
.chat-drawer-head { height: 60px; border-bottom: 1px solid var(--border); padding: 0 20px; display: flex; align-items: center; justify-content: space-between; background: var(--bg-sidebar); }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 20px; }
.user-msg { background: var(--bg-input); border: 1px solid var(--border); padding: 14px 18px; border-radius: 16px 16px 4px 16px; font-size: 14.5px; color: var(--text); }
.chat-input-wrap { padding: 16px; border-top: 1px solid var(--border); background: var(--bg-sidebar); }

/* Modals & Toasts */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(5px); z-index: 9000; display: none; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.active { display: flex; }
.modal-content { background: var(--bg-card); border: 1px solid var(--border); border-radius: 16px; max-width: 720px; width: 95vw; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text); box-shadow: 0 8px 30px rgba(0,0,0,0.4); }

/* Status Dot Pulse */
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(74,222,128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128, 0); }
}
.dot { animation: pulse-dot 2s infinite; border: 1px solid rgba(255,255,255,0.2); width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }


.login-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, var(--accent), #6366f1) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 10px;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s ease;
}
.login-btn:hover {
  filter: brightness(1.15);
  box-shadow: 0 4px 15px rgba(20, 184, 166, 0.4);
  transform: translateY(-1px);
}


html, body {
  width: 100vw !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
}

.view {
  width: 100vw !important;
  max-width: 100vw !important;
}

#app-view {
  display: flex !important;
  flex-direction: row !important;
  width: 100vw !important;
  height: 100vh !important;
}

.side {
  width: 260px !important;
  min-width: 260px !important;
  flex-shrink: 0 !important;
}

.main {
  flex: 1 !important;
  width: calc(100vw - 260px) !important;
  max-width: calc(100vw - 260px) !important;
  height: 100vh !important;
}

.content-area {
  width: 100% !important;
  max-width: 100% !important;
}


#login-view {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 99999 !important;
  background: var(--bg) !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
#login-view:not(.active) {
  display: none !important;
}
#app-view:not(.active) {
  display: none !important;
}
