/* ========================================
   KAMTIB SMANSA - Modern Admin Dashboard
   Color Scheme: Navy, Dark Blue, White
   ======================================== */

:root {
  --primary-navy: #430909;
  --primary-dark: #280904;
  --primary-blue: #ae0505;
  --accent-light: #5c0505;
  --bg-white: #ffffff;
  --bg-light: #f8f9fa;
  --text-dark: #1a1a1a;
  --text-gray: #666666;
  --text-light: #999999;
  --border-light: #e5e7eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 28px rgba(0, 0, 0, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-light);
  color: var(--text-dark);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.75rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

p {
  line-height: 1.6;
  color: var(--text-gray);
}

a {
  text-decoration: none;
  color: var(--primary-blue);
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-light);
}

/* ========================================
   LAYOUT - SIDEBAR & MAIN
   ======================================== */

.container-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 260px;
  background: linear-gradient(135deg, var(--primary-navy) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 20px 15px;
  overflow-y: auto;
  box-shadow: var(--shadow);
  position: relative;
  z-index: 100;
}

.sidebar-header {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-right: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.sidebar-logo .icon-text {
  font-weight: bold;
  font-size: 20px;
  color: white;
}

.sidebar-title {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.sidebar-subtitle {
  font-size: 0.75rem;
  opacity: 0.7;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav-item {
  margin-bottom: 8px;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  color: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 0.95rem;
}

.sidebar-nav-link:hover,
.sidebar-nav-link.active {
  background-color: var(--primary-blue);
  color: white;
}

.sidebar-nav-icon {
  margin-right: 12px;
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header {
  background: white;
  padding: 20px 30px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.header-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 999px;
  transition: background 0.2s ease;
}

.profile-info:hover {
  background: rgba(30, 58, 95, 0.06);
}

.profile-avatar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-light));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
}

.profile-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.profile-role {
  font-size: 0.75rem;
  color: var(--text-light);
}

.profile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.profile-menu-box {
  width: min(100%, 360px);
  background: #ffffff;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.profile-menu-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.profile-menu-avatar {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.1rem;
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-light));
  box-shadow: 0 8px 24px rgba(30, 58, 95, 0.16);
}

.profile-menu-header-text {
  min-width: 0;
}

.profile-menu-title {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 4px;
}

.profile-menu-subtitle {
  font-size: 0.9rem;
  color: #6b7280;
}

.profile-menu-description {
  margin-bottom: 20px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #4b5563;
}

.profile-menu-action {
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 12px 16px;
  font-size: 0.95rem;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-menu-change {
  background: #1e40af;
  color: #ffffff;
  border-color: transparent;
  margin-bottom: 10px;
}

.profile-menu-change:hover {
  background: #1d4ed8;
}

.profile-menu-logout {
  background: #ffffff;
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.2);
}

.profile-menu-logout:hover {
  background: rgba(239, 68, 68, 0.08);
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
}

/* ========================================
   CARDS & COMPONENTS
   ======================================== */

.card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-light);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
}

.card-subtitle {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 3px;
}

/* Stat Cards */

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.stat-content h3 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 5px;
}

.stat-content p {
  font-size: 0.9rem;
  color: var(--text-gray);
  margin: 0;
}

.stat-icon {
  font-size: 2.5rem;
  opacity: 0.2;
}

.stat-card.primary .stat-icon { color: var(--primary-blue); }
.stat-card.success .stat-icon { color: var(--success); }
.stat-card.warning .stat-icon { color: var(--warning); }
.stat-card.danger .stat-icon { color: var(--danger); }

/* ========================================
   FORMS
   ======================================== */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-dark);
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  background: white;
  min-width: 0; /* allow flex/grid children to shrink properly */
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; /* single-line inputs should truncate instead of overflowing */
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: white;
}

.form-control::placeholder {
  color: var(--text-light);
}

select.form-control {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  height: 44px;
  padding: 10px 40px 10px 15px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background-color: white;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select.form-control:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.06);
  outline: none;
}

/* Some browsers limit styling of option elements; keep options readable */
select.form-control option {
  padding: 8px 10px;
  font-size: 0.95rem;
  white-space: normal; /* allow option text to wrap in native dropdown */
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.violation-datetime-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

/* ========================================
   Custom Select Replacement Styles
   ======================================== */
.custom-select-wrapper {
  position: relative;
  overflow: visible;
}
.custom-select {
  position: relative;
  display: inline-block;
  width: 100%;
}
.cs-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 15px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  box-sizing: border-box;
}
.cs-display:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 4px 12px rgba(30,58,95,0.08);
}
.cs-placeholder { color: var(--text-light); }
.cs-chevron {
  width: 18px;
  height: 18px;
  display: inline-block;
  transform: rotate(0deg);
  transition: transform 0.2s ease;
}
.custom-select.open .cs-chevron { transform: rotate(180deg); }
.cs-options {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  max-height: 260px;
  overflow: auto;
  background: white;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  box-sizing: border-box;
}
.cs-option {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.95rem;
}
.cs-option:hover, .cs-option.active { background: var(--bg-light); }


