@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/remixicon@3.5.0/fonts/remixicon.css');

:root {
  --ink: #0f172a;
  --muted: #6b7280;
  --accent: #f5c344;
  --panel: rgba(255, 255, 255, 0.9);
  --stroke: rgba(255, 255, 255, 0.35);
  --shadow: 0 30px 60px rgba(0, 0, 0, 0.18);
  --radius: 18px;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Manrope', 'Segoe UI', sans-serif;
  color: var(--ink);
  background: linear-gradient(150deg, #f6f8fb, #eef2f7);
}

.app-shell {
  display: flex;
  min-height: 100vh;
  background: #f8fafc;
  position: relative;
}

.sidebar {
  width: 96px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  padding: 16px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow: hidden;
  flex-shrink: 0;
  transition: width 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset -1px 0 0 rgba(15, 23, 42, 0.04);
  z-index: 100;
}

.sidebar:hover,
.sidebar:focus-within {
  width: 260px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  overflow-y: auto;
}

.sidebar .sidebar-brand {
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 16px;
  color: #0f172a;
}

.sidebar[data-collapsible] .sidebar-label {
  opacity: 1;
  transition: opacity 0.12s ease;
  white-space: nowrap;
}

.sidebar[data-collapsible]:not(:hover):not(:focus-within) .sidebar-label {
  opacity: 0;
  pointer-events: none;
}

.sidebar-section-heading {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
  margin: 12px 0 4px;
}

.sidebar-group {
  margin-bottom: 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 4px 0;
}

.sidebar-group[open] {
  border-color: #e5e7eb;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02);
}

.sidebar-group summary {
  cursor: pointer;
  font-weight: 700;
  color: #0f172a;
  padding: 6px 8px;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.sidebar-group summary::-webkit-details-marker {
  display: none;
}

.sidebar-summary-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #e0e7ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0f4ba7;
  flex-shrink: 0;
  font-size: 16px;
}

.sidebar-chevron {
  margin-left: auto;
  font-size: 18px;
  transition: transform 0.18s ease;
}

.sidebar-chevron.is-rotated {
  transform: rotate(180deg);
}

.sidebar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #0f172a;
  font-size: 18px;
  flex-shrink: 0;
  border: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  margin: 4px 0;
  border-radius: 10px;
  text-decoration: none;
  color: #0f172a;
  border: 1px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.sidebar-link:hover {
  background: #f8fafc;
  border-color: #e5e7eb;
}

.sidebar-link.active {
  background: #0f4ba7;
  color: #fff;
  border-color: #0f4ba7;
}

.sidebar-link.active .sidebar-icon {
  color: #fff;
}

.sidebar-footer {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
}

.sidebar-link .sidebar-label {
  font-weight: 600;
}

.main-content {
  flex: 1;
  padding: 24px;
  min-height: 100vh;
  background: #f8fafc;
  overflow-y: auto;
  margin-left: 96px;
  width: calc(100% - 96px);
  transition: none;
}

.config-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  margin: 0 0 16px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.04);
}

.config-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  color: #0f172a;
  font-weight: 700;
  background: #f8fafc;
}

.config-nav a.active {
  background: #0f4ba7;
  color: #fff;
  border-color: #0f4ba7;
  box-shadow: 0 10px 20px rgba(15, 75, 167, 0.18);
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.login-panel {
  width: min(460px, 100%);
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
  padding: 28px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #0b2f63, #103d80);
  color: #f8f9fb;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand-text .eyebrow {
  margin: 0;
  color: var(--muted);
  letter-spacing: 0.12em;
  font-size: 12px;
  text-transform: uppercase;
}

.brand-name {
  margin: 2px 0 0 0;
  font-weight: 700;
}

.headline h1 {
  margin: 12px 0 4px;
  font-size: 28px;
}

.headline p {
  margin: 0 0 20px;
  color: var(--muted);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  font-weight: 600;
  color: #111827;
}

.field input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 14px 14px;
  font-size: 15px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: #f8fafc;
}

.field input:focus {
  outline: none;
  border-color: #0f4ba7;
  box-shadow: 0 0 0 3px rgba(15, 75, 167, 0.15);
  background: #ffffff;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 46px;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: #f1f5f9;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 4px 6px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.toggle-password .eye {
  width: 20px;
  height: 20px;
}

.toggle-password:not(.revealed) .eye-closed {
  display: none;
}

.toggle-password.revealed .eye-open {
  display: none;
}

.hint {
  color: #dc2626;
  font-size: 13px;
}

.message {
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid transparent;
  font-weight: 600;
}

.message.error {
  background: #fef2f2;
  border-color: #fecdd3;
  color: #b91c1c;
}

.message.success {
  background: #ecfdf3;
  border-color: #bbf7d0;
  color: #15803d;
}

.message[hidden] {
  display: none;
}

.actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0 16px;
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #111827;
  font-weight: 600;
}

.inline-link {
  color: #0f4ba7;
  text-decoration: none;
  font-weight: 600;
}

.inline-link[aria-disabled='true'] {
  opacity: 0.6;
  cursor: not-allowed;
}

.primary-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-weight: 700;
  color: #0a142a;
  background: linear-gradient(135deg, #f5c344, #f0a900);
  box-shadow: 0 12px 30px rgba(245, 195, 68, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(245, 195, 68, 0.42);
}

.primary-btn:active {
  transform: translateY(0);
  box-shadow: 0 8px 20px rgba(245, 195, 68, 0.35);
}

@media (max-width: 1024px) {
  .page {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .page {
    padding: 24px;
  }

  .login-panel {
    padding: 24px;
    background: rgba(255, 255, 255, 0.96);
  }
}
