/* =============================================
   FTP Manager — DirectAdmin
   Style: Industrial / Utilitarian Dark
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&family=Syne:wght@400;600;800&display=swap');

:root {
  --bg:        #0a0c0f;
  --bg2:       #111318;
  --bg3:       #181c23;
  --border:    #232830;
  --border2:   #2e3540;
  --accent:    #00e5ff;
  --accent2:   #ff6b35;
  --green:     #00ff88;
  --yellow:    #ffd60a;
  --red:       #ff3b5c;
  --text:      #e2e8f0;
  --text2:     #8892a4;
  --text3:     #4a5568;
  --mono:      'JetBrains Mono', monospace;
  --sans:      'Syne', sans-serif;
  --radius:    6px;
  --shadow:    0 4px 24px rgba(0,0,0,.5);
}

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

html { font-size: 15px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  min-height: 100vh;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Layout ---- */
.layout { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
  width: 240px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo .logo-text {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent);
  letter-spacing: -.01em;
  line-height: 1.2;
}

.sidebar-logo .logo-sub {
  font-size: .7rem;
  color: var(--text3);
  margin-top: 2px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.nav-section {
  padding: 8px 20px 4px;
  font-size: .65rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: .12em;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--text2);
  font-size: .82rem;
  border-left: 2px solid transparent;
  transition: all .15s;
}

.nav-item:hover { color: var(--text); background: var(--bg3); text-decoration: none; }
.nav-item.active { color: var(--accent); border-left-color: var(--accent); background: rgba(0,229,255,.05); }

.nav-item .icon { width: 16px; opacity: .7; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  font-size: .75rem;
  color: var(--text3);
}

.sidebar-footer .admin-name { color: var(--text2); font-weight: 500; }

/* ---- Main Content ---- */
.main {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
}

.topbar-right { display: flex; align-items: center; gap: 12px; }

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

/* ---- Cards ---- */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: -.01em;
}

/* ---- Stats Row ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.stat-card.accent::before  { background: var(--accent); }
.stat-card.green::before   { background: var(--green); }
.stat-card.yellow::before  { background: var(--yellow); }
.stat-card.red::before     { background: var(--red); }

.stat-label { font-size: .72rem; color: var(--text3); text-transform: uppercase; letter-spacing: .1em; }
.stat-value { font-family: var(--sans); font-size: 2rem; font-weight: 800; margin: 6px 0 0; line-height: 1; }
.stat-card.accent .stat-value  { color: var(--accent); }
.stat-card.green .stat-value   { color: var(--green); }
.stat-card.yellow .stat-value  { color: var(--yellow); }
.stat-card.red .stat-value     { color: var(--red); }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: .82rem; }

thead tr { border-bottom: 1px solid var(--border2); }

th {
  text-align: left;
  padding: 10px 14px;
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text3);
  font-weight: 500;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:hover { background: rgba(255,255,255,.02); }
tbody tr:last-child td { border-bottom: none; }

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .04em;
}

.badge-green  { background: rgba(0,255,136,.12); color: var(--green); }
.badge-red    { background: rgba(255,59,92,.12);  color: var(--red); }
.badge-yellow { background: rgba(255,214,10,.12); color: var(--yellow); }
.badge-blue   { background: rgba(0,229,255,.12);  color: var(--accent); }
.badge-gray   { background: rgba(255,255,255,.06); color: var(--text2); }

.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}
.btn-primary:hover { background: #33ecff; color: #000; text-decoration: none; }

.btn-danger {
  background: rgba(255,59,92,.15);
  color: var(--red);
  border: 1px solid rgba(255,59,92,.3);
}
.btn-danger:hover { background: rgba(255,59,92,.25); text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: var(--text2);
  border: 1px solid var(--border2);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text3); text-decoration: none; }

.btn-warning {
  background: rgba(255,214,10,.12);
  color: var(--yellow);
  border: 1px solid rgba(255,214,10,.3);
}
.btn-warning:hover { background: rgba(255,214,10,.22); text-decoration: none; }

.btn-sm { padding: 5px 10px; font-size: .75rem; }

/* ---- Forms ---- */
.form-group { margin-bottom: 18px; }

label {
  display: block;
  font-size: .75rem;
  color: var(--text2);
  margin-bottom: 6px;
  letter-spacing: .04em;
}

