/* ==========================================================================
   Temple Management System - Modern Professional CSS Architecture
   Client: Chamal Karappetta Mallasheri Bhagavathi Temple
   ========================================================================== */

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
  background-color: var(--bg-light, #f8f9fb);
  color: var(--text-dark, #2d2d2d);
  line-height: 1.6;
}

a {
  color: var(--primary-color, #00794E);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* App Layout Grid */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.top-navbar {
  height: 60px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
}

.nav-brand {
  font-size: 16px;
  color: var(--secondary-color, #00396F);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 13px;
}

.role-badge {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.role-super-admin { background: #e0e7ff; color: #3730a3; }
.role-temple-admin { background: #dcfce7; color: #166534; }
.role-staff { background: #fef3c7; color: #92400e; }
.role-devotee { background: #f3e8ff; color: #6b21a8; }

.nav-logout {
  color: #dc2626;
  font-weight: 600;
}

.app-body {
  display: flex;
  flex: 1;
}

.app-sidebar {
  width: 240px;
  background: #ffffff;
  border-right: 1px solid var(--border-color, #e2e8f0);
  padding: 20px 0;
}

.sidebar-header h2 {
  font-size: 12px;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 0 20px 10px 20px;
  letter-spacing: 0.5px;
}

.sidebar-menu {
  list-style: none;
}

.sidebar-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 14px;
  color: #334155;
  transition: background 0.15s, color 0.15s;
}

.sidebar-menu li a:hover {
  background-color: #f1f5f9;
  color: var(--primary-color, #00794E);
  text-decoration: none;
}

.main-content {
  flex: 1;
  padding: 30px;
}

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

.page-title-bar h1 {
  font-size: 22px;
  color: var(--secondary-color, #00396F);
}

/* Dashboard Grid & Cards */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.metric-card {
  background: #ffffff;
  padding: 22px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid var(--border-color, #e2e8f0);
}

.metric-card h3 {
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 8px;
}

.metric-card .metric-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--secondary-color, #00396F);
}

/* Tables */
.card-table {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  border: 1px solid var(--border-color, #e2e8f0);
  overflow: hidden;
}

.table-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.table-header h2 {
  font-size: 16px;
  color: var(--secondary-color, #00396F);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th, .data-table td {
  padding: 12px 18px;
  text-align: left;
  border-bottom: 1px solid #f1f5f9;
}

.data-table th {
  background-color: #f8fafc;
  color: #475569;
  font-weight: 600;
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

/* Status Badges */
.badge {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.badge-active { background: #dcfce7; color: #15803d; }
.badge-inactive { background: #fee2e2; color: #b91c1c; }
.badge-suspended { background: #fef3c7; color: #b45309; }

/* Auth / Login Styling */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color, #00794E) 0%, var(--secondary-color, #00396F) 100%);
  padding: 20px;
}

.auth-card {
  background: #ffffff;
  width: 100%;
  max-width: 440px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  padding: 35px 30px;
}

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

.auth-header h1 {
  font-size: 20px;
  color: var(--secondary-color, #00396F);
  margin-top: 10px;
}

.auth-header p {
  font-size: 13px;
  color: #64748b;
}

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

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #334155;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: 6px;
  font-size: 14px;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-color, #00794E);
  box-shadow: 0 0 0 3px rgba(0, 121, 78, 0.15);
}

.btn {
  display: inline-block;
  font-weight: 600;
  text-align: center;
  padding: 9px 18px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.2s;
}

.btn-primary {
  background-color: var(--primary-color, #00794E);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: #00603e;
}

.btn-secondary {
  background-color: #64748b;
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: #475569;
}

.alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 20px;
}

.alert-danger {
  background-color: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-success {
  background-color: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.auth-footer {
  margin-top: 25px;
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
}

.required-asterisk { color: red; font-size: 1.2em; font-weight: bold; }

/* ==========================================================================
   Nakshatra Searchable Combobox Component
   ========================================================================== */
.nakshatra-combobox-wrapper {
  position: relative;
  width: 100%;
}

.nakshatra-search-input {
  width: 100%;
  padding: 10px 42px 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  background-color: #ffffff;
  color: #1e293b;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.nakshatra-search-input:focus {
  border-color: #3b82f6;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.nakshatra-dropdown-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 1050;
  margin: 0;
  padding: 4px;
  list-style: none;
}

.nakshatra-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #334155;
  transition: background-color 0.1s ease;
}

.nakshatra-item:hover,
.nakshatra-item.active {
  background-color: #f1f5f9;
  color: #0f172a;
}

.nakshatra-item.selected {
  background-color: #eff6ff;
  color: #1d4ed8;
  font-weight: 600;
}
