/* ============================================================
   Mora Property Service - Business Management SPA
   Main Stylesheet
   Jacksonville, TX | Landscaping / Lawn Care / Tree Service
   ============================================================ */

/* --- CSS Custom Properties (Theming) --- */
:root {
  --primary: #2d6a1e;
  --primary-dark: #1a4d12;
  --primary-light: #4caf50;
  --primary-bg-tint: rgba(45, 106, 30, 0.06);

  --sidebar-bg: #1a1f24;
  --sidebar-hover: #2a3038;
  --sidebar-active: #2d6a1e;

  --header-bg: #ffffff;
  --content-bg: #f5f6fa;
  --card-bg: #ffffff;

  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  --border-color: #e5e7eb;
  --border-light: #f3f4f6;

  --danger: #dc2626;
  --warning: #f59e0b;
  --info: #3b82f6;
  --success: #10b981;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.12);

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 12px;

  --sidebar-width: 240px;
  --header-height: 60px;

  --transition: 0.2s ease;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  background: var(--content-bg);
  line-height: 1.6;
  min-height: 100vh;
  overflow: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

ul,
ol {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

button {
  font-family: inherit;
}

/* --- App Layout Grid --- */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--header-height) 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar main";
  height: 100vh;
  overflow: hidden;
}

/* --- Sidebar --- */
.sidebar {
  grid-area: sidebar;
  background: var(--sidebar-bg);
  color: #c9cdd4;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #3a4048;
  border-radius: 2px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-brand-text h2 {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.sidebar-brand-text span {
  font-size: 11px;
  color: var(--primary-light);
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.sidebar-nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #5a6068;
  padding: 16px 20px 6px;
  font-weight: 600;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: #9ca3af;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
}

.sidebar-nav a i {
  width: 20px;
  text-align: center;
  font-size: 15px;
}

.sidebar-nav a:hover {
  background: var(--sidebar-hover);
  color: #e5e7eb;
}

.sidebar-nav a.active {
  background: rgba(45, 106, 30, 0.12);
  color: var(--primary-light);
  border-left-color: var(--primary);
}

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-user-info {
  overflow: hidden;
}

.sidebar-user-info .name {
  font-size: 13px;
  font-weight: 600;
  color: #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-info .role {
  font-size: 11px;
  color: #6b7280;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 201;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
}

/* --- Header --- */
.header {
  grid-area: header;
  background: var(--header-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--header-height);
  box-shadow: var(--shadow-sm);
  z-index: 90;
  border-bottom: 1px solid var(--border-light);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-left h1 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-search {
  position: relative;
}

.header-search input {
  height: 36px;
  width: 240px;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--content-bg);
  color: var(--text-primary);
  transition: all var(--transition);
}

.header-search input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 106, 30, 0.15);
  background: #fff;
}

.header-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.header-notification {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--content-bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 16px;
  transition: all var(--transition);
}

.header-notification:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.header-notification .badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  line-height: 1;
}

.header-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.header-user:hover {
  background: var(--content-bg);
}

.header-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}

.header-user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.header-user i {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.header-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 200px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
}

.header-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header-dropdown a,
.header-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
  transition: background var(--transition);
}

.header-dropdown a:hover,
.header-dropdown button:hover {
  background: var(--content-bg);
}

.header-dropdown a:first-child,
.header-dropdown button:first-child {
  border-radius: var(--radius) var(--radius) 0 0;
}

.header-dropdown a:last-child,
.header-dropdown button:last-child {
  border-radius: 0 0 var(--radius) var(--radius);
}

.header-dropdown a i,
.header-dropdown button i {
  width: 18px;
  text-align: center;
  color: var(--text-muted);
}

.header-dropdown .divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

/* --- Main Content --- */
.main-content {
  grid-area: main;
  background: var(--content-bg);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
}

.main-content::-webkit-scrollbar {
  width: 6px;
}

.main-content::-webkit-scrollbar-thumb {
  background: #c9cdd4;
  border-radius: 3px;
}

