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

:root {
  --primary-color: #0066cc;
  --primary-hover: #0052a3;
  --secondary-color: #333333;
  --background-color: #f0f2f5;
  --panel-background: #ffffff;
  --border-color: #d1d5db;
  --success-color: #059669;
  --success-bg: #d1fae5;
  --error-color: #dc2626;
  --error-bg: #fee2e2;
  --text-color: #1f2937;
  --text-muted: #6b7280;
  --sidebar-bg: #1e3a5f;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.5;
}

.container {
  display: grid;
  grid-template-areas:
    "header header"
    "sidebar main"
    "footer footer";
  grid-template-columns: 220px 1fr;
  grid-template-rows: 60px 1fr 40px;
  min-height: 100vh;
}

/* Header */
.header {
  grid-area: header;
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

.logo-icon {
  font-size: 28px;
}

.logo-text {
  font-size: 18px;
  font-weight: 600;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #6b7280;
}

.status-dot.online {
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* Sidebar */
.sidebar {
  grid-area: sidebar;
  background-color: var(--sidebar-bg);
  padding: 16px 0;
}

.sidebar ul {
  list-style: none;
}

.sidebar a {
  display: block;
  padding: 12px 24px;
  color: #a3bfdb;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar a:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.sidebar a.active {
  background-color: rgba(255, 255, 255, 0.15);
  color: white;
  border-left-color: var(--primary-color);
}

/* Main Content */
.main-content {
  grid-area: main;
  padding: 24px;
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.panel {
  flex: 1;
  background-color: var(--panel-background);
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.panel h1 {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--secondary-color);
}

.panel-description {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Notification */
.notification {
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.notification.hidden {
  display: none;
}

.notification.success {
  background-color: var(--success-bg);
  color: var(--success-color);
  border: 1px solid var(--success-color);
}

.notification.error {
  background-color: var(--error-bg);
  color: var(--error-color);
  border: 1px solid var(--error-color);
}

/* Form */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 14px;
}

.form-group input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.form-group .hint {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  width: 100%;
}

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

.btn-primary:disabled {
  background-color: #9ca3af;
  cursor: not-allowed;
}

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.hidden {
  display: none !important;
}

/* Side Panels */
.side-panels {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 280px;
}

/* Credentials Info */
.credentials-info {
  background-color: var(--panel-background);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-left: 4px solid var(--primary-color);
}

.credentials-info h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--secondary-color);
}

.credentials-info dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
}

.credentials-info dt {
  font-size: 13px;
  color: var(--text-muted);
}

.credentials-info dd {
  font-size: 13px;
  font-weight: 500;
  word-break: break-all;
}

.credentials-info dd#current-password {
  font-family: monospace;
  background-color: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
}

.no-credentials {
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

/* Device Info */
.device-info {
  background-color: var(--panel-background);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.device-info h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--secondary-color);
}

.device-info dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
}

.device-info dt {
  font-size: 13px;
  color: var(--text-muted);
}

.device-info dd {
  font-size: 13px;
  font-weight: 500;
}

/* Footer */
.footer {
  grid-area: footer;
  background-color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    grid-template-areas:
      "header"
      "main"
      "footer";
    grid-template-columns: 1fr;
    grid-template-rows: 60px 1fr 40px;
  }

  .sidebar {
    display: none;
  }

  .main-content {
    flex-direction: column;
  }

  .side-panels {
    width: 100%;
  }
}