/* Ensure form groups and controls can shrink inside grid/flex containers */
.form-row > .form-group,
.form-group {
  min-width: 0;
}

/* Multi-line controls (textarea) should wrap text and allow vertical scrolling */
.form-control[type="textarea"],
textarea.form-control {
  white-space: normal;
  overflow: auto;
  min-height: 100px;
}

table td,
table th,
.table td,
.table th {
  vertical-align: middle;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-blue), var(--accent-light));
  color: white;
}

.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  color: white;
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger), #1e40af);
  color: white;
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning), #d97706);
  color: white;
}

.btn-secondary {
  background: var(--bg-light);
  color: var(--text-dark);
  border: 1px solid var(--border-light);
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.action-card-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 16px;
  text-align: center;
}

.action-note {
  margin: 0;
  color: var(--text-gray);
  font-size: 0.95rem;
  max-width: 560px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* ========================================
   TABLES
   ======================================== */

.table-responsive {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th {
  background: var(--bg-light);
  padding: 15px;
  text-align: left;
  font-weight: 600;
  color: var(--text-dark);
  border-bottom: 2px solid var(--border-light);
}

.table td {
  padding: 15px;
  border-bottom: 1px solid var(--border-light);
}

.table th.col-officer { width: 6%; min-width: 150px; }
.table th.col-note { width: 36%; min-width: 160px; }
.table th.col-status { width: 14%; min-width: 110px; }
.table td.col-note { white-space: normal; word-break: break-word; }
.table td.col-officer { white-space: normal; max-width: none; overflow: visible; text-overflow: initial; }
.table td.col-status { white-space: nowrap; }

.table tbody tr {
  transition: all 0.3s ease;
}

.table tbody tr:hover {
  background-color: var(--bg-light);
}

.table-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.action-edit {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-blue);
}

.action-edit:hover {
  background: rgba(59, 130, 246, 0.2);
}

.action-delete {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.action-delete:hover {
  background: rgba(239, 68, 68, 0.2);
}

/* ========================================
   MODALS & DIALOGS
   ======================================== */

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
  display: flex;
  flex-direction: column;
  /* allow modal content to scroll when tall on desktop */
  max-height: calc(100vh - 80px);
  overflow: hidden;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-gray);
}

