@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #10b981;
  --bg-color: #f3f4f6;
  --card-bg: #ffffff;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-md: 8px;
  --radius-lg: 12px;
  --glass-bg: rgba(255, 255, 255, 0.85);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
}

/* Typography & Layout */
h2, h3 {
  color: var(--text-main);
  font-weight: 600;
  margin-bottom: 1rem;
}

.container {
  padding: 20px;
  /*max-width: 1600px;*/
  margin: 0 auto;
}

/* Smart Tabs & Top Navigation */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  gap: 15px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
  background-color: var(--primary-color);
  color: white;
}

/* Buttons */
button, input[type="submit"], .btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  display: inline-block;
}

button:hover, input[type="submit"]:hover, .btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-danger { background-color: #ef4444; }
.btn-danger:hover { background-color: #dc2626; }
.btn-success { background-color: #10b981; }
.btn-success:hover { background-color: #059669; }
.btn-outline { background-color: transparent; border: 1px solid var(--border-color); color: var(--text-main); box-shadow: none; }
.btn-outline:hover { background-color: var(--bg-color); color: var(--text-main); }

/* Form Elements */
input[type="text"], input[type="password"], input[type="date"], select {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background: white;
}

input[type="text"]:focus, select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Tables */
.table-container {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow-x: auto;
  margin-top: 20px;
  max-height: 75vh;
  border: 1px solid var(--border-color);
}

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

th {
  background: var(--bg-color);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.95rem;
}

tbody tr {
  transition: background-color 0.2s ease;
}

tbody tr:hover {
  background-color: rgba(37, 99, 235, 0.02);
}

.group-header {
  background-color: #f8fafc !important;
  font-weight: 600;
}

.group-header button {
  padding: 4px 10px;
  margin-right: 12px;
  border-radius: 4px;
  background: white;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  font-size: 1rem;
}

.right { text-align: right; }
.center { text-align: center; }

/* Popups / Modals */
.overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(4px);
  z-index: 999;
}

.popup {
  display: none;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--card-bg);
  width: 90%; 
  max-height: 85vh;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
  flex-direction: column;
}

.popup-header {
  padding: 20px 25px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-color);
}

.popup-body {
  padding: 20px;
  overflow-y: auto;
  flex-grow: 1;
}

.popup-footer {
  padding: 15px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--bg-color);
}

.zero-total {
    display: table-row;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin-top: 20px;
}

.pagination a {
  padding: 8px 14px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
}

.pagination a:hover {
  background: var(--bg-color);
}

.pagination a.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Cards & Utilities */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 25px;
  border: 1px solid var(--border-color);
}

.badge {
  padding: 4px 8px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #e0e7ff;
  color: #4f46e5;
}

/* Tab buttons for reports */
.report-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.report-tabs button {
  background: transparent;
  color: var(--text-muted);
  box-shadow: none;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 15px;
}

.report-tabs button:hover {
  color: var(--primary-color);
  background: rgba(37, 99, 235, 0.05);
}

.report-tabs button.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}
