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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
}

/* Header */
.top-bar {
  background: #8B1A2B;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  height: 70px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-text {
  font-weight: bold;
  font-size: 18px;
  letter-spacing: 2px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.btn-logout {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 1px solid rgba(255,255,255,0.5);
  padding: 8px 20px;
  text-decoration: none;
  border-radius: 4px;
  font-size: 14px;
}

.btn-logout:hover { background: rgba(255,255,255,0.3); }

/* Layout */
.layout {
  display: flex;
  min-height: calc(100vh - 70px);
}

/* Sidebar */
.sidebar {
  width: 180px;
  background: #2d2d2d;
  padding: 0;
  flex-shrink: 0;
}

.sidebar a {
  display: block;
  color: white;
  text-decoration: none;
  padding: 12px 15px;
  font-size: 13px;
  border-bottom: 1px solid #3d3d3d;
  transition: background 0.2s;
}

.sidebar a:hover, .sidebar a.active {
  background: #444;
}

.sidebar .icon { margin-right: 5px; font-size: 10px; }

/* Main content */
.main-content {
  flex: 1;
  padding: 25px 30px;
}

.main-content h1 {
  font-size: 24px;
  font-weight: 300;
  color: #333;
  margin-bottom: 20px;
}

/* Login page */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 70px);
  background: #f5f5f5;
}

.login-box {
  background: #3d3d3d;
  color: white;
  padding: 40px;
  border-radius: 5px;
  width: 400px;
}

.login-box h2 {
  font-weight: 300;
  font-size: 24px;
  margin-bottom: 20px;
  color: #9bc;
}

.login-box label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  font-size: 14px;
}

.login-box input[type="text"],
.login-box input[type="password"] {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: none;
  border-radius: 3px;
  font-size: 14px;
}

.login-box .btn-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  background: #555;
  padding: 15px;
  margin: 10px -40px -40px -40px;
  border-radius: 0 0 5px 5px;
}

.login-error {
  background: #c0392b;
  padding: 10px;
  border-radius: 3px;
  margin-bottom: 15px;
  font-size: 14px;
}

/* Dashboard */
.dashboard-cards {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
justify-content: center;
}

.dash-card {
  background: #8B1A2B;
  color: white;
  border-radius: 5px;
  width: 220px;
  text-align: center;
  overflow: hidden;
}

.dash-card h3 {
  padding: 15px;
  font-weight: 400;
  font-size: 16px;
}

.dash-card .card-icon {
  font-size: 48px;
  padding: 15px;
}

.dash-card a {
  display: block;
  background: rgba(0,0,0,0.2);
  color: white;
  text-decoration: none;
  padding: 12px;
  font-size: 14px;
}

.dash-card a:hover { background: rgba(0,0,0,0.3); }

.dashboard-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.dash-link {
  background: #3d3d3d;
  color: white;
  text-decoration: none;
  padding: 12px 15px;
  border-radius: 4px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-link:hover { background: #555; }

/* Forms */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: inline-block;
  width: 220px;
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  padding-right: 15px;
  vertical-align: top;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 14px;
  width: 300px;
}

.form-group textarea {
  height: 80px;
  resize: vertical;
}

.form-group.checkboxes {
  padding-left: 235px;
}

.form-group.checkboxes label {
  display: inline;
  width: auto;
  text-align: left;
  padding-right: 0;
  font-weight: normal;
  margin-right: 15px;
}

.cinema-checkboxes {
  padding-left: 235px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.cinema-checkboxes label {
  font-weight: normal;
  font-size: 13px;
}

/* Buttons */
.btn {
  padding: 10px 25px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-primary { background: #8B1A2B; color: white; }
.btn-primary:hover { background: #a02035; }

.btn-secondary { background: #999; color: white; }
.btn-secondary:hover { background: #777; }

.btn-danger { background: #c0392b; color: white; }
.btn-danger:hover { background: #e74c3c; }

.btn-dark { background: #3d3d3d; color: white; }
.btn-dark:hover { background: #555; }

.btn-row {
  padding-left: 235px;
  margin-top: 20px;
  display: flex;
  gap: 10px;
}

/* Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  margin-top: 15px;
}

.data-table th {
  background: #555;
  color: white;
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
}

.data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  font-size: 13px;
  vertical-align: top;
}

.data-table tr:hover { background: #f9f9f9; }

.table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.table-controls select,
.table-controls input {
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 13px;
}

/* Filter bar */
.filter-bar {
  background: white;
  padding: 15px 20px;
  border-radius: 5px;
  margin-bottom: 20px;
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-bar label {
  font-size: 14px;
  font-weight: 600;
}

.filter-bar select,
.filter-bar input {
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 14px;
}

/* Attendance grid */
.attendance-section {
  background: white;
  margin-bottom: 25px;
  border-radius: 5px;
  overflow: hidden;
}

.attendance-section h3 {
  background: #f0f0f0;
  padding: 10px 15px;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid #ddd;
}

.attendance-grid {
  width: 100%;
  border-collapse: collapse;
}

.attendance-grid th {
  padding: 8px 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  background: #f8f8f8;
  border: 1px solid #ddd;
}

.attendance-grid td {
  padding: 4px 6px;
  border: 1px solid #eee;
  font-size: 12px;
  text-align: center;
}

.attendance-grid td.label-cell {
  text-align: left;
  font-weight: 600;
  padding-left: 12px;
  width: 140px;
  background: #fafafa;
}

.attendance-grid input[type="number"],
.attendance-grid input[type="text"] {
  width: 80px;
  padding: 4px 6px;
  border: 1px solid #ccc;
  border-radius: 2px;
  text-align: right;
  font-size: 12px;
}

.attendance-grid select {
  padding: 3px;
  font-size: 12px;
}

.attendance-grid .total-cell {
  font-weight: bold;
  background: #f8f8f8;
}

/* Regional grid */
.regional-grid {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.regional-grid th,
.regional-grid td {
  padding: 10px 15px;
  border: 1px solid #ddd;
  font-size: 14px;
}

.regional-grid th {
  background: #f0f0f0;
  font-weight: 600;
}

.regional-grid input {
  width: 150px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  text-align: right;
  font-size: 14px;
}

/* Success message */
.success-msg {
  background: #27ae60;
  color: white;
  padding: 10px 15px;
  border-radius: 4px;
  margin-bottom: 15px;
  font-size: 14px;
}

.error-msg {
  background: #c0392b;
  color: white;
  padding: 10px 15px;
  border-radius: 4px;
  margin-bottom: 15px;
  font-size: 14px;
}

/* Months in Icelandic */
.month-select option { font-size: 14px; }

/* Responsive */
@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; display: flex; flex-wrap: wrap; }
  .sidebar a { flex: 1; text-align: center; min-width: 120px; }
  .dashboard-cards { flex-direction: column; }
  .dashboard-links { grid-template-columns: 1fr; }
  .form-group label { width: 100%; text-align: left; margin-bottom: 5px; }
  .form-group input, .form-group select, .form-group textarea { width: 100%; }
  .btn-row, .form-group.checkboxes, .cinema-checkboxes { padding-left: 0; }
}
