/* ===== CSS Variables / Design Tokens ===== */
:root {
  --color-primary: #2563EB;
  --color-primary-hover: #1D4ED8;
  --color-primary-light: #DBEAFE;
  --color-primary-lighter: #EFF6FF;
  --color-success: #059669;
  --color-success-light: #D1FAE5;
  --color-warning: #D97706;
  --color-warning-light: #FEF3C7;
  --color-danger: #DC2626;
  --color-danger-light: #FEE2E2;
  --color-sidebar-bg: #0F172A;
  --color-sidebar-hover: #1E293B;
  --color-sidebar-active: #1E293B;
  --color-sidebar-text: #94A3B8;
  --color-sidebar-text-active: #F8FAFC;
  --color-bg: #F1F5F9;
  --color-surface: #FFFFFF;
  --color-text: #0F172A;
  --color-text-secondary: #64748B;
  --color-text-muted: #94A3B8;
  --color-border: #E2E8F0;
  --color-border-light: #F1F5F9;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: 0.2s ease;
}

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

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

body {
  font-family: var(--font-sans);
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 40%, #e0f2fe 100%);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ===== Login Page ===== */
body.login-page {
  height: 100vh;
  background: #0f172a;
  overflow: hidden;
}

body.app-page {
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.main-content {
  overflow-y: auto;
}

.content-area {
  min-height: 0;
}

.main {
  display: flex;
  height: 100vh;
}

.left {
  flex: 1;
  color: white;
  padding: 80px 70px;
  background: linear-gradient(135deg, #0f172a, #1e3a8a, #8583b4);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo {
  position: absolute;
  top: 30px;
  left: 60px;
  font-size: 22px;
  font-weight: bold;
  letter-spacing: 1px;
}

.left h1 {
  font-size: 46px;
  line-height: 1.3;
  margin-bottom: 20px;
}

.highlight {
  color: #facc15;
}

.left p {
  color: #cbd5e1;
  max-width: 500px;
  line-height: 1.6;
  margin-bottom: 30px;
}

.left img {
  width: 420px;
  margin-top: 20px;
  border-radius: 12px;
  box-shadow: 0 25px 60px rgba(16, 16, 16, 0.5);
}

.right {
  flex: 1;
  background: #0a1857;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  width: 380px;
  padding: 45px 35px;
  border-radius: 16px;
  background: rgba(255,255,255,0.07);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.15);
  box-shadow: 0 25px 60px rgba(0,0,0,.6);
  animation: fadeIn .5s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(25px); }
  to { opacity: 1; transform: translateY(0); }
}

h2 {
  text-align: center;
  color: white;
  margin-bottom: 25px;
}

input, select {
  width: 100%;
  padding: 14px;
  margin-bottom: 18px;
  border: none;
  border-radius: 10px;
  outline: none;
  background: rgba(255,255,255,.12);
  color: white;
  transition: .3s;
}

input::placeholder {
  color: #cbd5e1;
}

input:focus {
  background: rgba(255,255,255,.18);
  transform: scale(1.02);
  box-shadow: 0 0 0 2px rgba(250,204,21,.7), 0 0 15px rgba(250,204,21,.4);
}

button {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg,#facc15,#f59e0b);
  font-weight: bold;
  cursor: pointer;
  transition: .35s;
}

button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(250,204,21,.5);
}

p {
  text-align: center;
  margin-top: 18px;
  color: #e5e7eb;
}

span {
  color: #facc15;
  cursor: pointer;
  font-weight: 600;
}

span:hover {
  text-decoration: underline;
}

.hidden {
  display: none;
}

@media(max-width:900px) {
  .left { display: none; }
  .right { flex: 1; }
}

.role-label {
  display: block;
  font-size: 13px;
  color: #7798c0;
  margin-bottom: 6px;
  margin-top: 5px;
}

.role-dropdown {
  width: 100%;
  padding: 14px;
  margin-bottom: 18px;
  border: none;
  border-radius: 10px;
  outline: none;
  background: rgba(255,255,255,0.12);
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: 0.3s;
}

.role-dropdown:focus {
  background: rgba(255,255,255,0.18);
  box-shadow: 0 0 0 2px rgba(250,204,21,.7), 0 0 12px rgba(250,204,21,.4);
}

.role-dropdown option {
  background: #020617;
  color: white;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg,#6366f1,#3b82f6);
  color: #fff;
  border: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(59,130,246,.3);
}

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

