/* AllWorks Dashboard - Dark Theme */
:root {
  --bg: #0a0a0f;
  --bg2: #111118;
  --bg3: #161622;
  --border: #1e1e2e;
  --text: #e4e4ec;
  --muted: #8888a0;
  --accent: #6c5ce7;
  --ahover: #7d6ff0;
  --green: #00d68f;
  --red: #ff6b6b;
  --yellow: #ffd93d;
  --rs: 8px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
}

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

.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: calc(var(--rs) * 1.5);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}

.login-card h1 {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.login-card .subtitle {
  color: var(--muted);
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--rs);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--rs);
  border: none;
  font-size: 0.9rem;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  width: 100%;
  justify-content: center;
}

.btn-primary:hover { background: var(--ahover); }

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.btn-green { background: var(--green); color: #000; }
.btn-green:hover { filter: brightness(1.2); }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { filter: brightness(1.2); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-yellow { background: var(--yellow); color: #000; }
.btn-yellow:hover { filter: brightness(1.1); }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Sidebar */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-logo {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text);
}

.sidebar-logo span { color: var(--accent); }

.sidebar-user {
  padding: 0.75rem;
  background: var(--bg3);
  border-radius: var(--rs);
  margin-bottom: 1.5rem;
}

.sidebar-user .name {
  font-weight: 600;
  font-size: 0.9rem;
}

.sidebar-user .email {
  font-size: 0.75rem;
  color: var(--muted);
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-nav-item {
  padding: 0.6rem 0.75rem;
  border-radius: var(--rs);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
  transition: all 0.15s;
}
.sidebar-nav-item:hover { background: var(--bg3); color: var(--text); }
.sidebar-nav-item.active { background: var(--accent); color: #fff; }

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  max-height: 100vh;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* Cards */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--rs);
  padding: 1.75rem;
  transition: border-color 0.2s, transform 0.15s;
}

.card:hover { border-color: var(--accent); }

/* Server Cards Grid */
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1rem;
}

.server-card {
  cursor: pointer;
}
.server-card:hover { border-color: var(--accent); transform: translateY(-1px); }

.server-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.server-card-name {
  font-weight: 600;
  font-size: 1.15rem;
}

.server-card-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-dot.online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.offline { background: var(--red); }
.status-dot.pending { background: var(--yellow); }

.server-card-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.server-card-specs span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.server-card-metrics {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.metric-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
}

.metric-label {
  min-width: 40px;
  color: var(--muted);
}

.metric-bar-wrap{flex:1;height:10px;
  background: var(--bg3);
  border-radius: 3px;
  overflow: hidden;
}

.metric-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.metric-bar.cpu { background: var(--accent); }
.metric-bar.ram { background: var(--green); }
.metric-bar.disk { background: var(--yellow); }

.metric-val {
  min-width: 45px;
  text-align: right;
  color: var(--muted);
  font-size: 0.75rem;
}

.server-card-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Detail Page */
.detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.back-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: var(--rs);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}
.back-btn:hover { border-color: var(--accent); color: var(--accent); }

.lang-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.35rem 0.7rem;
  border-radius: var(--rs);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.15s;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* Detail sidebar */
.detail-sidebar {
  width: 180px;
  min-width: 180px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0;
  height: 100vh;
  position: sticky;
  top: 0;
}

.tab-item {
  padding: 0.7rem 1.25rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--muted);
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.tab-item:hover { background: var(--bg3); color: var(--text); }
.tab-item.active { background: var(--bg3); color: var(--accent); border-left-color: var(--accent); }

.detail-main {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
  max-height: 100vh;
}

/* Status Bar */
.status-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg3);
  border-radius: var(--rs);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.status-bar .label {
  font-weight: 600;
  font-size: 0.9rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  background: var(--bg2);
}

.live-counter {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--muted);
}

/* Resource Grid */
.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.resource-card{background:var(--bg2);border:1px solid var(--border);border-radius:var(--rs);padding:1.75rem}

.resource-card .res-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.resource-card .res-value {
  font-size:2rem;font-weight:700;margin-bottom:1rem;
}

.resource-card .res-bar-wrap {
  height:8px;background:var(--bg3);border-radius:4px;overflow:hidden;margin-bottom:0.5rem;
}