/* Page header with title and breadcrumb */
.page-header {
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-header .breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.page-header .breadcrumb a {
  color: var(--text-secondary);
}

.page-header .breadcrumb span {
  color: var(--text-primary);
  font-weight: 500;
}

/* --- Cards --- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  transition: box-shadow var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
}

/* Stats Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  border-top: 3px solid var(--primary);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card.accent-orange {
  border-top-color: var(--warning);
}

.stat-card.accent-blue {
  border-top-color: var(--info);
}

.stat-card.accent-red {
  border-top-color: var(--danger);
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: rgba(45, 106, 30, 0.1);
  color: var(--primary);
}

.stat-card.accent-orange .stat-card-icon {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.stat-card.accent-blue .stat-card-icon {
  background: rgba(59, 130, 246, 0.1);
  color: var(--info);
}

.stat-card.accent-red .stat-card-icon {
  background: rgba(220, 38, 38, 0.1);
  color: var(--danger);
}

.stat-card-info {
  flex: 1;
  min-width: 0;
}

.stat-card-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.stat-card-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-card-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}

.stat-card-trend.up {
  color: var(--success);
}

.stat-card-trend.down {
  color: var(--danger);
}

/* --- Tables --- */
.table-container {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.table-container .table-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.table-container .table-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.table-wrapper {
  overflow-x: auto;
}

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

table th {
  background: #f8f9fa;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 2px solid var(--border-color);
}

table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  vertical-align: middle;
}

table tbody tr {
  transition: background var(--transition);
}

table tbody tr:nth-child(even) {
  background: #fafbfc;
}

table tbody tr:hover {
  background: #f0f7ff;
}

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

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

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

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-group label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 4px;
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="search"],
select,
textarea {
  display: block;
  width: 100%;
  height: 40px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  transition: all var(--transition);
  appearance: none;
}

textarea {
  height: auto;
  min-height: 100px;
  resize: vertical;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 106, 30, 0.15);
}

input.error,
select.error,
textarea.error {
  border-color: var(--danger);
}

input.error:focus,
select.error:focus,
textarea.error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--border-light);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Form grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

/* Checkbox & Radio */
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
}

.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

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

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

.btn-secondary {
  background: #6b7280;
  color: #ffffff;
  border-color: #6b7280;
}

.btn-secondary:hover {
  background: #4b5563;
  border-color: #4b5563;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #ffffff;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
  border-color: var(--danger);
}

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
}

.btn-success {
  background: var(--success);
  color: #ffffff;
  border-color: var(--success);
}

.btn-success:hover {
  background: #059669;
  border-color: #059669;
}

.btn-warning {
  background: var(--warning);
  color: #ffffff;
  border-color: var(--warning);
}

.btn-warning:hover {
  background: #d97706;
  border-color: #d97706;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
  height: 48px;
  border-radius: var(--radius);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}

.btn-icon.btn-sm {
  width: 28px;
  height: 28px;
}

.btn-icon.btn-lg {
  width: 48px;
  height: 48px;
}

.btn-block {
  display: flex;
  width: 100%;
}

/* --- Status Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  line-height: 1.5;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-success,
.badge-active,
.badge-completed,
.badge-paid,
.badge-accepted {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.badge-warning,
.badge-pending,
.badge-scheduled,
.badge-draft {
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
}

.badge-danger,
.badge-cancelled,
.badge-declined,
.badge-overdue {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
}

.badge-info,
.badge-in_progress,
.badge-sent,
.badge-confirmed {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.badge-secondary,
.badge-inactive,
.badge-archived {
  background: rgba(107, 114, 128, 0.12);
  color: #4b5563;
}

/* Priority Badges */
.badge-priority-emergency {
  background: rgba(220, 38, 38, 0.12);
  color: #b91c1c;
  font-weight: 700;
}

.badge-priority-high {
  background: rgba(249, 115, 22, 0.12);
  color: #ea580c;
}

.badge-priority-normal {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

.badge-priority-low {
  background: rgba(107, 114, 128, 0.12);
  color: #4b5563;
}

/* Badge Count */
.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  line-height: 1;
}

.badge-count.danger {
  background: var(--danger);
}

.badge-count.warning {
  background: var(--warning);
}

/* --- Modals --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 550px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  animation: scaleIn 0.2s ease;
}

.modal-sm {
  max-width: 400px;
}

.modal-lg {
  max-width: 750px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-light);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
}

.toast {
  width: 360px;
  max-width: calc(100vw - 48px);
  background: var(--card-bg);
  box-shadow: var(--shadow-lg);
  border-radius: 6px;
  padding: 16px;
  border-left: 4px solid var(--info);
  position: relative;
  animation: slideInRight 0.3s ease;
  overflow: hidden;
}

.toast-success {
  border-left-color: var(--success);
}

.toast-error {
  border-left-color: var(--danger);
}

.toast-warning {
  border-left-color: var(--warning);
}

.toast-info {
  border-left-color: var(--info);
}

.toast-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.toast-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.toast-close {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}

.toast-close:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.toast-message {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--primary);
  animation: toastProgress 5s linear forwards;
}

.toast-success .toast-progress { background: var(--success); }
.toast-error .toast-progress { background: var(--danger); }
.toast-warning .toast-progress { background: var(--warning); }
.toast-info .toast-progress { background: var(--info); }

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* --- Tabs --- */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border-light);
  gap: 0;
}

