/* pwa-frontend/src/styles/app.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --bg-main: #0F172A;
  --bg-card: rgba(30, 41, 59, 0.85);
  --border-color: rgba(255, 255, 255, 0.08);
  --primary: #3B82F6;
  --primary-hover: #2563EB;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --purple: #8B5CF6;
  --info: #06B6D4;
  --font: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Sidebar Navigation */
.app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: rgba(15, 23, 42, 0.95);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 2rem;
  padding-left: 0.5rem;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.nav-item button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-item button:hover,
.nav-item button.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--primary);
}

.main-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.header-bar h1 {
  font-size: 1.75rem;
  font-weight: 700;
}

/* Cards & Grid */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  backdrop-filter: blur(12px);
}

.kpi-title {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.kpi-val {
  font-size: 1.85rem;
  font-weight: 700;
}

/* Data Tables */
.card-table {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  overflow: hidden;
  margin-bottom: 2rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

th {
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

/* Badges for 6 Attendance Statuses */
.badge {
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
}

.badge-present { background: rgba(16, 185, 129, 0.2); color: #34D399; }
.badge-absent  { background: rgba(239, 68, 68, 0.2);  color: #F87171; }
.badge-late    { background: rgba(245, 158, 11, 0.2); color: #FBBF24; }
.badge-halfday { background: rgba(139, 92, 246, 0.2); color: #A78BFA; }
.badge-leave   { background: rgba(6, 182, 212, 0.2);  color: #38BDF8; }
.badge-excused { background: rgba(148, 163, 184, 0.2);color: #CBD5E1; }

/* Capacity Bar */
.capacity-container {
  width: 100%;
  background: rgba(255, 255, 255, 0.1);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.capacity-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.capacity-fill.full {
  background: var(--danger);
}

/* Forms & Buttons */
.btn {
  padding: 0.65rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

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

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.input-field {
  width: 100%;
  padding: 0.65rem 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  color: var(--text-main);
  margin-bottom: 1rem;
}

/* Printable PDF Invoice & Receipt Stylesheet */
@media print {
  body {
    background: #FFF !important;
    color: #000 !important;
  }
  .sidebar, .header-bar, .btn {
    display: none !important;
  }
  .printable-area {
    display: block !important;
    padding: 2rem;
  }
}
