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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #0a0f1e 0%, #0f172a 100%);
  color: #e2e8f0;
  min-height: 100vh;
}

nav {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
  position: sticky;
  top: 0;
  z-index: 100;
  height: 58px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.nav-brand {
  font-weight: 800;
  font-size: 20px;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}
.nav-domain {
  color: #475569;
  font-size: 12px;
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;
  background: rgba(51, 65, 85, 0.3);
  padding: 3px 10px;
  border-radius: 4px;
  border: 1px solid rgba(51, 65, 85, 0.3);
}
.nav-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
  flex-shrink: 0;
}
.status-dot.online {
  background: #22c55e;
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
  animation: pulse-online 2s ease-in-out infinite;
}
.status-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}
@keyframes pulse-online {
  0%, 100% { box-shadow: 0 0 8px rgba(34, 197, 94, 0.3); }
  50% { box-shadow: 0 0 18px rgba(34, 197, 94, 0.7); }
}

.container {
  display: flex;
  min-height: calc(100vh - 58px);
}

aside {
  width: 230px;
  background: rgba(15, 23, 42, 0.6);
  border-right: 1px solid rgba(51, 65, 85, 0.3);
  padding: 16px 0;
  flex-shrink: 0;
  overflow-y: auto;
}
.menu {
  list-style: none;
}
.menu li {
  padding: 11px 24px;
  cursor: pointer;
  color: #64748b;
  font-size: 14px;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  user-select: none;
}
.menu li:hover {
  background: rgba(51, 65, 85, 0.4);
  color: #e2e8f0;
}
.menu li.active {
  background: rgba(56, 189, 248, 0.08);
  color: #38bdf8;
  border-left-color: #38bdf8;
  font-weight: 600;
}
.menu-icon {
  width: 20px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

main {
  flex: 1;
  padding: 32px 36px;
  overflow-y: auto;
  max-width: 1200px;
}

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

h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 24px;
  color: #f1f5f9;
  letter-spacing: -0.3px;
}
h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 28px 0 12px;
  color: #38bdf8;
  letter-spacing: -0.2px;
}
h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 8px;
  color: #cbd5e1;
}
p {
  margin: 8px 0;
  line-height: 1.7;
  color: #94a3b8;
  font-size: 14px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.card {
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(30, 41, 59, 0.4));
  border: 1px solid rgba(51, 65, 85, 0.4);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.3), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.card:hover {
  border-color: rgba(56, 189, 248, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.card:hover::before { opacity: 1; }
.card-label {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  font-weight: 600;
}
.card-value {
  font-size: 28px;
  font-weight: 700;
  color: #38bdf8;
  font-variant-numeric: tabular-nums;
}
.card-value.card-danger { color: #ef4444; }
.card-value.card-success { color: #22c55e; }

.info-box {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(51, 65, 85, 0.3);
  border-radius: 10px;
  padding: 14px 20px;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.6;
}
.info-box strong { color: #cbd5e1; }

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}
th {
  color: #64748b;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding-top: 8px;
  padding-bottom: 8px;
}
td { color: #e2e8f0; }
tr:hover td { background: rgba(51, 65, 85, 0.15); }
td .badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.badge-ok {
  background: rgba(34, 197, 94, 0.12);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.2);
}
.badge-fail {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

form { margin: 16px 0; }
.inline-form {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}
label {
  display: block;
  margin-bottom: 14px;
  font-size: 13px;
  color: #94a3b8;
  font-weight: 500;
}
label input, label textarea, input, textarea, select {
  display: block;
  width: 100%;
  margin-top: 6px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(51, 65, 85, 0.5);
  color: #e2e8f0;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}
select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
label input:focus, label textarea:focus, input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}
.inline-form input, .inline-form select { width: auto; min-width: 200px; }
.role-select { width: auto !important; min-width: 110px !important; display: inline-block !important; }
.role-badge { font-size:11px; background:#1e3a5f; color:#93c5fd; padding:2px 8px; border-radius:4px; margin-right:8px; font-weight:600; letter-spacing:0.3px; }
.page-btn { background:#1e293b; border:1px solid #334155; color:#94a3b8; padding:4px 10px; border-radius:4px; cursor:pointer; font-size:12px; }
.page-btn:hover { background:#334155; color:#e2e8f0; border-color:#38bdf8; }
.page-btn:disabled { opacity:0.4; cursor:default; }

button {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border: none;
  padding: 9px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
  font-family: inherit;
  letter-spacing: 0.2px;
}
button:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}
button:active { transform: translateY(0); }
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
button.danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
}
button.danger:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}
button.secondary {
  background: rgba(51, 65, 85, 0.5);
  border: 1px solid rgba(51, 65, 85, 0.5);
}
button.secondary:hover {
  background: rgba(71, 85, 105, 0.5);
  border-color: #38bdf8;
  box-shadow: none;
}

#configMsg, #testMsg, #brandConfigMsg {
  margin-left: 12px;
  font-size: 13px;
  color: #22c55e;
  font-weight: 500;
}
.warning {
  margin-top: 12px;
  padding: 10px 16px;
  background: rgba(234, 179, 8, 0.08);
  border: 1px solid rgba(234, 179, 8, 0.2);
  border-radius: 8px;
  font-size: 13px;
  color: #fde047;
}

pre {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(51, 65, 85, 0.3);
  border-radius: 8px;
  padding: 16px;
  font-size: 13px;
  overflow-x: auto;
  color: #a5b4fc;
  margin: 10px 0;
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;
  line-height: 1.5;
}
code {
  background: rgba(51, 65, 85, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 13px;
  color: #f472b6;
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace;
}

.delete-btn {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 20px;
  padding: 0 6px;
  transition: all 0.2s ease;
  line-height: 1;
  opacity: 0.6;
}
.delete-btn:hover {
  color: #fca5a5;
  opacity: 1;
  background: none;
  box-shadow: none;
  transform: none;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.checkbox-label input { width: auto; }

details {
  margin: 8px 0;
}
details summary {
  cursor: pointer;
  color: #38bdf8;
  font-weight: 600;
  font-size: 14px;
  padding: 4px 0;
  transition: color 0.2s;
}
details summary:hover { color: #7dd3fc; }

#ociStatus {
  font-size: 13px;
  color: #94a3b8;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.tab.active { animation: fadeIn 0.25s ease; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(51, 65, 85, 0.5); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(71, 85, 105, 0.5); }

@media (max-width: 900px) {
  aside { width: 60px; }
  .menu li { padding: 12px; justify-content: center; }
  .menu-icon { width: auto; }
  .menu li span:not(.menu-icon) { display: none; }
  main { padding: 24px 20px; }
  .cards { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
}
@media (max-width: 600px) {
  nav { padding: 0 12px; gap: 8px; flex-wrap: wrap; height: auto; min-height: 50px; }
  .nav-domain { display: none; }
  .container { flex-direction: column; }
  aside { width: 100%; border-right: none; border-bottom: 1px solid rgba(51, 65, 85, 0.3); padding: 0; overflow-x: auto; }
  aside .menu { display: flex; }
  aside .menu li { white-space: nowrap; border-left: none; border-bottom: 3px solid transparent; padding: 10px 14px; }
  aside .menu li.active { border-left-color: transparent; border-bottom-color: #38bdf8; }
  aside .menu li span:not(.menu-icon) { display: inline; }
  main { padding: 20px 16px; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
