/* NOC Operations Dashboard - Main CSS - No external dependencies */

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

:root {
  --bg:       #080c14;
  --bg2:      #0d1525;
  --bg3:      #111c30;
  --bg4:      #152038;
  --bgh:      #1a2847;
  --bd:       #1e3050;
  --bd2:      #243860;
  --t1:       #e2e8f0;
  --t2:       #94a3b8;
  --t3:       #4a6080;
  --tm:       #7dd3fc;
  --blue:     #3b82f6;
  --cyan:     #06b6d4;
  --green:    #10b981;
  --yellow:   #f59e0b;
  --red:      #ef4444;
  --purple:   #8b5cf6;
  --sw: 240px;
  --th: 56px;
  --r:  8px;
  --r2: 12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  background: var(--bg);
  color: var(--t1);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: linear-gradient(rgba(59,130,246,.03) 1px,transparent 1px),
                    linear-gradient(90deg,rgba(59,130,246,.03) 1px,transparent 1px);
  background-size: 40px 40px;
  pointer-events: none; z-index: 0;
}

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--cyan); }
code { font-family: 'Courier New', Consolas, monospace; font-size: .85em; color: var(--tm); }

/* ---- Layout ---- */
.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sw); background: var(--bg2); border-right: 1px solid var(--bd);
  display: flex; flex-direction: column; position: fixed;
  top: 0; left: 0; bottom: 0; z-index: 100;
  transition: transform .3s; overflow-y: auto;
}
.sb-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--bd); min-height: var(--th);
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 36px; height: 36px; border-radius: var(--r);
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.logo-name  { font-weight: 700; font-size: 13px; display: block; }
.logo-ver   { font-size: 10px; color: var(--t3); font-family: 'Courier New', monospace; }

.sb-nav { flex: 1; padding: 12px 8px; }
.nav-sec { margin-bottom: 18px; }
.nav-lbl {
  font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--t3); padding: 0 8px; margin-bottom: 4px; display: block;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--r); color: var(--t2);
  font-size: 13px; font-weight: 500; border: 1px solid transparent;
  transition: all .15s; text-decoration: none; position: relative;
}
.nav-item:hover { background: var(--bg3); color: var(--t1); border-color: var(--bd); }
.nav-item.active { background: rgba(59,130,246,.12); color: var(--blue); border-color: rgba(59,130,246,.3); }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
  width: 3px; background: var(--blue); border-radius: 0 2px 2px 0;
}
.nav-ico  { width: 20px; text-align: center; font-size: 15px; flex-shrink: 0; }
.nav-txt  { flex: 1; }
.nav-bdg  { background: var(--red); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; }
.nav-item.logout:hover { color: var(--red); background: rgba(239,68,68,.08); border-color: rgba(239,68,68,.3); }

.sb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-top: 1px solid var(--bd); background: var(--bg3);
}

/* ---- Main ---- */
.main { flex: 1; margin-left: var(--sw); display: flex; flex-direction: column; }

/* ---- Topbar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--th); background: var(--bg2); border-bottom: 1px solid var(--bd);
  padding: 0 24px; position: sticky; top: 0; z-index: 50;
}
.topbar-l { display: flex; align-items: center; gap: 12px; }
.topbar-r { display: flex; align-items: center; gap: 14px; }
.pg-title  { font-size: 15px; font-weight: 700; }
.mob-btn   { display: none; background: none; border: none; color: var(--t2); cursor: pointer; font-size: 20px; }

.clock {
  font-family: 'Courier New', Consolas, monospace; font-size: 13px;
  color: var(--cyan); background: rgba(6,182,212,.08);
  padding: 4px 10px; border-radius: var(--r); border: 1px solid rgba(6,182,212,.2);
}
.notif-btn { position: relative; font-size: 18px; color: var(--t2); cursor: pointer; text-decoration: none; }
.notif-btn:hover { color: var(--t1); }
.notif-dot {
  position: absolute; top: -4px; right: -6px;
  background: var(--red); color: #fff; font-size: 9px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.content { padding: 24px; flex: 1; }

/* ---- Avatar ---- */
.ava {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; flex-shrink: 0; font-size: 12px;
}
.ava-sm { width: 28px; height: 28px; font-size: 10px; }
.ava-md { width: 32px; height: 32px; font-size: 12px; }
.ava-lg { width: 64px; height: 64px; font-size: 24px; }
.u-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-role { font-size: 11px; color: var(--t3); }

