/* NovaTMS - Tech Dashboard UI
   Theme:
   - Background / Sidebar: #0D2237
   - Accent: #F3810B
*/

:root{
  --bg: #0D2237;
  --accent: #F3810B;

  --surface: rgba(255,255,255,0.06);
  --surface-2: rgba(255,255,255,0.045);
  --stroke: rgba(243,129,11,0.18);
  --stroke-soft: rgba(255,255,255,0.08);

  --text: rgba(240,247,255,0.92);
  --muted: rgba(240,247,255,0.62);
  --muted-2: rgba(240,247,255,0.45);

  --danger: #ff4d4d;
  --success: #19c37d;
  --warn: #f2c94c;

  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --shadow: 0 18px 40px rgba(0,0,0,0.35);
  --shadow-soft: 0 8px 24px rgba(0,0,0,0.28);

  --sidebar-w: 270px;

  --font: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:var(--font);
  background: radial-gradient(900px 600px at 12% 10%, rgba(243,129,11,0.10), transparent 55%),
              radial-gradient(800px 500px at 90% 12%, rgba(255,255,255,0.06), transparent 60%),
              var(--bg);
  color:var(--text);
}

a{ color:inherit; text-decoration:none; }
a:hover{ opacity:0.98; }

.accent{ color: var(--accent); }

.app{
  min-height:100%;
  display:flex;
}

.sidebar{
  width:var(--sidebar-w);
  flex:0 0 var(--sidebar-w);
   background: linear-gradient(
    180deg,
    rgba(255,255,255,0.02),
    rgba(0,0,0,0.04)
  ),
  #222D38;
  border-right: 1px solid var(--stroke-soft);
  padding:18px 16px;
  position:sticky;
  top:0;
  height:100vh;
  overflow:auto;
}
.sidebar{
  background: #222D38;
}

.sidebar__brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 10px 16px 10px;
  border-bottom:1px solid rgba(255,255,255,0.08);
  margin-bottom:16px;
}
.brand__mark{
  width:42px;
  height:42px;
  border-radius:14px;
  display:grid;
  place-items:center;
  color:#111;
  background: linear-gradient(135deg, var(--accent), rgba(243,129,11,0.65));
  box-shadow: 0 10px 20px rgba(243,129,11,0.18);
  font-weight:800;
}
.brand__name{
  font-weight:750;
  letter-spacing:0.2px;
}
.brand__tag{
  margin-top:2px;
  color:var(--muted);
  font-size:12px;
}

.sidebar__profile{
  display:flex;
  gap:12px;
  align-items:center;
  padding:14px 10px;
  background: var(--surface-2);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-md);
  margin-bottom:14px;
}
.profile__avatar{
  width:40px; height:40px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  background: rgba(243,129,11,0.14);
  border:1px solid rgba(243,129,11,0.26);
  color:var(--accent);
  font-weight:800;
}
.profile__name{
  font-weight:650;
  line-height:1.1;
}
.profile__role{
  display:flex;
  gap:8px;
  margin-top:6px;
  flex-wrap:wrap;
}

.nav{ display:flex; flex-direction:column; gap:6px; margin-top:10px; }
.nav__item{
  display:flex;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  border-radius: 14px;
  border:1px solid transparent;
  color: var(--muted);
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
}
.nav__item svg{ width:20px; height:20px; fill: currentColor; opacity:0.95; }
.nav__item:hover{
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.08);
  transform: translateY(-1px);
  color: var(--text);
}
.nav__item--active{
  background: rgba(243,129,11,0.12);
  border-color: rgba(243,129,11,0.28);
  color: var(--text);
}
.nav__label{ font-weight:600; }

.sidebar__footer{
  margin-top:18px;
  padding-top:14px;
  border-top:1px solid rgba(255,255,255,0.08);
}
.sidebar__hint{
  margin-top:10px;
  color:var(--muted-2);
  font-size:12px;
}

.main{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
}

.topbar{
  display:flex;
  align-items:center;
  gap:14px;
  padding:18px 22px;
  border-bottom:1px solid rgba(255,255,255,0.08);
  position:sticky;
  top:0;
  background: rgba(13,34,55,0.78);
  backdrop-filter: blur(10px);
  z-index:10;
}
.topbar__menu{ display:none; }
.topbar__title .kicker{
  color: var(--muted);
  font-size: 12px;
  letter-spacing:0.25px;
}
.topbar__title .headline{
  font-weight:800;
  font-size: 18px;
  letter-spacing:0.2px;
  color: var(--accent);
}
.topbar__spacer{ flex:1; }