.tab-item {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.tab-item:hover {
  color: var(--text-primary);
  background: var(--border-light);
}

.tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

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

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.pagination-btn:hover {
  background: var(--border-light);
}

.pagination-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-btn i {
  font-size: 12px;
}

/* --- Calendar Component --- */
.calendar {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  overflow: hidden;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}

.calendar-header h3 {
  font-size: 15px;
  font-weight: 600;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-nav button {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.calendar-nav button:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-day-header {
  padding: 8px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  background: #f8f9fa;
  border-bottom: 1px solid var(--border-light);
}

.calendar-day {
  min-height: 80px;
  padding: 6px;
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background var(--transition);
  position: relative;
}

.calendar-day:nth-child(7n) {
  border-right: none;
}

.calendar-day:hover {
  background: #f0f7ff;
}

.calendar-day.other-month {
  color: var(--text-muted);
}

.calendar-day.today {
  background: rgba(45, 106, 30, 0.06);
}

.calendar-day.selected {
  background: rgba(45, 106, 30, 0.12);
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  border-radius: 2px;
}

.calendar-day-number {
  font-size: 13px;
  font-weight: 500;
}

.calendar-day.today .calendar-day-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.calendar-event {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  padding: 2px 4px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 3px;
  background: rgba(45, 106, 30, 0.12);
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-event::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.calendar-more {
  font-size: 10px;
  color: var(--text-muted);
  padding: 2px 4px;
  cursor: pointer;
}

/* --- Search/Filter Bar --- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.filter-bar .search-input {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.filter-bar .search-input i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.filter-bar .search-input input {
  width: 100%;
  height: 40px;
  padding: 8px 12px 8px 36px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text-primary);
}

.filter-bar .search-input input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 106, 30, 0.15);
}

.filter-bar select {
  width: auto;
  min-width: 150px;
  height: 40px;
}

.filter-bar .btn {
  flex-shrink: 0;
}

/* --- Loading States --- */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-sm {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.spinner-lg {
  width: 48px;
  height: 48px;
  border-width: 4px;
}

.spinner-white {
  border-color: rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, #e5e7eb 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-sm);
  height: 16px;
  width: 100%;
}

.skeleton-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
}

.skeleton-sm {
  height: 12px;
}

.skeleton-lg {
  height: 24px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  border-radius: inherit;
}

.loading-overlay.fixed {
  position: fixed;
}

/* --- Empty States --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
  max-width: 400px;
  margin-bottom: 20px;
  line-height: 1.6;
}

/* --- Login Page --- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a4d12 0%, #2d6a1e 50%, #1a4d12 100%);
  padding: 24px;
}

.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(255, 255, 255, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

.login-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  padding: 40px;
  animation: scaleIn 0.3s ease;
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo-icon {
  width: 56px;
  height: 56px;
  background: var(--primary);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #fff;
  margin-bottom: 12px;
}

.login-logo h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.login-logo p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.login-card .form-group {
  margin-bottom: 16px;
}

.login-card .form-group label {
  font-size: 13px;
}

.login-card input {
  height: 44px;
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 13px;
}

.login-error {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.2);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--danger);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-error i {
  flex-shrink: 0;
}

.login-card .btn-primary {
  width: 100%;
  height: 44px;
  font-size: 15px;
  font-weight: 600;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* --- Accordion --- */
.accordion {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
}

.accordion-item {
  border-bottom: 1px solid var(--border-color);
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-primary);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background var(--transition);
}

.accordion-header:hover {
  background: var(--border-light);
}

.accordion-header i {
  transition: transform var(--transition);
  font-size: 12px;
  color: var(--text-muted);
}

.accordion-item.open .accordion-header i {
  transform: rotate(180deg);
}

.accordion-body {
  padding: 0 16px 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* --- Progress Bars --- */
.progress {
  width: 100%;
  height: 8px;
  background: var(--border-light);
  border-radius: 4px;
  overflow: hidden;
}

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

.progress-bar.success {
  background: var(--success);
}

.progress-bar.warning {
  background: var(--warning);
}

.progress-bar.danger {
  background: var(--danger);
}

.progress-bar.info {
  background: var(--info);
}

/* --- Avatar Group --- */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.avatar-lg {
  width: 48px;
  height: 48px;
  font-size: 18px;
}

.avatar-group {
  display: flex;
}

.avatar-group .avatar {
  border: 2px solid var(--card-bg);
  margin-left: -8px;
}

.avatar-group .avatar:first-child {
  margin-left: 0;
}

/* --- Tooltip --- */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition);
}

.tooltip:hover::after {
  opacity: 1;
}

/* --- Dropdown --- */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 180px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a,
.dropdown-menu button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background var(--transition);
  text-decoration: none;
}

.dropdown-menu a:hover,
.dropdown-menu button:hover {
  background: var(--content-bg);
}

.dropdown-menu .divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 0;
}

