/* DeCircle Solar Modern Styling System */
/* Fonts imported in HTML via <link> — this file has no external dependencies */

:root {
  --energy-navy: #0A1F44;
  --surface-navy: #132B54;
  --card-bg: rgba(19, 43, 84, 0.85);
  --solar-gold: #FFC107;
  --solar-orange: #FF7A00;
  --text-main: #FFFFFF;
  --text-muted: #94A3B8;
  --border-color: rgba(255, 193, 7, 0.25);
  --border-subtle: rgba(255, 255, 255, 0.1);
  --error-red: #EF4444;
  --success-green: #10B981;
  --header-height: 56px;
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--energy-navy);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ==========================================================================
   Header Navigation Bar (Dashboard & Admin)
   ========================================================================== */
.header-bar {
  height: var(--header-height);
  background: var(--energy-navy);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--solar-gold), var(--solar-orange));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--energy-navy);
  font-size: 1.1rem;
  box-shadow: 0 0 12px rgba(255, 193, 7, 0.4);
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.brand-title span {
  color: var(--solar-gold);
}

.user-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
}

.role-tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.role-tag.admin {
  background: rgba(255, 193, 7, 0.2);
  color: var(--solar-gold);
  border: 1px solid rgba(255, 193, 7, 0.4);
}

.role-tag.viewer {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success-green);
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
}

.btn-admin {
  background: rgba(255, 193, 7, 0.15);
  color: var(--solar-gold);
  border: 1px solid rgba(255, 193, 7, 0.3);
}

.btn-admin:hover {
  background: var(--solar-gold);
  color: var(--energy-navy);
}

.btn-logout {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-logout:hover {
  background: var(--error-red);
  color: #FFFFFF;
}

/* ==========================================================================
   Full Viewport Iframe Container (Dashboard)
   ========================================================================== */
.dashboard-viewport {
  width: 100vw;
  height: calc(100vh - var(--header-height));
  margin-top: var(--header-height);
  overflow: hidden;
  position: relative;
  background: #061530;
}

.dashboard-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ==========================================================================
   Centered Auth & Admin Page Layouts
   ========================================================================== */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: radial-gradient(circle at top right, #132B54 0%, #0A1F44 60%, #05122B 100%);
}

.auth-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  width: 100%;
  max-width: 440px;
  padding: 36px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  position: relative;
}

.auth-header {
  text-align: center;
  margin-bottom: 28px;
}

.auth-header .logo-ring {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--solar-gold), var(--solar-orange));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--energy-navy);
  box-shadow: 0 0 20px rgba(255, 193, 7, 0.4);
}

.auth-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: #CBD5E1;
  margin-bottom: 8px;
}

.input-control {
  width: 100%;
  padding: 12px 16px;
  background: rgba(10, 31, 68, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: #FFFFFF;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-control:focus {
  outline: none;
  border-color: var(--solar-gold);
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.15);
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--solar-gold), var(--solar-orange));
  border: none;
  border-radius: 8px;
  color: var(--energy-navy);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 193, 7, 0.45);
}

.btn-primary:active {
  transform: translateY(0);
}

.demo-credentials {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.demo-credentials code {
  background: rgba(255, 255, 255, 0.1);
  color: var(--solar-gold);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
}

.alert-box {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 20px;
  display: none;
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #F87171;
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34D399;
}

/* ==========================================================================
   Admin User Management Layout
   ========================================================================== */
.admin-container {
  max-width: 1000px;
  margin: calc(var(--header-height) + 40px) auto 40px;
  padding: 0 20px;
}

.page-title-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-title-section h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--solar-gold);
}

.admin-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
}

@media (max-width: 860px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

.panel-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.panel-card h2 {
  font-size: 1.2rem;
  margin-bottom: 18px;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Table styling */
.data-table-wrapper {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background: rgba(10, 31, 68, 0.8);
  color: var(--solar-gold);
  font-weight: 600;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-color);
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: #E2E8F0;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.btn-delete {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: 0.2s;
}

.btn-delete:hover {
  background: var(--error-red);
  color: #fff;
}
