:root{
  --bg:#0b0b0f;
  --panel:#12121a;
  --panel2:#171725;
  --text:#f2f2f2;
  --muted:#b6b6c6;
  --orange:#ff7a18;
  --orange2:#ff9a3d;
  --danger:#ff3b3b;
  --warn:#ffb020;
  --shadow: 0 20px 60px rgba(0,0,0,.45);
}

*{ box-sizing:border-box; }
body{
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", Arial;
  background: radial-gradient(1200px 600px at 30% 10%, rgba(255,122,24,.14), transparent 55%),
              radial-gradient(900px 500px at 80% 20%, rgba(255,154,61,.10), transparent 60%),
              var(--bg);
  color:var(--text);
}

a{ color:inherit; text-decoration:none; }

.app{ display:flex; min-height:100vh; }
.sidebar{
  width:280px;
  background: linear-gradient(180deg, rgba(255,122,24,.10), transparent 40%), var(--panel);
  border-left: 1px solid rgba(255,255,255,.06);
  padding:18px;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.logo{
  display:flex; align-items:center; gap:10px;
  font-weight:800; letter-spacing:.8px;
  padding:10px 12px;
  border-radius:12px;
  background: rgba(255,122,24,.10);
}
.logo span{ color:var(--orange2); }

.nav{ display:flex; flex-direction:column; gap:8px; }
.nav-item, .nav-sub, .group-title{
  padding:10px 12px;
  border-radius:12px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.06);
  transition: transform .15s ease, background .15s ease, border .15s ease;
}
.nav-item:hover, .nav-sub:hover{
  transform: translateY(-2px);
  border-color: rgba(255,122,24,.35);
  background: rgba(255,122,24,.08);
}
.nav-group{ display:flex; flex-direction:column; gap:8px; }
.nav-sub{ margin-right:14px; opacity:.92; }
.group-title{ background: rgba(0,0,0,.15); }

.logout{ margin-top:auto; }
.btn{
  border:0;
  padding:10px 14px;
  border-radius:12px;
  cursor:pointer;
  font-weight:700;
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover{ transform: translateY(-1px); filter: brightness(1.02); }
.btn.primary{ background: linear-gradient(90deg, var(--orange), var(--orange2)); color:#111; }
.btn.ghost{ background: rgba(255,255,255,.06); color: var(--text); border:1px solid rgba(255,255,255,.10); }
.btn.warn{ background: rgba(255,176,32,.16); color: var(--text); border:1px solid rgba(255,176,32,.35); }
.btn.danger{ background: rgba(255,59,59,.14); color: var(--text); border:1px solid rgba(255,59,59,.35); }

.main{ flex:1; display:flex; flex-direction:column; }
.topbar{
  position:sticky; top:0;
  background: rgba(18,18,26,.75);
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(255,255,255,.06);
  padding:16px 22px;
  display:flex; align-items:center; justify-content:space-between;
}
.company{
  font-weight:800;
  display:flex; align-items:center; gap:10px;
  margin: 0 auto;
}
.dot{
  width:10px; height:10px; border-radius:999px;
  background: var(--orange);
  box-shadow: 0 0 0 6px rgba(255,122,24,.18);
}

.content{ padding:22px; }
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.05), transparent 55%), var(--panel2);
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  box-shadow: var(--shadow);
  padding:18px;
  animation: pop .35s ease both;
}
@keyframes pop { from { transform: translateY(8px); opacity:.0 } to { transform: translateY(0); opacity:1 } }

.grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap:14px;
}
.stat{ cursor:pointer; }
.stat .icon{ font-size:26px; }
.stat .label{ color:var(--muted); margin-top:6px; }
.stat .value{ font-size:34px; font-weight:900; color: var(--orange2); margin-top:10px; }

.form-card h2{ margin:0 0 14px; }
.row{ display:flex; gap:12px; flex-wrap:wrap; }
.field{ flex:1; min-width:240px; display:flex; flex-direction:column; gap:8px; margin-bottom:12px; }
label{ color:var(--muted); font-weight:700; }
input, select{
  background: rgba(0,0,0,.20);
  border:1px solid rgba(255,255,255,.10);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  outline:none;
}
input:focus, select:focus{ border-color: rgba(255,122,24,.55); box-shadow: 0 0 0 6px rgba(255,122,24,.10); }
.hint{ color:var(--muted); font-size:13px; }
.alert{
  padding:10px 12px;
  border-radius:12px;
  background: rgba(255,59,59,.12);
  border:1px solid rgba(255,59,59,.3);
  margin-bottom:12px;
}