/* ---- Cards ---- */
.card {
  background: var(--bg4); border: 1px solid var(--bd); border-radius: var(--r2); padding: 20px;
}
.card-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-title { font-size: 14px; font-weight: 600; }
.card-sub   { font-size: 12px; color: var(--t3); margin-top: 2px; }

/* ---- Stats ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; margin-bottom: 22px; }
.stat {
  background: var(--bg4); border: 1px solid var(--bd); border-radius: var(--r2);
  padding: 18px; position: relative; overflow: hidden; transition: transform .15s;
}
.stat:hover { transform: translateY(-1px); }
.stat::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--sc, var(--blue)); }
.stat-ico { font-size: 22px; margin-bottom: 8px; }
.stat-val { font-size: 26px; font-weight: 700; font-family: 'Courier New', monospace; }
.stat-lbl { font-size: 11px; color: var(--t3); margin-top: 3px; text-transform: uppercase; letter-spacing: .05em; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--r); font-size: 13px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent; transition: all .15s;
  font-family: inherit; text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--blue);   color: #fff; }
.btn-primary:hover:not(:disabled) { background: #2563eb; color: #fff; }
.btn-success { background: var(--green);  color: #fff; }
.btn-success:hover:not(:disabled) { background: #059669; }
.btn-warn    { background: var(--yellow); color: #000; }
.btn-warn:hover:not(:disabled) { background: #d97706; }
.btn-danger  { background: var(--red);    color: #fff; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--t2); border-color: var(--bd); }
.btn-ghost:hover:not(:disabled) { background: var(--bg3); color: var(--t1); }
.btn-sm  { padding: 5px 10px; font-size: 12px; }
.btn-lg  { padding: 11px 22px; font-size: 15px; }
.btn-block { width: 100%; justify-content: center; }

/* ---- Forms ---- */
.fg { margin-bottom: 15px; }
.lbl {
  display: block; font-size: 11px; font-weight: 700;
  color: var(--t2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .05em;
}
.inp {
  width: 100%; padding: 9px 12px; background: var(--bg3); border: 1px solid var(--bd);
  border-radius: var(--r); color: var(--t1); font-family: inherit; font-size: 13px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.inp:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.inp::placeholder { color: var(--t3); }
select.inp { cursor: pointer; }
textarea.inp { resize: vertical; min-height: 80px; }
.hint { font-size: 11px; color: var(--t3); margin-top: 4px; }
.ferr { font-size: 11px; color: var(--red); margin-top: 4px; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---- Table ---- */
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  text-align: left; padding: 9px 14px;
  font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--t3); border-bottom: 1px solid var(--bd); white-space: nowrap;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid rgba(30,48,80,.5); font-size: 13px; vertical-align: middle; }
tbody tr:hover { background: var(--bgh); }
tbody tr:last-child td { border-bottom: none; }

/* ---- Status & Priority badges ---- */
.sts { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.sts-new        { background: rgba(59,130,246,.15); color: #93c5fd; border: 1px solid rgba(59,130,246,.3); }
.sts-processing { background: rgba(245,158,11,.15);  color: #fcd34d; border: 1px solid rgba(245,158,11,.3); }
.sts-waiting    { background: rgba(139,92,246,.15);  color: #c4b5fd; border: 1px solid rgba(139,92,246,.3); }
.sts-completed  { background: rgba(16,185,129,.15);  color: #6ee7b7; border: 1px solid rgba(16,185,129,.3); }
.sts-cancelled  { background: rgba(239,68,68,.15);   color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }

.pri { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: .05em; }
.pri-low      { background: rgba(100,116,139,.2); color: #94a3b8; }
.pri-normal   { background: rgba(59,130,246,.2);  color: #93c5fd; }
.pri-high     { background: rgba(245,158,11,.2);  color: #fcd34d; }
.pri-critical { background: rgba(239,68,68,.2);   color: #fca5a5; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 rgba(239,68,68,.4)} 50%{box-shadow:0 0 0 4px rgba(239,68,68,0)} }

/* ---- Kanban ---- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 16px; min-height: calc(100vh - 180px); }
.kcol {
  min-width: 270px; width: 270px; flex-shrink: 0;
  display: flex; flex-direction: column;
  background: var(--bg2); border: 1px solid var(--bd); border-radius: var(--r2);
  max-height: calc(100vh - 180px);
}
.kcol-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--bd);
  background: var(--bg2); border-radius: var(--r2) var(--r2) 0 0;
  position: sticky; top: 0;
}
.kcol-title { font-size: 12px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.kcol-dot   { width: 8px; height: 8px; border-radius: 50%; }
.kcol-cnt   { background: var(--bg3); border: 1px solid var(--bd); padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.kcards     { flex: 1; padding: 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.kcards.drag-over { background: rgba(59,130,246,.05); border-radius: 6px; }
.kempty     { text-align: center; padding: 28px 14px; color: var(--t3); font-size: 12px; }

/* ---- Task Card ---- */
.tcard {
  background: var(--bg4); border: 1px solid var(--bd); border-radius: var(--r);
  padding: 11px; cursor: grab; transition: all .15s;
}
.tcard:hover { border-color: var(--bd2); box-shadow: 0 4px 16px rgba(0,0,0,.35); }
.tcard.dragging { opacity: .4; cursor: grabbing; }
.tcard.processing { background: rgba(245,158,11,.06); border-color: rgba(245,158,11,.3); }
.tc-top  { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.tc-type { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--t3); font-weight: 600; }
.tc-dom  { font-size: 13px; font-weight: 700; color: var(--t1); margin-bottom: 3px; font-family: 'Courier New', monospace; }
.tc-cli  { font-size: 12px; color: var(--t2); margin-bottom: 7px; }
.tc-proc { font-size: 11px; color: var(--yellow); display: flex; align-items: center; gap: 5px; margin-bottom: 5px; }
.tc-blink{ width: 6px; height: 6px; background: var(--yellow); border-radius: 50%; animation: blink 1s infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:.2} }
.tc-note { font-size: 11px; color: var(--t3); margin-top: 5px; line-height: 1.4; }
.tc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.tc-time { font-size: 10px; color: var(--t3); font-family: 'Courier New', monospace; }
.tc-acts { display: flex; gap: 4px; }
.tc-btn  { padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; cursor: pointer; border: none; transition: all .15s; font-family: inherit; }
.tc-btn.start    { background: rgba(16,185,129,.2);  color: #6ee7b7; }
.tc-btn.start:hover  { background: rgba(16,185,129,.35); }
.tc-btn.done     { background: rgba(59,130,246,.2);  color: #93c5fd; }
.tc-btn.done:hover   { background: rgba(59,130,246,.35); }
.tc-btn.cancel   { background: rgba(239,68,68,.15);  color: #fca5a5; }
.tc-btn.cancel:hover { background: rgba(239,68,68,.3); }

/* ---- Alerts ---- */
.alert {
  padding: 11px 15px; border-radius: var(--r); font-size: 13px; margin-bottom: 15px;
  display: flex; align-items: flex-start; gap: 9px; border: 1px solid;
}
.alert-ok   { background: rgba(16,185,129,.1);  border-color: rgba(16,185,129,.3); color: #6ee7b7; }
.alert-err  { background: rgba(239,68,68,.1);   border-color: rgba(239,68,68,.3);  color: #fca5a5; }
.alert-warn { background: rgba(245,158,11,.1);  border-color: rgba(245,158,11,.3); color: #fcd34d; }
.alert-info { background: rgba(59,130,246,.1);  border-color: rgba(59,130,246,.3); color: #93c5fd; }

/* ---- Modal ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7);
  backdrop-filter: blur(3px); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg2); border: 1px solid var(--bd); border-radius: var(--r2);
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 25px 70px rgba(0,0,0,.6);
  transform: translateY(20px); transition: transform .2s;
}
.overlay.open .modal { transform: translateY(0); }
.modal-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px; border-bottom: 1px solid var(--bd);
}
.modal-title { font-size: 15px; font-weight: 700; }
.modal-x { background: none; border: none; color: var(--t3); cursor: pointer; font-size: 20px; }
.modal-x:hover { color: var(--t1); }
.modal-body { padding: 22px; }
.modal-ft { padding: 14px 22px; border-top: 1px solid var(--bd); display: flex; gap: 10px; justify-content: flex-end; }

/* ---- Toast ---- */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--bg3); border: 1px solid var(--bd); border-radius: var(--r);
  padding: 11px 15px; min-width: 260px; max-width: 340px;
  display: flex; align-items: flex-start; gap: 9px;
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
  animation: tin .3s ease;
}
.toast.out { animation: tout .3s ease forwards; }
@keyframes tin  { from{transform:translateX(100%);opacity:0} to{transform:translateX(0);opacity:1} }
@keyframes tout { from{transform:translateX(0);opacity:1}    to{transform:translateX(100%);opacity:0} }
.toast-ok   { border-left: 3px solid var(--green); }
.toast-err  { border-left: 3px solid var(--red); }
.toast-warn { border-left: 3px solid var(--yellow); }
.toast-info { border-left: 3px solid var(--blue); }
.toast-ico  { font-size: 17px; flex-shrink: 0; }
.toast-ttl  { font-size: 13px; font-weight: 600; }
.toast-msg  { font-size: 12px; color: var(--t2); margin-top: 1px; }

/* ---- Auth ---- */
.auth-pg { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 22px; background: var(--bg); }
.auth-box {
  width: 100%; max-width: 400px;
  background: var(--bg2); border: 1px solid var(--bd); border-radius: 14px;
  padding: 32px; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.auth-logo { text-align: center; margin-bottom: 26px; }
.auth-ico  { font-size: 36px; }
.auth-ttl  { font-size: 20px; font-weight: 700; margin: 6px 0 2px; }
.auth-sub2 { font-size: 12px; color: var(--t3); }
.auth-h2   { font-size: 17px; font-weight: 700; margin-bottom: 3px; }
.auth-p    { font-size: 13px; color: var(--t3); margin-bottom: 22px; }
.auth-lnk  { text-align: center; font-size: 13px; color: var(--t3); margin-top: 18px; }

/* ---- Logs ---- */
.log-list { display: flex; flex-direction: column; }
.log-row { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-bottom: 1px solid rgba(30,48,80,.4); }
.log-row:last-child { border-bottom: none; }
.log-time { font-size: 11px; color: var(--t3); font-family: 'Courier New', monospace; white-space: nowrap; min-width: 95px; }
.log-dot  { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.log-txt  { font-size: 13px; color: var(--t2); flex: 1; }
.log-txt strong { color: var(--t1); }

/* ---- Shift ---- */
.shift-row {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 14px; border-radius: var(--r); border: 1px solid var(--bd);
  background: var(--bg3); margin-bottom: 8px;
}
.shift-row.active { background: rgba(16,185,129,.07); border-color: rgba(16,185,129,.3); }
.on-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); animation: blink 1.2s infinite; }

/* ---- Toolbar ---- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar-l { display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap; }
.toolbar-r { display: flex; gap: 7px; }
.srch {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg3); border: 1px solid var(--bd); border-radius: var(--r);
  padding: 6px 11px; min-width: 200px;
}
.srch:focus-within { border-color: var(--blue); }
.srch input { background: none; border: none; color: var(--t1); font-size: 13px; outline: none; flex: 1; font-family: inherit; }
.srch input::placeholder { color: var(--t3); }
.pill {
  padding: 4px 11px; border-radius: 20px; font-size: 12px; font-weight: 500;
  cursor: pointer; border: 1px solid var(--bd); background: var(--bg3); color: var(--t2); transition: all .15s;
}
.pill:hover { border-color: var(--bd2); color: var(--t1); }
.pill.on { background: rgba(59,130,246,.15); border-color: rgba(59,130,246,.4); color: var(--blue); }

/* ---- Grid helpers ---- */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.mt2 { margin-top: 8px; }
.mt3 { margin-top: 12px; }
.mt4 { margin-top: 16px; }
.mb4 { margin-bottom: 16px; }
.tc  { text-align: center; }
.muted { color: var(--t3); }
.flex  { display: flex; }
.flex-c { display: flex; align-items: center; }
.gap2   { gap: 8px; }

/* ---- Overlay / mobile ---- */
.mob-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 90; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bd2); border-radius: 3px; }

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 30px rgba(0,0,0,.5); }
  .mob-overlay.show { display: block; }
  .main { margin-left: 0; }
  .mob-btn { display: block; }
  .content { padding: 14px; }
  .stats { grid-template-columns: repeat(2,1fr); }
  .frow { grid-template-columns: 1fr; }
  .g2,.g3 { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
}
@media (max-width: 480px) {
  .auth-box { padding: 22px; }
  .stats { grid-template-columns: 1fr 1fr; }
}
