/* NETGUC SECURITY TEAM */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0f172a;
  --bg2:       #1e293b;
  --bg3:       #334155;
  --card:      #1e293b;
  --border:    #334155;
  --text:      #f1f5f9;
  --text2:     #94a3b8;
  --text3:     #64748b;
  --primary:   #f97316;
  --primary2:  #ef4444;
  --success:   #10b981;
  --warning:   #f59e0b;
  --danger:    #ef4444;
  --info:      #3b82f6;
  --sidebar-w: 260px;
  --header-h:  64px;
  --radius:    12px;
  --shadow:    0 4px 24px rgba(0,0,0,.3);
}

html { font-size: 16px; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 3px; }

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

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w); 
  height: 100vh;
  background: var(--card);
  border-right: 1px solid var(--border); 
  display: flex; 
  flex-direction: column;
  position: fixed; 
  top: 0; 
  left: 0; 
  z-index: 200; 
  transition: transform .3s;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
  min-height: 0;
}

.sidebar-logo {
  padding: 20px; 
  border-bottom: 1px solid var(--border);
  display: flex; 
  align-items: center; 
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px; 
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo .logo-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}

.sidebar-logo h2 { font-size: 1.2rem; font-weight: 700; }
.sidebar-logo small { display: block; color: var(--text3); font-size: .75rem; }

.nav-section { padding: 8px 16px 4px; font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .08em; color: var(--text3); }

.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 20px;
  color: var(--text2); border-radius: 8px; margin: 2px 8px;
  transition: background .2s, color .2s; cursor: pointer;
}

.nav-item:hover { background: var(--bg3); color: var(--text); text-decoration: none; }

.nav-item.active {
  background: linear-gradient(135deg, rgba(249,115,22,.2), rgba(239,68,68,.1));
  color: var(--primary);
}

.nav-item .nav-icon { font-size: 1.1rem; width: 22px; text-align: center; }

.nav-item .nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: .7rem; padding: 2px 7px; border-radius: 99px; font-weight: 700;
}

.user-card { display: flex; align-items: center; gap: 10px; }

.user-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .95rem; overflow: hidden; flex-shrink: 0;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-info { flex: 1; min-width: 0; }

.user-info strong { display: block; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.user-info small { color: var(--text3); font-size: .75rem; }

.user-actions a { color: var(--text3); font-size: 1.1rem; }

.user-actions a:hover { color: var(--danger); }

.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; }

.header {
  height: var(--header-h); background: var(--card); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 100;
}

.hamburger { display: none; background: none; border: none; color: var(--text); font-size: 1.4rem; cursor: pointer; padding: 4px; }

.header-title { flex: 1; }

.header-title h1 { font-size: 1.2rem; font-weight: 700; }

.header-title .breadcrumb { font-size: .8rem; color: var(--text3); }

.header-actions { display: flex; align-items: center; gap: 12px; }

.btn-icon {
  width: 38px; height: 38px; border-radius: 10px; background: var(--bg3); border: none;
  color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 1rem; position: relative; transition: background .2s;
}

.btn-icon:hover { background: var(--border); }

.btn-icon .badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: #fff; font-size: .6rem; padding: 2px 5px;
  border-radius: 99px; font-weight: 700; min-width: 18px; text-align: center;
}

.header-search { position: relative; }

.header-search input {
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
  padding: 8px 14px 8px 36px; border-radius: 8px; font-size: .875rem; width: 220px;
}

.header-search input::placeholder { color: var(--text3); }

.header-search .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text3); }

.content { flex: 1; padding: 24px; overflow-x: hidden; }

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow);
}

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }

.card-title { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }

.card-body { }

.card-footer { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }

.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; display: flex; align-items: center; gap: 16px;
}

.stat-icon {
  width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
}

.stat-icon.orange { background: rgba(249,115,22,.15); }
.stat-icon.blue   { background: rgba(59,130,246,.15); }
.stat-icon.green  { background: rgba(16,185,129,.15); }
.stat-icon.red    { background: rgba(239,68,68,.15); }
.stat-icon.purple { background: rgba(168,85,247,.15); }

.stat-value { font-size: 1.8rem; font-weight: 700; line-height: 1; }

.stat-label { color: var(--text3); font-size: .85rem; margin-top: 4px; }

.stat-change { font-size: .8rem; margin-top: 6px; }

.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: .9rem; }
th { font-weight: 600; color: var(--text3); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; background: var(--bg); }
tr:hover td { background: rgba(255,255,255,.02); }
td { color: var(--text); }