.table{ width:100%; border-collapse:separate; border-spacing:0 10px; }
.table th{ text-align:right; color:var(--muted); font-weight:800; font-size:13px; padding:0 10px 8px; }
.table td{
  padding:12px 10px;
  background: rgba(255,255,255,.03);
  border-top:1px solid rgba(255,255,255,.06);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.table tr td:first-child{
  border-right:1px solid rgba(255,255,255,.06);
  border-top-right-radius:14px;
  border-bottom-right-radius:14px;
}
.table tr td:last-child{
  border-left:1px solid rgba(255,255,255,.06);
  border-top-left-radius:14px;
  border-bottom-left-radius:14px;
}
.row-click{ cursor:pointer; transition: transform .12s ease; }
.row-click:hover{ transform: translateY(-2px); }

.mono{ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
  #modalBackdrop{ z-index:1000; }
#earlyModalBackdrop{ z-index:1001; }
.modal-backdrop{
  position:fixed; inset:0;
  background: rgba(0,0,0,.55);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  opacity:0;
  transition: opacity .12s ease;
}
.modal-backdrop.show{ opacity:1; }
.modal{
  width:min(680px, 98vw);
  background: var(--panel2);
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  box-shadow: var(--shadow);
  transform: translateY(10px);
  transition: transform .12s ease;
}
.modal-backdrop.show .modal{ transform: translateY(0); }
.modal-header{
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 16px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.modal-title{ font-weight:900; }
.icon-btn{
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  color:var(--text);
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
}
.modal-body{ padding:16px; }
.modal-actions{
  display:flex;
  gap:10px;
  padding:14px 16px;
  border-top:1px solid rgba(255,255,255,.08);
  justify-content:flex-start;
  flex-wrap:wrap;
}

.kv{ display:grid; gap:12px; }
.kv > div{
  display:flex; justify-content:space-between; align-items:center;
  padding:10px 12px;
  border-radius:14px;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.06);
}
.kv span{ color:var(--muted); font-weight:800; }
.auth-wrap{ display:grid; place-items:center; min-height:100vh; padding:18px; }
.login-card{
  width:min(420px, 96vw);
  padding:20px;
  border-radius:18px;
  background: linear-gradient(180deg, rgba(255,122,24,.10), transparent 45%), var(--panel2);
  border:1px solid rgba(255,255,255,.10);
  box-shadow: var(--shadow);
  animation: pop .35s ease both;
}
.brand{ font-weight:900; color:var(--orange2); margin-bottom:12px; display:flex; gap:10px; align-items:center; }
h1{ margin:0 0 14px; }
.brand-logo{
  height: 34px;
  width: auto;
  display:block;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.45));
}

.login-card form { display:flex; flex-direction:column; gap:10px; }
.login-card label { margin-top: 2px; }
.login-card input {
  width: 100%;
  height: 46px;
  font-size: 15px;
  border-radius: 14px;
}
.login-card button { width: 100%; height: 46px; font-size: 15px; }

.modal-backdrop { pointer-events: none; }
.modal-backdrop.show { pointer-events: auto; }


.dropzone{
  border: 2px dashed rgba(255,122,24,.55);
  border-radius: 18px;
  padding: 26px 18px;
  min-height: 120px;

  background: rgba(255,122,24,.06);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  font-weight: 900;
  color: var(--text);
  cursor: pointer;
  user-select: none;

  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.dropzone:hover{
  transform: translateY(-1px);
  border-color: rgba(255,154,61,.75);
  background: rgba(255,122,24,.09);
}

.dropzone.drag{
  border-color: rgba(255,154,61,.95);
  background: rgba(255,122,24,.12);
  transform: translateY(-2px);
}


.dz-title{
  font-size: 15px;
  margin: 0;
}


.dz-meta{
  width:100%;
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:center;
}

.dz-badge{
  display:inline-flex;
  gap:8px;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.10);
  color: var(--text);
  font-weight:800;
  font-size:13px;
}

.file-chips{
  width:100%;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  justify-content:center;
}

.file-chip{
  display:flex;
  gap:10px;
  align-items:center;
  max-width:100%;
  padding:8px 10px;
  border-radius:14px;
  background: rgba(0,0,0,.20);
  border:1px solid rgba(255,255,255,.10);
}

.file-chip .name{
  max-width: 360px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-weight:800;
}

.file-chip .x{
  width:28px;
  height:28px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
  color: var(--text);
  cursor:pointer;
}

/* ===== Modal: actions + files ===== */
.modal-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}

@media (max-width: 640px){
  .modal-grid{ grid-template-columns: 1fr; }
}


.modal-actions .btn{
  white-space:nowrap;
}

.inline-form{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:12px;
}

.inline-form .input{
  flex:1;
  min-width: 220px;
}

.files-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:10px;
}

.files-list{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.file-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  padding:12px;
  border-radius:16px;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.06);
}

.file-meta{ display:flex; flex-direction:column; gap:4px; }
.file-name{ font-weight:900; }
.file-sub{ color: var(--muted); font-size: 13px; font-weight: 800; }

.file-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.fw-bold{ font-weight:900; }


.fw-bold{ font-weight:900; }

.table-wrap { overflow:auto; border:1px solid rgba(255,255,255,.08); border-radius:12px; }
.table { width:100%; border-collapse:collapse; min-width:520px; }
.table th, .table td { padding:10px 12px; border-bottom:1px solid rgba(255,255,255,.08); font-size:14px; white-space:nowrap; }
.table th { text-align:right; color:rgba(255,255,255,.75); font-weight:700; background:rgba(255,255,255,.03); }
.table tr:last-child td { border-bottom:none; }

.modal-backdrop{
  align-items: center;
}

.modal{
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header{
  flex: 0 0 auto;
}

.modal-body{
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.modal-actions{
  flex: 0 0 auto;
}