/* =========================================================
   QLOUDDNS EXECUTIVE DESIGN SYSTEM — QLOUD-REGISTAR
   ========================================================= */

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

:root {
  --primary: #F4B400;
  --primary-hover: #E0A500;
  --primary-bg: rgba(244, 180, 0, 0.15);
  --primary-text: #000000;
  
  --sidebar-bg: #ffffff;
  --sidebar-text: #4a5259;
  --sidebar-text-active: #0f1720;
  --sidebar-active-bg: #f2f4f5;
  
  --bg: #ffffff;
  --surface: #ffffff;
  --border: #e4e7eb;
  
  --text-primary: #0f1720;
  --text-secondary: #5c6773;
  --text-muted: #8a94a0;
  
  --green: #0b7a3b;
  --green-bg: #e6f4ea;
  --red: #c0292c;
  --red-bg: #fbeaea;
  --amber: #a15c00;
  --amber-bg: #fdf3e0;
  --blue: #0072b3;
  --blue-bg: #e7f3fb;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;
  
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Consolas, monospace;
  
  --shadow-sm: 0 1px 2px rgba(15,23,32,.06);
  --shadow-md: 0 4px 16px rgba(15,23,32,.08);
  
  --topbar-h: 56px;
  --sidebar-w: 240px;
}

body.dark {
  --sidebar-bg: #111111;
  --bg: #0A0A0A;
  --surface: #161616;
  --border: #2a2a2a;
  
  --text-primary: #f0f0f0;
  --text-secondary: #a0a8b0;
  --text-muted: #6a7480;
  
  --sidebar-text: #a0a8b0;
  --sidebar-text-active: #ffffff;
  --sidebar-active-bg: #1f1f1f;
  
  --primary-bg: rgba(244, 180, 0, 0.2);
  --blue-bg: #1a2a3a;
  --green-bg: #064e3b;
  --red-bg: #7f1d1d;
  --amber-bg: #78350f;
}

/* Reset & Layout */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a { color: #0072b3; text-decoration: none; }
a:hover { text-decoration: underline; }

.app { display: flex; min-height: 100vh; }

/* Topbar Header */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  background: #444444 !important;
  color: #ffffff !important;
  border-top: 8px solid var(--primary);
  border-bottom: 1px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  z-index: 30;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.topbar .domain-name-top,
.topbar .topbar-link {
  color: #ffffff !important;
}

.topbar .topbar-domain {
  border-left-color: rgba(255,255,255,0.3) !important;
}

.topbar .theme-btn {
  background: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-domain {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  height: 32px;
}

.domain-name-top {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.topbar-link:hover { color: var(--text-primary); text-decoration: none; }

.theme-btn {
  height: 30px;
  width: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

/* Sidebar Navigation */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  overflow-y: auto;
  padding: 14px 12px;
  z-index: 20;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--sidebar-text);
  cursor: pointer;
  text-decoration: none !important;
  margin-bottom: 2px;
  transition: all 0.15s ease;
}

.nav-item a {
  color: inherit !important;
  text-decoration: none !important;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
}

.nav-item:hover { background: var(--bg); color: var(--text-primary); }

.nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
  font-weight: 700;
}

.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--text-secondary); }
.nav-item.active svg { color: var(--text-primary); }

.nav-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
  padding: 16px 12px 6px;
}

/* Main Area */
.main {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  flex: 1;
  min-width: 0;
  padding: 32px 36px 48px;
  display: flex;
  flex-direction: column;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 13.5px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Cards & Panel Layout */
.card, .panel {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  padding: 24px !important;
  box-shadow: var(--shadow-sm) !important;
  color: var(--text-primary) !important;
  margin-bottom: 24px !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md) !important;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-sm) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  border: 1px solid var(--border) !important;
  background: var(--surface) !important;
  color: var(--text-primary) !important;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-sm {
  height: 32px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
}

.btn-primary {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: var(--primary-text) !important;
}

.btn-primary:hover {
  background: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
  color: var(--primary-text) !important;
}

/* Form Controls */
.form-control, .form-select, select, input[type=text], input[type=email], input[type=password], input[type=number] {
  background-color: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 8px 12px !important;
  font-size: 13.5px !important;
  color: var(--text-primary) !important;
  transition: border-color 0.15s ease;
}

.form-control:focus, .form-select:focus, select:focus, input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-bg) !important;
  outline: none !important;
}

.form-label {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  margin-bottom: 4px !important;
}

/* Badges */
.badge {
  padding: 5px 10px !important;
  border-radius: var(--radius-full) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
}

.badge.bg-success { background: var(--green-bg) !important; color: var(--green) !important; }
.badge.bg-warning { background: var(--amber-bg) !important; color: var(--amber) !important; }
.badge.bg-danger { background: var(--red-bg) !important; color: var(--red) !important; }
.badge.bg-info { background: var(--blue-bg) !important; color: var(--blue) !important; }
.badge.bg-secondary { background: var(--bg) !important; color: var(--text-secondary) !important; border: 1px solid var(--border) !important; }
.badge.bg-primary { background: var(--primary-bg) !important; color: var(--text-primary) !important; }

/* Tables */
table.datatable, table.table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden !important;
  border: 1px solid var(--border) !important;
  margin: 12px 0 !important;
}

table.datatable thead th, table.table thead th {
  background-color: var(--bg) !important;
  color: var(--text-secondary) !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--border) !important;
}

table.datatable tbody td, table.table tbody td {
  padding: 14px 16px !important;
  border-bottom: 1px solid var(--border) !important;
  vertical-align: middle !important;
  color: var(--text-primary) !important;
  background-color: var(--surface) !important;
}

table.datatable tbody tr:hover td, table.table tbody tr:hover td {
  background-color: var(--bg) !important;
}

/* Responsive */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0 !important; padding: 20px 16px 36px !important; }
}
