/**
 * Owner/Admin Interface Styles
 *
 * Theme overrides for the owner/admin interface.
 * shared.css is imported in tailwind.css before this file.
 */

/* =========================================
   Owner Theme Overrides
   ========================================= */

:root {
  /* Background colors - darker blue theme */
  --color-bg-primary: #1a1a2e;
  --color-bg-secondary: #16213e;
  --color-bg-tertiary: #0f3460;
  --color-bg-hover: #1e3a5f;

  /* Text colors */
  --color-text-primary: #eee;
  --color-text-secondary: #a0aec0;
  --color-text-muted: #6b7280;

  /* Border colors */
  --color-border: #374151;
  --color-border-focus: #7c3aed;

  /* Accent colors - purple theme */
  --color-accent: #7c3aed;
  --color-accent-hover: #6d28d9;
  --color-accent-text: #ffffff;
}

/* =========================================
   Owner-Specific Body Styles
   ========================================= */

body.admin-app {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
  line-height: 1.6;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}

/* =========================================
   Owner Layout Styles
   ========================================= */

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

.sidebar {
  width: 240px;
  background: var(--color-bg-secondary);
  border-right: 1px solid var(--color-border);
  padding: 1.5rem 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.admin-content {
  margin-left: 240px;
  flex: 1;
  padding: 2rem;
  min-height: 100vh;
  background: var(--color-bg-primary);
}

/* =========================================
   Owner Sidebar Styles
   ========================================= */

.sidebar-header {
  padding: 0 1.5rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-brand {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-accent);
  text-decoration: none;
}

.sidebar-brand:hover {
  opacity: 0.9;
}

.sidebar-badge {
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  background: var(--color-accent);
  color: white;
  border-radius: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Navigation */
.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

.nav-item {
  margin: 0.125rem 0;
}

.nav-link {
  display: block;
  padding: 0.5rem 1.5rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: all 0.15s ease;
}

.nav-link:hover {
  background: var(--color-bg-tertiary);
  color: var(--color-text-primary);
}

.nav-item.active .nav-link {
  background: var(--color-accent);
  color: white;
}

.nav-section {
  margin-top: 1rem;
}

.nav-section-title {
  display: block;
  padding: 0.5rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.nav-sublist {
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-sublist .nav-link {
  padding-left: 2.5rem;
  font-size: 0.875rem;
}

.sidebar-footer {
  padding: var(--spacing-md);
  border-top: 1px solid var(--color-border);
  margin-top: auto;
}

.sidebar-link {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--font-sm);
  text-align: center;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.sidebar-link:hover {
  background-color: var(--color-bg-hover);
  color: var(--color-text-primary);
}

.sidebar-logout {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  margin-top: var(--spacing-sm);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-logout:hover {
  background-color: var(--color-bg-hover);
  color: var(--color-text-primary);
}

/* =========================================
   Owner Page Header Overrides
   ========================================= */

.page-header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

/* =========================================
   Owner Card Overrides
   ========================================= */

.card {
  border: 1px solid var(--color-border);
}

.card-title {
  color: var(--color-accent);
}

/* =========================================
   Owner Table Overrides
   ========================================= */

.data-table th {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table-link {
  font-weight: 500;
}

/* =========================================
   Owner Dashboard Styles
   ========================================= */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.stat-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-accent);
}

.stat-title {
  font-size: var(--font-sm);
  color: var(--color-text-secondary);
  margin-top: var(--spacing-xs);
}

.dashboard-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
}

.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
}

/* =========================================
   Owner User/Realm Detail Styles
   ========================================= */

.user-header,
.realm-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.user-info h2,
.realm-info h2 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.realm-badges {
  display: flex;
  gap: var(--spacing-sm);
}

.realm-description {
  margin-top: var(--spacing-lg);
  padding-top: var(--spacing-lg);
  border-top: 1px solid var(--color-border);
}

.realm-description h4 {
  font-size: var(--font-lg);
  margin-bottom: var(--spacing-sm);
  color: var(--color-text-secondary);
}

/* =========================================
   Owner Form Styles
   ========================================= */

.section-title {
  font-size: var(--font-lg);
  font-weight: 600;
  color: var(--color-accent);
  margin: var(--spacing-lg) 0 var(--spacing-md) 0;
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--color-border);
}

.tab-buttons {
  display: flex;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-lg);
}

.required {
  color: var(--color-text-error);
}

.temp-password {
  display: block;
  background: var(--color-bg-tertiary);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  font-family: monospace;
  margin: var(--spacing-sm) 0;
  word-break: break-all;
}

/* =========================================
   Owner Action Buttons
   ========================================= */

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
}

/* =========================================
   Owner Login Layout
   ========================================= */

.login-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
  background: var(--color-bg-primary);
}

.login-card {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: var(--color-text-muted);
}

/* =========================================
   Owner Config Page Styles
   ========================================= */

.config-section {
  margin-bottom: var(--spacing-xl);
}

.config-section h3 {
  font-size: var(--font-lg);
  font-weight: 600;
  margin-bottom: var(--spacing-md);
  color: var(--color-accent);
}

.config-item {
  margin-bottom: var(--spacing-md);
}

.config-item label {
  display: block;
  font-weight: 500;
  margin-bottom: var(--spacing-xs);
}

.config-item .form-help {
  margin-top: var(--spacing-xs);
}

/* =========================================
   Responsive Styles
   ========================================= */

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: relative;
    height: auto;
  }

  .admin-content {
    margin-left: 0;
    padding: 1rem;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-row {
    flex-direction: column;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .page-header-actions {
    justify-content: flex-start;
  }
}