.form-group { margin-bottom: 16px; }
label { display: block; margin-bottom: 6px; font-weight: 600; font-size: .875rem; color: var(--text2); }
.form-control {
  width: 100%; padding: 10px 14px; background: var(--bg3); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; font-size: .9rem; transition: border-color .2s;
}
.form-control:focus { outline: none; border-color: var(--primary); }
.form-control::placeholder { color: var(--text3); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: .8rem; color: var(--text3); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 18px; border-radius: 8px; font-size: .875rem; font-weight: 600;
  border: none; cursor: pointer; transition: all .2s; text-decoration: none !important;
  white-space: nowrap;
}

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

.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary2)); color: #fff; }
.btn-primary:hover { opacity: .9; }

.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }

.btn-success { background: var(--success); color: #fff; }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-warning { background: var(--warning); color: #000; }
.btn-info    { background: var(--info);    color: #fff; }

.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }

.btn-outline-primary { border: 1px solid var(--primary); color: var(--primary); background: transparent; }
.btn-outline-primary:hover { background: rgba(249,115,22,.1); }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 99px; font-size: .75rem; font-weight: 600;
}

.badge-success { background: rgba(16,185,129,.15); color: var(--success); }
.badge-danger  { background: rgba(239,68,68,.15);  color: var(--danger); }
.badge-warning { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-info    { background: rgba(59,130,246,.15); color: var(--info); }
.badge-secondary { background: var(--bg3); color: var(--text2); }

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

.alert {
  padding: 12px 16px; border-radius: 8px; font-size: .9rem;
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; position: relative;
}

.alert-success { background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); color: var(--success); }
.alert-danger  { background: rgba(239,68,68,.1);  border: 1px solid rgba(239,68,68,.3);  color: var(--danger); }
.alert-warning { background: rgba(245,158,11,.1); border: 1px solid rgba(245,158,11,.3); color: var(--warning); }
.alert-info    { background: rgba(59,130,246,.1); border: 1px solid rgba(59,130,246,.3);  color: var(--info); }

.alert-close { position: absolute; right: 12px; top: 10px; background: none; border: none; color: inherit; cursor: pointer; font-size: 1.1rem; opacity: .7; }
.alert-close:hover { opacity: 1; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 1000;
  display: none; align-items: center; justify-content: center; padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
  animation: modalIn .2s ease;
}

@keyframes modalIn { from { opacity:0; transform:scale(.95) translateY(-10px); } }

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

.modal-title { font-weight: 700; font-size: 1.1rem; }

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

.modal-body { padding: 24px; }

.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }

.tab {
  padding: 10px 18px; color: var(--text3); cursor: pointer; white-space: nowrap;
  font-size: .9rem; font-weight: 500; transition: all .2s;
}

.tab:hover { color: var(--text); }

.tab.active { color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 20px; }

.page-link {
  padding: 7px 13px; border-radius: 8px; background: var(--bg3);
  color: var(--text2); font-size: .875rem; border: 1px solid var(--border); transition: all .2s;
}

.page-link:hover, .page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }

.dropdown { position: relative; }

.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); background: var(--card);
  border: 1px solid var(--border); border-radius: 10px; min-width: 200px;
  box-shadow: var(--shadow); z-index: 300; display: none; overflow: hidden;
}

.dropdown-menu.open { display: block; }

.dropdown-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: var(--text2); font-size: .875rem; transition: background .2s; }
.dropdown-item:hover { background: var(--bg3); color: var(--text); text-decoration: none; }

.dropdown-divider { border-top: 1px solid var(--border); margin: 4px 0; }

.notif-panel {
  position: absolute; right: 0; top: calc(100% + 8px); background: var(--card);
  border: 1px solid var(--border); border-radius: 12px; width: 340px;
  box-shadow: var(--shadow); z-index: 300; display: none;
}

.notif-panel.open { display: block; }

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

.notif-header h3 { font-size: .95rem; font-weight: 700; }

.notif-list { max-height: 360px; overflow-y: auto; }

.notif-item { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; gap: 12px; cursor: pointer; transition: background .2s; }
.notif-item:hover { background: var(--bg3); }

.notif-item.unread { background: rgba(249,115,22,.05); }

.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; margin-top: 6px; }
.notif-dot.read { background: var(--bg3); }

.notif-text strong { font-size: .875rem; display: block; }
.notif-text small { color: var(--text3); font-size: .78rem; }

.notif-empty { padding: 30px; text-align: center; color: var(--text3); }

.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }

.auth-box { background: var(--card); border: 1px solid var(--border); border-radius: 20px; width: 100%; max-width: 440px; padding: 44px; box-shadow: var(--shadow); }

.auth-logo { text-align: center; margin-bottom: 32px; }

.auth-logo h1 { font-size: 2rem; background: linear-gradient(135deg, var(--primary), var(--primary2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.auth-logo p { color: var(--text3); margin-top: 6px; }

.auth-box h2 { font-size: 1.4rem; margin-bottom: 8px; }

.auth-box .subtitle { color: var(--text3); font-size: .9rem; margin-bottom: 28px; }

.auth-footer { text-align: center; margin-top: 20px; font-size: .875rem; color: var(--text3); }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--text3); font-size: .85rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.domain-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }

.domain-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; transition: border-color .2s, transform .2s;
}