.modal-body {
  padding: 20px;
  overflow: auto;
  /* allow body area to scroll while keeping header/footer visible */
  max-height: calc(100vh - 200px);
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ========================================
   ALERTS & NOTIFICATIONS
   ======================================== */

.alert {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideDown 0.3s ease;

}

@keyframes slideDown {
  from {
    transform: translateY(-20px);

/* Preview wrapper for export preview only: allows horizontal scroll on small devices */
.export-preview-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  box-sizing: border-box;
  padding-bottom: 8px;
}
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.alert-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.alert-content {
  flex: 1;
}

.alert-title {
  font-weight: 600;
  margin-bottom: 3px;
}

.alert-message {
  font-size: 0.9rem;
  margin: 0;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border-left: 4px solid var(--success);
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border-left: 4px solid var(--danger);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border-left: 4px solid var(--warning);
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-blue);
  border-left: 4px solid var(--primary-blue);
}

/* ========================================
   LOADING & EMPTY STATES
   ======================================== */

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

.spinner {
  border: 4px solid #e0e7ff;
  border-top-color: #1e3a5f;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 15px auto;
  border-radius: 8px;
  border: 1px dashed var(--border-light);
  display: inline-block;
  box-sizing: border-box;
}

.empty-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.empty-message {
  color: var(--text-gray);
  margin-bottom: 20px;
}

/* ========================================
   SEARCH & FILTER
   ======================================== */

.search-box {
  position: relative;
  margin-bottom: 20px;
}

.search-box input {
  width: 100%;
  padding: 12px 15px 12px 40px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 0.95rem;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

.filter-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-light);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-chip.active {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
}

.filter-chip:hover {
  border-color: var(--primary-blue);
}

/* ========================================
   CHARTS
   ======================================== */

.chart-container {
  position: relative;
  height: 300px;
  margin-bottom: 20px;
}

.chart-wrapper {
  width: 100%;
  height: 100%;
}

/* ========================================
   GRID & LAYOUT
   ======================================== */

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.section {
  margin-bottom: 30px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
}

/* ========================================
   HAMBURGER MENU
   ======================================== */

.hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  margin: 6px 0;
  transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(-45deg) translate(-8px, 8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(45deg) translate(-8px, -8px);
}

/* ========================================
   UTILITIES
   ======================================== */

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.p-10 { padding: 10px; }
.p-20 { padding: 20px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.hidden { display: none; }

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.badge-info {
  background: rgba(59, 130, 246, 0.2);
  color: var(--primary-blue);
}

.edit-violations-list {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
  background: var(--bg-light);
}

.edit-violation-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: white;
  color: var(--text-dark);
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1.35;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.edit-violation-option:hover {
  border-color: var(--primary-blue);
  background: #eff6ff;
}

.edit-violation-option input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  accent-color: var(--primary-blue);
}

/* ========================================
   GURU WALI STATUS CONTROL
   ======================================== */
.guru-wali-page .guru-wali-status-heading {
  min-width: 190px;
}

.guru-wali-page .guru-wali-status-cell {
  min-width: 190px;
  white-space: normal;
  vertical-align: middle;
}

.guru-wali-page .guru-wali-status-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.guru-wali-page .guru-wali-status-indicator {
  display: inline-flex;
  flex: 0 0 10px;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
}

.guru-wali-page .guru-wali-status-select {
  min-width: 0;
  height: 38px;
  padding: 8px 34px 8px 10px;
  font-size: 0.85rem;
  border-radius: 6px;
}

.guru-wali-page .guru-wali-status-cell .custom-select-wrapper {
  flex: 1 1 auto;
  min-width: 0;
}

.guru-wali-page .guru-wali-status-cell .custom-select {
  min-width: 0;
}

.guru-wali-page .guru-wali-status-cell .cs-display {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
}

.guru-wali-page .guru-wali-status-cell .cs-options {
  top: calc(100% + 5px);
  padding: 5px;
  border-radius: 7px;
  box-shadow: 0 10px 24px rgba(15, 29, 61, 0.14);
}

.guru-wali-page .guru-wali-status-cell .cs-option {
  position: relative;
  min-height: 36px;
  padding: 8px 10px 8px 28px;
  border-radius: 5px;
  font-size: 0.84rem;
}

.guru-wali-page .guru-wali-status-cell .cs-option::before {
  position: absolute;
  left: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
  content: '';
}

.guru-wali-page .guru-wali-status-cell .cs-option-proses::before {
  background: #f59e0b;
}

.guru-wali-page .guru-wali-status-cell .cs-option-selesai::before {
  background: #22c55e;
}

.guru-wali-page .guru-wali-status-cell .cs-option:hover,
.guru-wali-page .guru-wali-status-cell .cs-option.active {
  background: #eff6ff;
  color: var(--primary-blue);
}

.guru-wali-page .guru-wali-status-badge {
  margin-top: 7px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  line-height: 1.3;
}

@media (max-width: 768px) {
  .guru-wali-page .guru-wali-status-heading,
  .guru-wali-page .guru-wali-status-cell {
    min-width: 175px;
  }

  .guru-wali-page .guru-wali-status-select {
    font-size: 0.8rem;
  }
}

/* ========================================
   FLIPBOOK & MEDIA
   ======================================== */

.flipbook-container {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  min-height: 400px;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flipbook-container a {
  width: 100%;
  height: 100%;
  display: block;
}

.flipbook-container iframe {
  width: 100% !important;
  height: 100% !important;
  border: none;
}

/* ========================================
   TAB NAVIGATION
   ======================================== */

.tab-navigation {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-light);
  background: white;
  padding: 0 20px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-gray);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  margin-bottom: -2px;
}

.tab-btn:hover {
  color: var(--primary-blue);
}

.tab-btn.active {
  color: var(--primary-blue);
  border-bottom-color: var(--primary-blue);
}

.tab-btn i {
  font-size: 1.1rem;
}

.tab-btn span {
  display: inline;
}