/* --- Tags / Chips --- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  background: var(--border-light);
  color: var(--text-secondary);
  border-radius: 20px;
}

.chip .chip-remove {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.1);
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  padding: 0;
  line-height: 1;
}

.chip.primary {
  background: rgba(45, 106, 30, 0.1);
  color: var(--primary);
}

.chip.success {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

/* --- Steps / Stepper --- */
.stepper {
  display: flex;
  align-items: center;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  position: relative;
}

.step::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--border-color);
}

.step:last-child::after {
  display: none;
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--card-bg);
  flex-shrink: 0;
}

.step.active .step-number {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.step.completed .step-number {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}

.step.completed::after {
  background: var(--success);
}

.step-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.step.active .step-label {
  color: var(--primary);
  font-weight: 600;
}

.step.completed .step-label {
  color: var(--success);
}

/* --- Timeline --- */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -22px;
  top: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--card-bg);
}

.timeline-dot.secondary {
  background: var(--text-muted);
}

.timeline-dot.success {
  background: var(--success);
}

.timeline-dot.warning {
  background: var(--warning);
}

.timeline-dot.danger {
  background: var(--danger);
}

.timeline-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.timeline-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.timeline-desc {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* --- Utility Classes --- */

/* Display */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

/* Gap */
.gap-4 { gap: 4px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

/* Margin */
.m-0 { margin: 0; }
.mt-0 { margin-top: 0; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.ml-4 { margin-left: 4px; }
.ml-8 { margin-left: 8px; }
.ml-auto { margin-left: auto; }
.mr-4 { margin-right: 4px; }
.mr-8 { margin-right: 8px; }

/* Padding */
.p-0 { padding: 0; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.p-20 { padding: 20px; }
.p-24 { padding: 24px; }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Text Colors */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

/* Text Utilities */
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 22px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.uppercase { text-transform: uppercase; }

/* Truncation */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-half { width: 50%; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }

/* Border */
.border { border: 1px solid var(--border-color); }
.border-t { border-top: 1px solid var(--border-color); }
.border-b { border-bottom: 1px solid var(--border-color); }
.border-rounded { border-radius: var(--radius); }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }

/* Display Helpers */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }

/* Visibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--border-color);
  margin: 16px 0;
}

/* Alert / Callout */
.alert {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
}

.alert i {
  flex-shrink: 0;
  margin-top: 1px;
}

.alert-info {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
  color: #1d4ed8;
}

.alert-success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: #047857;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
  color: #b45309;
}

.alert-danger {
  background: rgba(220, 38, 38, 0.08);
  border-color: rgba(220, 38, 38, 0.2);
  color: #b91c1c;
}

/* --- Responsive --- */

/* <= 1200px: 3 column stats, smaller search */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .header-search input {
    width: 180px;
  }
}

/* <= 1024px: tablet breakpoint */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* <= 768px: mobile breakpoint */
@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: var(--header-height) 1fr;
    grid-template-areas:
      "header"
      "main";
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: flex;
  }

  .sidebar-overlay.open {
    display: block;
  }

  .header-left {
    margin-left: 40px;
  }

  .header-left h1 {
    font-size: 16px;
  }

  .header-search {
    display: none;
  }

  .header-user-name {
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: 16px;
  }

  table {
    font-size: 13px;
  }

  table th,
  table td {
    padding: 8px 12px;
  }

  .modal {
    width: 95%;
    max-height: 90vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .toast {
    width: calc(100vw - 32px);
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar .search-input {
    min-width: 100%;
  }

  .filter-bar select {
    width: 100%;
  }

  .login-card {
    padding: 28px 24px;
  }

  .form-grid,
  .form-grid.cols-3 {
    grid-template-columns: 1fr;
  }

  .pagination {
    flex-wrap: wrap;
  }
}

/* <= 480px: small mobile */
@media (max-width: 480px) {
  .header {
    padding: 0 12px;
  }

  .header-left h1 {
    font-size: 14px;
  }

  .header-right {
    gap: 8px;
  }

  .main-content {
    padding: 12px;
  }

  .card-header {
    padding: 12px 16px;
  }

  .card-body {
    padding: 16px;
  }

  .page-header h2 {
    font-size: 18px;
  }

  .stat-card {
    padding: 16px;
  }

  .stat-card-value {
    font-size: 22px;
  }

  .btn-lg {
    padding: 10px 20px;
    height: 42px;
    font-size: 15px;
  }
}

/* --- Print Styles --- */
@media print {
  .sidebar,
  .sidebar-toggle,
  .sidebar-overlay,
  .header,
  .toast-container {
    display: none !important;
  }

  .app-layout {
    display: block;
  }

  .main-content {
    overflow: visible;
    padding: 0;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }

  table {
    font-size: 12px;
  }
}