.domain-card:hover { border-color: var(--primary); transform: translateY(-2px); }

.domain-name { font-weight: 700; font-size: 1.05rem; margin-bottom: 8px; }

.domain-meta { color: var(--text3); font-size: .82rem; margin-bottom: 16px; }

.domain-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.dns-type { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: .75rem; font-weight: 700; }
.dns-A    { background: rgba(59,130,246,.15); color: #60a5fa; }
.dns-AAAA { background: rgba(168,85,247,.15); color: #c084fc; }
.dns-CNAME{ background: rgba(245,158,11,.15); color: #fbbf24; }
.dns-MX   { background: rgba(16,185,129,.15); color: #34d399; }
.dns-TXT  { background: rgba(249,115,22,.15); color: #fb923c; }
.dns-NS   { background: rgba(236,72,153,.15); color: #f472b6; }
.dns-SRV  { background: rgba(239,68,68,.15);  color: #f87171; }

.progress { background: var(--bg3); border-radius: 99px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--primary2)); transition: width .4s; }

.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
  position: absolute; cursor: pointer; inset: 0; background: var(--bg3);
  border-radius: 99px; transition: .3s;
}

.toggle-slider::before {
  content: ''; position: absolute; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; left: 3px; top: 3px; transition: .3s;
}

.toggle input:checked + .toggle-slider { background: var(--success); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

.loader { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.8); z-index: 9999; display: none; align-items: center; justify-content: center; }
.loading-overlay.show { display: flex; }

.empty-state { text-align: center; padding: 60px 20px; }
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 8px; }
.empty-state p { color: var(--text3); font-size: .9rem; margin-bottom: 20px; }

.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; max-width: 340px; }

.toast {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; display: flex; align-items: flex-start; gap: 12px;
  box-shadow: var(--shadow); animation: toastIn .3s ease;
}

@keyframes toastIn { from { opacity:0; transform: translateX(20px); } }

.toast.removing { animation: toastOut .3s ease forwards; }
@keyframes toastOut { to { opacity:0; transform: translateX(20px); } }

.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-body strong { font-size: .875rem; display: block; }
.toast-body small { color: var(--text3); font-size: .8rem; }

.toast.success { border: 1px solid var(--success); }
.toast.danger  { border: 1px solid var(--danger); }
.toast.warning { border: 1px solid var(--warning); }
.toast.info    { border: 1px solid var(--info); }

@media (max-width: 1024px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-260px); width: 260px; }
  .sidebar.mobile-open { transform: translateX(0); }
  .main { margin-left: 0; }
  .hamburger { display: flex; }
  .header-search { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .content { padding: 16px; }
  .modal { margin: 10px; }
  .domain-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-box { padding: 28px 20px; }
  .card { padding: 16px; }
  .btn-group { flex-direction: column; }
  .btn-group .btn { width: 100%; }
}

.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 150;
}

.sidebar-overlay.show { display: block; }

.sidebar-admin {
  border-right-color: rgba(245,158,11,.25);
}

.sidebar-admin .nav-section {
  color: rgba(245,158,11,.6);
}

.sidebar-admin .nav-item.active {
  background: linear-gradient(135deg,rgba(245,158,11,.2),rgba(239,68,68,.1));
  color: var(--warning);
}

.sidebar-admin .nav-item:hover {
  background: rgba(245,158,11,.08);
  color: var(--warning);
}

.nav-group { margin: 2px 8px; }

.nav-group-label {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  color: var(--text2); border-radius: 8px; font-size: .9rem;
  transition: background .2s, color .2s; user-select: none;
}

.nav-group-label:hover { background: var(--bg3); color: var(--text); }

.nav-group-label .nav-icon { font-size: 1.1rem; width: 22px; text-align: center; }

.nav-arrow { margin-left: auto; font-size: .75rem; color: var(--text3); transition: transform .2s; }

.nav-group-items { padding-left: 8px; }

.nav-sub { margin: 1px 0 1px 8px; padding: 8px 12px; font-size: .85rem; }

.nav-sub .nav-icon { font-size: .95rem; }

.nav-sub::before { content: ''; display: inline-block; width: 2px; height: 16px;
  background: var(--border); border-radius: 1px; margin-right: 10px; flex-shrink: 0; }

.nav-sub.active::before { background: var(--primary); }

.text-muted  { color: var(--text3); }
.text-small  { font-size: .85rem; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.d-flex      { display: flex; }
.align-center{ align-items: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mb-16       { margin-bottom: 16px; }
.mb-24       { margin-bottom: 24px; }
.fw-bold     { font-weight: 700; }
.truncate    { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-full      { width: 100%; }
