/* Dark theme for internal portal */
:root {
  --bg-primary: #1a1a2e;
  --bg-secondary: #16213e;
  --bg-card: #0f3460;
  --text-primary: #eaeaea;
  --text-secondary: #a0a0a0;
  --accent: #e94560;
  --accent-hover: #ff6b6b;
  --border: #2a2a4a;
  --success: #4ade80;
  --warning: #fbbf24;
  --error: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  color: var(--text-primary);
  background: var(--bg-primary);
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* Top Navigation */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  height: 60px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.top-nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.top-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-name {
  color: var(--text-primary);
  font-size: 1.3em;
  font-weight: bold;
  cursor: pointer;
}

.brand-tag {
  background: var(--accent);
  color: white;
  font-size: 0.7em;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: bold;
  text-transform: uppercase;
}

.top-nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Login button */
.login-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
  padding: 8px 16px;
  border-radius: 5px;
  transition: all 0.3s;
}

.login-btn:hover {
  background: rgba(233, 69, 96, 0.1);
  color: var(--accent-hover);
}

.login-icon {
  width: 18px;
  height: 18px;
}

/* User profile */
.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--accent);
}

.user-name {
  color: var(--text-primary);
  font-size: 0.9em;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  color: var(--text-secondary);
  border-radius: 5px;
  transition: all 0.3s;
  text-decoration: none;
}

.logout-btn:hover {
  color: var(--accent);
  background: rgba(233, 69, 96, 0.1);
}

.logout-icon {
  width: 20px;
  height: 20px;
}

/* Login Page */
#login-page {
  min-height: calc(100vh - 60px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 60px;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 20px;
}

.login-box {
  background: var(--bg-secondary);
  padding: 40px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.login-box h1 {
  margin: 0;
  font-size: 2em;
  color: var(--text-primary);
}

.login-box .lock-icon {
  margin-bottom: 20px;
}

.login-box .lock-icon svg {
  width: 60px;
  height: 60px;
  color: var(--accent);
}

.login-box .subtitle {
  color: var(--accent);
  font-weight: bold;
  margin: 5px 0 20px;
}

.login-box .description {
  color: var(--text-secondary);
  font-size: 0.9em;
  margin-bottom: 30px;
}

.google-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: white;
  color: #333;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 5px;
  font-weight: 500;
  transition: all 0.3s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.google-login-btn:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transform: translateY(-1px);
}

.google-icon {
  width: 20px;
  height: 20px;
}

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  min-height: calc(100vh - 100px);
  padding-top: 60px;
}

/* Sidebar */
.sidebar {
  width: 250px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  position: fixed;
  top: 60px;
  bottom: 40px;
  left: 0;
  overflow-y: auto;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 10px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

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

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

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 250px;
  padding: 20px 30px;
  min-height: calc(100vh - 100px);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page h2 {
  margin-top: 0;
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 10px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.page-header h2 {
  margin: 0;
  border: none;
  padding: 0;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.stat-card {
  background: var(--bg-card);
  padding: 25px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.stat-value {
  font-size: 2.5em;
  font-weight: bold;
  color: var(--accent);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9em;
  margin-top: 5px;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s;
}

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

.btn-primary svg {
  width: 18px;
  height: 18px;
}

/* Data Lists */
.data-list {
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 20px;
}

.empty-state {
  color: var(--text-secondary);
  text-align: center;
  font-style: italic;
  padding: 40px;
}

.data-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid var(--border);
}

.data-item:last-child {
  border-bottom: none;
}

.data-item-info h4 {
  margin: 0;
  color: var(--text-primary);
}

.data-item-info p {
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 0.9em;
}

.data-item-actions {
  display: flex;
  gap: 10px;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 5px;
  border-radius: 5px;
  transition: all 0.2s;
}

.btn-icon:hover {
  color: var(--accent);
  background: rgba(233, 69, 96, 0.1);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.show {
  opacity: 1;
}

.modal-content {
  background: var(--bg-secondary);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  min-width: 400px;
  max-width: 500px;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-content h3 {
  margin-top: 0;
  color: var(--text-primary);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 10px;
}

.modal-content label {
  display: block;
  color: var(--text-secondary);
  margin-bottom: 5px;
  font-size: 0.9em;
}

.modal-content input,
.modal-content select {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-primary);
  font-size: 1em;
}

.modal-content input:focus,
.modal-content select:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

.btn-secondary {
  background: var(--border);
  color: var(--text-primary);
  border: none;
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s;
}

.btn-secondary:hover {
  background: var(--bg-card);
}

/* Footer */
footer {
  text-align: center;
  padding: 10px 0;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.85em;
  margin-left: 250px;
}

#login-page ~ footer {
  margin-left: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }
  
  .sidebar .nav-item span {
    display: none;
  }
  
  .main-content {
    margin-left: 60px;
  }
  
  footer {
    margin-left: 60px;
  }
  
  .user-name {
    display: none;
  }
}