.topbar__user{
  display:flex;
  gap:10px;
  align-items:center;
  padding:8px 10px;
  border:1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
}
.topbar__avatar{
  width:36px; height:36px;
  border-radius: 14px;
  display:grid;
  place-items:center;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  font-weight:800;
}
.topbar__userName{ font-weight:650; font-size:13px; }
.topbar__userRole{ color:var(--muted); font-size:12px; margin-top:2px; }
.topbar__userMeta{ line-height:1.1; }

.content{
  padding:22px;
  width:100%;
}

.footer{
  padding:14px 22px;
  border-top:1px solid rgba(255,255,255,0.08);
  color:var(--muted);
  display:flex;
  justify-content:space-between;
  gap:12px;
  font-size:12px;
}

/* Cards & layout */
.grid{
  display:grid;
  gap:16px;
}
.grid--4{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--3{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2{ grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card{
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
  border:1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding:16px 16px;
  position:relative;
  overflow:hidden;
}
.card::before{
  content:"";
  position:absolute;
  inset:-2px -2px auto auto;
  width:160px;
  height:160px;
  background: radial-gradient(circle at 50% 50%, rgba(243,129,11,0.18), transparent 60%);
  transform: translate(35px,-35px);
  pointer-events:none;
}
.card__title{
  margin:0;
  font-size:13px;
  color:var(--muted);
  font-weight:650;
}
.card__metric{
  margin-top:10px;
  font-size:28px;
  font-weight:850;
  color: var(--accent);
  letter-spacing:0.3px;
}
.card__meta{
  margin-top:10px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  color:var(--muted);
  font-size:12px;
}
.card__divider{
  height:1px;
  background: rgba(255,255,255,0.08);
  margin:14px 0;
}

/* Buttons */
.btn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  border-radius: 14px;
  padding:10px 14px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-weight:700;
  cursor:pointer;
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
}
.btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,0.06); }
.btn--accent{
  background: rgba(243,129,11,0.15);
  border-color: rgba(243,129,11,0.35);
  color: var(--text);
}
.btn--accent:hover{ background: rgba(243,129,11,0.20); }
.btn--danger{
  background: rgba(255,77,77,0.14);
  border-color: rgba(255,77,77,0.30);
}
.btn--sm{ padding:8px 12px; border-radius: 12px; font-size:13px; }
.btn__icon svg{ width:18px; height:18px; fill: currentColor; }

.iconbtn{
  display:inline-grid;
  place-items:center;
  width:42px; height:42px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor:pointer;
}
.iconbtn svg{ width:22px; height:22px; fill: currentColor; }

.badge{
  display:inline-flex;
  align-items:center;
  border-radius: 999px;
  padding:5px 10px;
  font-size:11px;
  font-weight:800;
  letter-spacing:0.2px;
  border:1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
}
.badge--role{ border-color: rgba(243,129,11,0.30); background: rgba(243,129,11,0.12); }
.badge--team{ border-color: rgba(255,255,255,0.14); }
.badge--status{ font-weight:800; }
.badge--success{ border-color: rgba(25,195,125,0.40); background: rgba(25,195,125,0.12); }
.badge--warn{ border-color: rgba(242,201,76,0.50); background: rgba(242,201,76,0.12); }
.badge--danger{ border-color: rgba(255,77,77,0.40); background: rgba(255,77,77,0.12); }
.badge--muted{ border-color: rgba(255,255,255,0.10); background: rgba(255,255,255,0.03); color: var(--muted); }

hr.sep{
  border:0; height:1px;
  background: rgba(255,255,255,0.08);
  margin:18px 0;
}

/* Tables */
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 10px;
}
.table th{
  text-align:left;
  font-size:12px;
  color:var(--muted);
  font-weight:800;
  letter-spacing:0.2px;
  padding:0 10px;
}
.table td{
  padding:12px 10px;
  background: rgba(255,255,255,0.04);
  border-top:1px solid rgba(255,255,255,0.09);
  border-bottom:1px solid rgba(255,255,255,0.09);
}
.table tr td:first-child{
  border-left:1px solid rgba(255,255,255,0.09);
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
}
.table tr td:last-child{
  border-right:1px solid rgba(255,255,255,0.09);
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
}
.table a.link{ color: var(--accent); font-weight:750; }