.resource-card .res-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.resource-card .res-detail {
  font-size: 0.8rem;
  color: var(--muted);
}

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

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

thead th {
  text-align: left;
  padding: 0.65rem 0.75rem;
  background: var(--bg3);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

tbody tr:hover { background: var(--bg3); }

.info-table {
  width: 100%;
  max-width: 600px;
  margin-bottom: 1.5rem;
}

.info-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.info-table td:first-child {
  color: var(--muted);
  width: 140px;
}

/* Tabs Content Area */
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* Section Title */
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}

/* OS Cards */
.os-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.os-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--rs);
  padding: 1rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.os-card:hover { border-color: var(--accent); }
.os-card .os-name { font-weight: 600; font-size: 0.9rem; }
.os-card .os-version { color: var(--muted); font-size: 0.8rem; margin-top: 0.25rem; }

/* Traffic Chart */
.traffic-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.traffic-stat {
  background: var(--bg3);
  padding: 1rem;
  border-radius: var(--rs);
  text-align: center;
}

.traffic-stat .val {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.traffic-stat .lbl {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.chart-wrap {
  height: 200px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding: 0.5rem 0;
}

.chart-bar {
  flex: 1;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  min-height: 1px;
  position: relative;
  transition: height 0.3s;
}

.chart-bar:hover { opacity: 0.8; }

.chart-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* Console Info */
.console-info {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--rs);
  padding: 1rem;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
}

.console-info .key { color: var(--muted); }
.console-info .val { color: var(--green); }

/* Action Bar */
.action-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: calc(var(--rs) * 1.5);
  padding: 1.5rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--rs);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  animation: slideIn 0.3s ease;
  max-width: 380px;
}

.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--accent); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Inline Form Row */
.inline-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.inline-form input {
  padding: 0.5rem 0.75rem;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--rs);
  color: var(--text);
  font-size: 0.85rem;
  font-family: var(--font);
}

.inline-form input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Password Form (change password view) */
.pw-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: calc(var(--rs) * 1.5);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  margin: auto;
}

.pw-card h1 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.pw-card .subtitle { color: var(--muted); margin-bottom: 1.5rem; font-size: 0.9rem; }

/* Copy button */
.copy-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.15s;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Pre block for scripts */
pre.script-block {
  background: #000;
  color: var(--green);
  padding: 1rem;
  border-radius: var(--rs);
  font-family: 'Courier New', monospace;
  font-size: 0.78rem;
  overflow-x: auto;
  max-height: 300px;
  overflow-y: auto;
  line-height: 1.4;
  border: 1px solid var(--border);
}

/* Loading / Empty states */
.loading {
  color: var(--muted);
  text-align: center;
  padding: 2rem;
  font-size: 0.9rem;
}

.empty-state {
  color: var(--muted);
  text-align: center;
  padding: 2rem;
}

/* Hidden */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .detail-sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    flex-direction: row;
    overflow-x: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .tab-item { border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; }
  .tab-item.active { border-left: none; border-bottom-color: var(--accent); }
  .server-grid { grid-template-columns: 1fr; }
  .resource-grid { grid-template-columns: 1fr; }
  body { flex-direction: column; }
  .detail-header { flex-wrap: wrap; }
}