.tab-content {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .container-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    padding: 15px;
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    max-height: 100vh;
    overflow-y: auto;
    z-index: 200;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
  }

  .sidebar.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .main-content {
    height: auto;
    min-height: 100vh;
  }

  .header {
    height: 60px;
    padding: 0 15px;
    justify-content: space-between;
  }

  .header-title {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-right {
    gap: 10px;
    min-width: 0;
    flex-shrink: 0;
  }

  .profile-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(30, 58, 95, 0.04);
    min-width: 0;
    justify-content: flex-end;
  }

  .profile-info .profile-name,
  .profile-info .profile-role {
    display: none !important;
  }

  .profile-info .profile-avatar {
    display: flex;
    width: 42px;
    height: 42px;
    min-width: 42px;
    font-size: 0.95rem;
  }

  .hamburger {
    display: block;
  }

  .content {
    padding: 15px;
    margin-top: 0;
  }

  .dashboard-page .content {
    overflow-x: hidden;
  }

  .dashboard-page .table-responsive {
    overflow-x: visible;
  }

  .dashboard-page .recent-activities-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
  }

  .dashboard-page .recent-activities-responsive table {
    min-width: 600px;
  }

  .stat-cards {
    grid-template-columns: 1fr;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .violation-datetime-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .table {
    font-size: 0.85rem;
  }

  .table th,
  .table td {
    padding: 10px;
  }

  .modal-content {
    width: 95%;
  }

  .filter-group {
    flex-direction: column;
  }

  .filter-chip {
    width: 100%;
  }

  .chart-container {
    height: 250px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.25rem;
  }

  .stat-content h3 {
    font-size: 1.5rem;
  }

  .btn {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  .btn-lg {
    padding: 12px 20px;
  }

  .table {
    font-size: 0.8rem;
  }

  .table th,
  .table td {
    padding: 8px;
  }

  .profile-name {
    display: none;
  }

  .header-right {
    gap: 5px;
  }

  .flipbook-container {
    min-height: 280px;
    max-height: 400px;
    border-radius: 6px;
  }

  .card h2 {
    font-size: 1.3rem;
  }

  .tab-navigation {
    padding: 0 10px;
  }

  .tab-btn {
    padding: 12px 10px;
    font-size: 0.9rem;
    flex: 1;
    justify-content: center;
  }

  .tab-btn span {
    display: none;
  }

  .tab-btn i {
    font-size: 1rem;
  }
}

/* ========================================
   LOGIN PAGE SPECIFIC
   ======================================== */

.login-container {
  position: relative;
  display: flex;
  min-height: 100vh;
  background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 128, 255, 0.808)),
              url('/Aset/image/BG LOGIN SMANSA.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.login-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(40, 9, 9, 0.5);
  pointer-events: none;
}

.login-left,
.login-right {
  position: relative;
  z-index: 1;
}

.login-left {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-card {
  background: rgb(255, 255, 255);
  border-radius: 12px;
  padding: 40px;
  box-shadow: var(--shadow-lg);
  max-width: 450px;
  width: 100%;
  animation: slideUp 0.5s ease;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo {
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.login-logo img {
  width: 60px;
  height: 60px;
  max-width: 100%;
  object-fit: contain;
}

.login-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 0.9rem;
  color: var(--text-gray);
  margin-bottom: 5px;
}

.login-subtitle-small {
  font-size: 0.8rem;
  color: var(--text-light);
}

.input-group {
  margin-bottom: 20px;
  position: relative;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-blue);
  font-size: 1.1rem;
}

.input-group input {
  width: 100%;
  padding: 12px 15px 12px 40px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.input-group input:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(0, 200, 255, 0.1);
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.85rem;
  color: var(--text-light);
}

.login-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: rgb(255, 255, 255);
  text-align: center;
}

.login-illustration {
  animation: float 3s ease-in-out infinite;
}

.illustration-icon {
  font-size: 8rem;
  opacity: 0.3;
  margin-bottom: 20px;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

@media (max-width: 768px) {
  .login-container {
    flex-direction: column;
  }

  .login-left,
  .login-right {
    flex: auto;
    padding: 20px;
  }

  .login-right {
    display: none;
  }

  .login-card {
    padding: 30px;
  }
}

.login-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 24, 41, 0.72);
  backdrop-filter: blur(4px);
}

.login-loading-overlay.active {
  display: flex;
}

.login-loading-card {
  background: white;
  border-radius: 16px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  max-width: 320px;
  width: 100%;
}

.login-loading-spinner {
  margin: 0 auto 16px auto;
  width: 48px;
  height: 48px;
  border-width: 5px;
  border-top-color: var(--primary-blue);
}

.login-loading-title {
  font-size: 1.15rem;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.login-loading-text {
  color: var(--text-gray);
  margin: 0;
  font-size: 0.95rem;
}

/* ========================================
   ANIMATION CLASSES
   ======================================== */

.fade-in {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.scale-in {
  animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Scroll Bar */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}