/* Forms */
.form{
  display:grid;
  gap:14px;
}
.form__row{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:14px;
}
.form__field{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.label{
  font-size:12px;
  color:var(--muted);
  font-weight:750;
}
.input, .select, .textarea{
  width:100%;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.14);
  color: var(--text);
  padding:10px 12px;
  outline:none;
}
.textarea{ min-height: 110px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus{
  border-color: rgba(243,129,11,0.35);
  box-shadow: 0 0 0 4px rgba(243,129,11,0.10);
}
.help{
  color:var(--muted-2);
  font-size:12px;
  line-height:1.3;
}
.form__actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* Flash */
.flash{
  padding:12px 14px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  margin-bottom:16px;
}
.flash__msg{ font-weight:650; }
.flash-success{ border-color: rgba(25,195,125,0.35); background: rgba(25,195,125,0.10); }
.flash-danger{ border-color: rgba(255,77,77,0.35); background: rgba(255,77,77,0.10); }
.flash-warn{ border-color: rgba(242,201,76,0.45); background: rgba(242,201,76,0.10); }

/* Small components */
.pill{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:8px 10px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-weight:750;
  font-size:12px;
}
.kpi{
  display:flex; align-items:center; gap:10px;
  padding:12px 14px;
  border-radius: 16px;
  border:1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
}
.kpi__dot{
  width:10px; height:10px;
  border-radius:999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(243,129,11,0.10);
}
.progress{
  width:100%;
  height:10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.10);
  overflow:hidden;
}
.progress__bar{
  height:100%;
  width:0%;
  background: linear-gradient(90deg, rgba(243,129,11,0.85), rgba(243,129,11,0.55));
}
.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace; }

/* Responsive */
@media (max-width: 1100px){
  .grid--4{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px){
  .sidebar{
    position:fixed;
    left:0; top:0; bottom:0;
    transform: translateX(-105%);
    transition: transform .18s ease;
    z-index:50;
  }
  .sidebar.sidebar--open{ transform: translateX(0); }
  .topbar__menu{ display:inline-grid; }
  .content{ padding:18px; }
  .form__row{ grid-template-columns: 1fr; }
}
@media (max-width: 560px){
  .grid--2, .grid--3, .grid--4{ grid-template-columns: 1fr; }
  .topbar{ padding:14px 14px; }
  .content{ padding:14px; }
}

/* Auth page (used by login.php) */
.auth-wrap{
  min-height: 100vh;
  display:grid;
  place-items:center;
  padding:24px;
  background: radial-gradient(900px 600px at 12% 10%, rgba(243,129,11,0.14), transparent 55%),
              radial-gradient(800px 500px at 90% 12%, rgba(255,255,255,0.07), transparent 60%),
              var(--bg);
}
.auth-card{
  width: min(980px, 100%);
  display:grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap:0;
  border-radius: 22px;
  overflow:hidden;
  box-shadow: var(--shadow);
  border:1px solid rgba(255,255,255,0.10);
}
.auth-hero{
  padding:34px 34px;
  background: linear-gradient(135deg, rgba(243,129,11,0.16), rgba(255,255,255,0.04));
}
.auth-hero h1{
  margin:0;
  color: var(--accent);
  font-size: 28px;
  letter-spacing:0.3px;
}
.auth-hero p{
  margin:12px 0 0 0;
  color: var(--text);
  line-height:1.5;
  max-width: 46ch;
}
.auth-hero .auth-bullets{
  margin-top:18px;
  display:grid;
  gap:10px;
}
.auth-hero .auth-bullets .kpi{ background: rgba(13,34,55,0.25); }

.auth-form{
  padding:30px 28px;
  background: rgba(0,0,0,0.20);
}
.auth-form h2{
  margin:0;
  font-size: 18px;
  color: var(--text);
}
.auth-form .sub{
  margin-top:6px;
  color: var(--muted);
  font-size: 12px;
}
.auth-form .form{ margin-top:14px; }
.auth-form .btn{ width:100%; justify-content:center; padding:12px 14px; }

/* Modal Styles */
.modal{
  position:fixed;
  top:0;
  left:0;
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
}

.modal__overlay{
  position:absolute;
  top:0;
  left:0;
  width:100%;
  height:100%;
  background:rgba(13,34,55,0.85);
  backdrop-filter:blur(4px);
  cursor:pointer;
}

.modal__content{
  position:relative;
  background:linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border:1px solid var(--stroke);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow);
  padding:28px;
  max-width:500px;
  width:90%;
  max-height:90vh;
  overflow-y:auto;
  z-index:10000;
}

.modal__header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  margin-bottom:20px;
}

.modal__title{
  margin:0;
  font-size:22px;
  font-weight:700;
  color:var(--text);
}

.modal__close{
  background:none;
  border:none;
  color:var(--muted);
  font-size:32px;
  cursor:pointer;
  padding:0;
  width:32px;
  height:32px;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:color 0.2s;
}

.modal__close:hover{
  color:var(--text);
}

.modal__actions{
  display:flex;
  gap:12px;
  justify-content:flex-end;
  margin-top:24px;
  padding-top:20px;
  border-top:1px solid var(--stroke-soft);
}

.modal__actions .btn{
  flex:0 0 auto;
  min-width:100px;
}

@media (max-width: 900px){
  .auth-card{ grid-template-columns: 1fr; }
  
  .modal__content{
    padding:20px;
    width:95%;
    max-height:85vh;
  }
  
  .modal__title{
    font-size:18px;
  }
}