/* Detail Page */
.detail-statusbar{display:flex;align-items:center;gap:0.75rem;padding:0.75rem 1rem;background:var(--bg2);border:1px solid var(--border);border-radius:var(--rs);margin-bottom:1.5rem;flex-wrap:wrap}
.status-badge{font-size:0.9rem;padding:0.25rem 0.75rem;border-radius:20px;font-weight:600;text-transform:uppercase}
.status-active{background:rgba(0,214,143,0.15);color:var(--green);border:1px solid var(--green)}
.status-stopped{background:rgba(255,71,87,0.15);color:var(--red);border:1px solid var(--red)}
.status-pending{background:rgba(253,203,110,0.15);color:var(--yellow);border:1px solid var(--yellow)}
.detail-uptime,.detail-counter{font-size:0.9rem;color:var(--muted)}
.detail-actions{margin-left:auto;display:flex;gap:0.35rem}
.detail-info-table{background:var(--bg2);border:1px solid var(--border);border-radius:var(--rs);padding:0.5rem;margin-top:1rem}
.info-row{display:flex;justify-content:space-between;padding:0.5rem 0.75rem;border-bottom:1px solid var(--border)}
.info-row:last-child{border-bottom:none}
.info-label{color:var(--muted);font-size:0.85rem}
.info-value{color:var(--text);font-size:0.85rem}
.stats-cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:1rem;margin-bottom:1rem}
.stat-card{background:var(--bg2);border:1px solid var(--border);border-radius:var(--rs);padding:1rem;text-align:center}
.stat-label{font-size:0.78rem;color:var(--muted);margin-bottom:0.25rem}
.stat-value{font-size:1.1rem;font-weight:700}
.stat-sub{font-size:0.75rem;color:var(--muted);margin-top:0.25rem}
.chart-bars{display:flex;align-items:flex-end;gap:3px;height:140px;padding:0.5rem 0}
.chart-bar{flex:1;display:flex;flex-direction:column;justify-content:flex-end;min-width:8px}
.chart-bar-fill{background:linear-gradient(to top,var(--accent),var(--green));border-radius:2px 2px 0 0;min-height:2px;transition:height 0.3s}
.chart-bar-label{font-size:0.6rem;color:var(--muted);text-align:center;margin-top:2px;overflow:hidden;text-overflow:ellipsis}
.form-group{margin-bottom:1rem}
.form-group label{display:block;font-size:0.85rem;color:var(--muted);margin-bottom:0.35rem}
.code-block{background:#000;color:var(--green);padding:0.75rem 1rem;border-radius:var(--rs);font-family:monospace;font-size:0.8rem;overflow-x:auto;word-break:break-all}
.alert{padding:0.75rem 1rem;border-radius:var(--rs);font-size:0.85rem}
.alert-error{background:rgba(255,71,87,0.1);color:var(--red);border:1px solid var(--red)}
.alert-warning{background:rgba(253,203,110,0.1);color:var(--yellow);border:1px solid var(--yellow)}
.mono{font-family:monospace;font-size:0.82rem}
.selectable{user-select:all;cursor:text}

.tab-bar{display:flex;gap:2px;overflow-x:auto;padding:0;margin-bottom:1rem;border-bottom:1px solid var(--border);-ms-overflow-style:none;scrollbar-width:none}.tab-bar::-webkit-scrollbar{display:none}
.detail-tab{flex-shrink:0;padding:0.55rem 1rem;font-size:0.82rem;font-family:var(--font);background:transparent;color:var(--muted);border:1px solid transparent;border-bottom:2px solid transparent;border-radius:var(--rs) var(--rs) 0 0;cursor:pointer;transition:all 0.15s;white-space:nowrap;margin-bottom:-1px}
.detail-tab:hover{color:var(--text);background:var(--bg3)}
.detail-tab.active{color:var(--accent);border-bottom-color:var(--accent);background:transparent;font-weight:600}
.detail-header-bar{display:flex;align-items:center;gap:0.75rem;padding:0.75rem 0;margin-bottom:0.5rem;flex-wrap:wrap}
.detail-section{margin-bottom:1.5rem}
.detail-section h3{font-size:1rem;font-weight:600;margin-bottom:0.75rem;color:var(--text)}
.resources-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:0.75rem;margin-bottom:1rem}
.os-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:0.5rem}
.os-card{background:var(--bg2);border:1px solid var(--border);border-radius:var(--rs);padding:0.75rem;cursor:pointer;text-align:center;color:var(--text);font-size:0.85rem;transition:all 0.15s;font-family:var(--font)}
.os-card:hover{border-color:var(--accent);background:var(--bg3)}
.os-name{font-weight:600;font-size:0.85rem}
.table-wrap{overflow-x:auto;margin-bottom:1rem}


/* BIGGER CARDS OVERRIDE */
.card{padding:1.75rem!important}
.server-card-name{font-size:1.2rem!important}
.server-card-specs span{font-size:0.9rem!important}
.server-card-specs{gap:0.65rem!important;margin-bottom:1rem!important}
.resource-card{padding:1.75rem!important}
.resource-card .res-value{font-size:2rem!important}
.resource-card .res-label{font-size:0.9rem!important}
.resource-card .res-bar-wrap{height:8px!important}
.metric-bar-wrap{height:8px!important}
.metric-val{font-size:0.82rem!important}
.status-dot{width:10px!important;height:10px!important}
.server-card-status{font-size:0.88rem!important}