input[type=text], input[type=password], input[type=email],
select, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: .85rem;
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,229,255,.1);
}

select option { background: var(--bg2); }

.input-group {
  display: flex;
  align-items: center;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color .15s;
}
.input-group:focus-within { border-color: var(--accent); }
.input-group .prefix, .input-group .suffix {
  padding: 9px 12px;
  background: var(--bg3);
  color: var(--text3);
  font-size: .8rem;
  white-space: nowrap;
  border: none;
}
.input-group input {
  border: none;
  border-radius: 0;
  flex: 1;
}
.input-group input:focus { box-shadow: none; }

.form-hint { font-size: .72rem; color: var(--text3); margin-top: 4px; }
.form-error { font-size: .75rem; color: var(--red); margin-top: 4px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ---- Protection Level indicator ---- */
.protection-preview {
  background: var(--bg);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 16px;
  font-size: .78rem;
}

.protection-preview .tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}

.protection-preview .tree-item .tree-path {
  color: var(--text2);
  flex: 1;
}

.protection-preview .tree-item .tree-indent {
  color: var(--text3);
  margin-left: 12px;
}

.prot-hidden   { color: var(--red); font-size: .7rem; }
.prot-readonly { color: var(--yellow); font-size: .7rem; }
.prot-allowed  { color: var(--green); font-size: .7rem; }

/* ---- Alerts ---- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .82rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-success { background: rgba(0,255,136,.08); border: 1px solid rgba(0,255,136,.2); color: var(--green); }
.alert-error   { background: rgba(255,59,92,.08);  border: 1px solid rgba(255,59,92,.2);  color: var(--red); }
.alert-warning { background: rgba(255,214,10,.08); border: 1px solid rgba(255,214,10,.2); color: var(--yellow); }
.alert-info    { background: rgba(0,229,255,.08);  border: 1px solid rgba(0,229,255,.2);  color: var(--accent); }

/* ---- Modal ---- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 10px;
  width: 480px;
  max-width: 90vw;
  box-shadow: var(--shadow);
  animation: modalIn .2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-family: var(--sans); font-weight: 600; }
.modal-body  { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

.modal-close { background: none; border: none; color: var(--text3); cursor: pointer; font-size: 1.2rem; }
.modal-close:hover { color: var(--text); }

/* ---- Password strength ---- */
.pw-strength { margin-top: 6px; }
.pw-bar { height: 3px; background: var(--border2); border-radius: 2px; overflow: hidden; }
.pw-fill { height: 100%; border-radius: 2px; transition: width .3s, background .3s; }
.pw-label { font-size: .7rem; margin-top: 4px; }

/* ---- Log entries ---- */
.log-entry {
  display: flex;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: .78rem;
}
.log-entry:last-child { border-bottom: none; }
.log-time { color: var(--text3); min-width: 130px; }
.log-action { font-weight: 500; min-width: 90px; }
.log-action.create { color: var(--green); }
.log-action.delete { color: var(--red); }
.log-action.edit   { color: var(--yellow); }
.log-action.login  { color: var(--accent); }
.log-detail { color: var(--text2); flex: 1; }

/* ---- Protected path row ---- */
.prot-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.prot-row:last-child { border-bottom: none; }
.prot-pattern { font-family: var(--mono); color: var(--text); flex: 1; }
.prot-desc { color: var(--text3); font-size: .75rem; flex: 1.5; }

/* ---- Login Page ---- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

.login-box {
  width: 400px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 40px;
  box-shadow: var(--shadow);
}

.login-logo {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 4px;
}

.login-sub {
  font-size: .75rem;
  color: var(--text3);
  margin-bottom: 32px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* ---- Scan line effect ---- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,.03) 2px,
    rgba(0,0,0,.03) 4px
  );
  pointer-events: none;
  z-index: 9999;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .content { padding: 16px; }
  .stats-row { grid-template-columns: 1fr; }
}

/* ---- Utility ---- */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 8px !important; }
.mt-2 { margin-top: 16px !important; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-mono { font-family: var(--mono); }
.text-sm { font-size: .78rem; }
.text-muted { color: var(--text3); }
.text-accent { color: var(--accent); }
.text-red { color: var(--red); }
.text-green { color: var(--green); }
.w-full { width: 100%; }