.btn-success:hover {
  background: #047857;
}

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

.btn-danger:hover {
  background: #B91C1C;
}

.btn-outline {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1.5px solid var(--color-border);
}

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

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
}

.btn-block {
  width: 100%;
}

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

/* ===== Layout ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 260px;
  background: linear-gradient(180deg, #1e3a8a, #1e40af, #2563eb);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(148,163,184,0.1);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.sidebar-brand-icon svg {
  width: 20px;
  height: 20px;
  color: #fff;
}

.sidebar-brand-text {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-sidebar-text-active);
  letter-spacing: -0.01em;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  padding: 8px 12px 8px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-sidebar-text);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--color-sidebar-hover);
  color: var(--color-sidebar-text-active);
}

.nav-item.active {
  background: var(--color-sidebar-active);
  color: var(--color-sidebar-text-active);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  width: 3px;
  height: 24px;
  background: var(--color-primary);
  border-radius: 0 2px 2px 0;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.active svg,
.nav-item:hover svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(148,163,184,0.1);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.sidebar-user:hover {
  background: var(--color-sidebar-hover);
}

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

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-sidebar-text-active);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* ===== Main Content ===== */
.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, #f8fafc, #eef2ff, #e0f2fe);
}

.topbar {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.topbar-breadcrumb {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
}

.mobile-menu-btn:hover {
  background: var(--color-border-light);
}

.mobile-menu-btn svg {
  width: 24px;
  height: 24px;
}

.content-area {
  flex: 1;
  padding: 32px;
}

/* ===== Page Header ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.page-header p {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* ===== Cards ===== */
.card {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: 0 10px 25px rgba(0,0,0,0.06);
  transition: all .3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 35px rgba(0,0,0,0.08);
}

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

.card-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
}

.card-body {
  padding: 18px 20px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border-light);
  background: var(--color-border-light);
}

/* ===== Stat Cards ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: linear-gradient(135deg,#ffffff,#f1f5f9);
  border-radius: 16px;
  border: none;
  padding: 24px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.06);
  transition: all .3s ease;
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 35px rgba(0,0,0,0.08);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
}

.stat-icon.blue {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.stat-icon.green {
  background: var(--color-success-light);
  color: var(--color-success);
}

.stat-icon.orange {
  background: var(--color-warning-light);
  color: var(--color-warning);
}

.stat-icon.red {
  background: var(--color-danger-light);
  color: var(--color-danger);
}

.stat-info h4 {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.stat-info .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-info .stat-change {
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 4px;
}

.stat-change.positive {
  color: var(--color-success);
}

.stat-change.negative {
  color: var(--color-danger);
}

/* ===== Tables ===== */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--color-border-light);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

tbody td {
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border-light);
}

tbody tr:hover {
  background: var(--color-primary-lighter);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-primary {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.badge-success {
  background: var(--color-success-light);
  color: var(--color-success);
}

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

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

/* ===== Charts (Canvas) ===== */
.chart-container {
  position: relative;
  width: 100%;
  max-height: 300px;
}

.chart-container canvas {
  width: 100% !important;
  height: 100% !important;
}

/* ===== Grid Layouts ===== */
.grid-2 {
  display: grid;
  margin-bottom: 24px;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

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

/* ===== Profile Card ===== */
.profile-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 32px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  background: var(--color-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.profile-info h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
}

.profile-info p {
  color: var(--color-text-secondary);
  font-size: 0.875rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.detail-item {
  padding: 16px 20px;
  background: var(--color-border-light);
  border-radius: var(--radius-sm);
}

.detail-item label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.detail-item span {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}

/* ===== Welcome Banner ===== */
.welcome-banner {
  background: linear-gradient(135deg, var(--color-primary) 0%, #1D4ED8 100%);
  border-radius: var(--radius);
  padding: 32px;
  color: #fff;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.welcome-banner::after {
  content: '';
  position: absolute;
  top: -30%;
  right: -5%;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.welcome-banner::before {
  content: '';
  position: absolute;
  bottom: -40%;
  right: 10%;
  width: 150px;
  height: 150px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.welcome-banner h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}

.welcome-banner p {
  font-size: 0.9375rem;
  opacity: 0.85;
  position: relative;
  z-index: 1;
}

/* ===== Modal / Insert Form ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

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

.modal-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 4px;
  border-radius: 6px;
  transition: all var(--transition);
}

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

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ===== Toast / Notification ===== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.5s forwards;
}

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

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

.toast.info {
  border-left: 4px solid var(--color-primary);
}

.toast-icon {
  flex-shrink: 0;
}

.toast-message {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

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

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

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.empty-state h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

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

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .main-content {
    margin-left: 0;
  }

  .mobile-menu-btn {
    display: block;
  }

  .topbar {
    padding: 0 20px;
  }

  .content-area {
    padding: 20px;
  }

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

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

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

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

  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .welcome-banner {
    padding: 24px;
  }

  .modal {
    margin: 16px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .btn {
    font-size: 0.8125rem;
    padding: 8px 16px;
  }
}

/* ===== Sidebar overlay for mobile ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.5);
  z-index: 99;
}

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

/* ===== Action Buttons in Table ===== */
.action-btns {
  display: flex;
  gap: 6px;
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* ===== Loading Spinner ===== */
.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ===== Quick Actions ===== */
.quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== Recent Activity ===== */
.activity-list {
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border-light);
}

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

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}

.activity-dot.blue { background: var(--color-primary); }
.activity-dot.green { background: var(--color-success); }
.activity-dot.orange { background: var(--color-warning); }
.activity-dot.red { background: var(--color-danger); }

.activity-text {
  font-size: 0.875rem;
  color: var(--color-text);
}

.activity-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.app-layout {
  animation: fadeDashboard .6s ease;
}

@keyframes fadeDashboard {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Leave Page Form Fixes ===== */
.form-control {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: #ffffff;
  color: #0f172a;
  font-size: 14px;
  outline: none;
  transition: 0.2s ease;
}

.content-area > div[style*="max-width:600px"] {
  max-width: 900px !important;
  width: 100%;
}

.form-group {
  margin-bottom: 5px;
}

.form-group label {
  font-size: 13px;
  margin-bottom: 4px;
}

textarea.form-control {
  min-height: 80px;
}

.btn-block {
  padding: 10px;
  margin-top: 8px;
}

/* ===== Toggle Buttons ===== */
.toggle-group {
  display: inline-flex;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  overflow: hidden;
}

.toggle-btn {
  padding: 6px 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  width: auto;
}

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

.toggle-btn:hover:not(.active) {
  background: var(--color-border-light);
}

/* ===== Edit Profile Form ===== */
.edit-form-group {
  margin-bottom: 16px;
}

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

.edit-form-group input,
.edit-form-group select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  font-size: 0.875rem;
  outline: none;
  transition: 0.2s ease;
  margin-bottom: 0;
}

.edit-form-group input:focus,
.edit-form-group select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  transform: none;
  background: #fff;
}

/* ===== Attendance Split Layout ===== */
.split-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

@media (max-width: 1024px) {
  .split-layout {
    grid-template-columns: 1fr;
  }
}

.timer-display {
  font-size: 4rem;
  font-weight: 700;
  color: #3b82f6;
  margin: 20px 0;
  font-family: monospace;
}

.holiday-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #3b82f6;
  padding: 16px;
  border-radius: 8px;
  min-width: 240px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.umbrella-box {
  background: #f0f9ff;
  padding: 10px;
  border-radius: 12px;
  color: #0ea5e9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.holiday-modal-content {
  max-width: 1000px !important;
  width: 90% !important;
}

/* ===== Admin Assign Modal ===== */
.assign-form-group {
  margin-bottom: 14px;
}

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

.assign-form-group input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  font-size: 0.875rem;
  outline: none;
  margin-bottom: 0;
}

.assign-form-group input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  transform: none;
  background: #fff;
}

/* ===== Admin Attendance Layout ===== */
.admin-attendance-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .admin-attendance-layout {
    grid-template-columns: 1fr;
  }
}

/* ===== Insight Cards ===== */
.insight-card {
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-bottom: 12px;
}

.insight-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.insight-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
}

.insight-card.green-card {
  background: #dcfce7;
  border: 1px solid #bbf7d0;
}

.insight-card.pink-card {
  background: #fce7f3;
  border: 1px solid #fbcfe8;
}

.insight-card.yellow-card {
  background: #fef9c3;
  border: 1px solid #fef08a;
}

/* ===== Profile Photo Upload ===== */
.profile-avatar-wrapper {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}

.profile-avatar-wrapper:hover .photo-upload-overlay {
  opacity: 1;
}

.photo-upload-overlay {
  transition: opacity 0.2s ease;
}
