/* ============================================================================
   SMARTCAMPUS - ACCOUNTS DEPARTMENT WORKFLOW SYSTEM
   Custom Stylesheet (style.css)
   ============================================================================ */

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

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Metric Card Watermark Curves (SmartCampus Design) */
.metric-card-curve {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.metric-card-curve::after {
  content: "";
  position: absolute;
  right: -25px;
  bottom: -35px;
  width: 140px;
  height: 140px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.metric-card-curve::before {
  content: "";
  position: absolute;
  top: -20px;
  right: 20px;
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* Urgent Pending Highlight - Exact Visual Match to Reference */
.urgent-row-active {
  background-color: #fee2e2 !important;
  border-left: 5px solid #ef4444 !important;
  color: #991b1b !important;
}

.urgent-row-active td {
  background-color: #fee2e2 !important;
}

.urgent-row-active .task-title-text {
  color: #991b1b !important;
  font-weight: 700 !important;
}

body.theme-dark .urgent-row-active,
body.theme-dark .urgent-row-active td {
  background-color: rgba(159, 18, 57, 0.25) !important;
  color: #fecdd3 !important;
}

body.theme-dark .urgent-row-active .task-title-text {
  color: #ffe4e6 !important;
}

/* Completed Strikethrough Effect */
.completed-row-strikethrough .task-title-text {
  text-decoration: line-through;
  color: #8b5cf6;
  opacity: 0.85;
}

/* ================= 3 SOFT EYE-COMFORT LIGHT THEMES (ZERO DARK COLORS) ================= */
/* 1. Warm Linen (Soft Cream & Paper Linen - Anti-Glare Day Mode) */
:root, body.theme-white {
  --bg-page: #f5eedf;
  --bg-container: #fcf9f2;
  --bg-header: #fcf9f2;
  --bg-subtle: #efe4cf;
  --bg-input: #ffffff;
  --border-main: #ded0b6;
  --border-subtle: #eae0cb;
  --text-main: #2a241f;
  --text-muted: #786d5e;
  --table-header: #f2e7d3;
  --table-row-bg: #fcf9f2;
  --table-hover: #f5edd8;
  --card-shadow: 0 15px 35px -10px rgba(68, 64, 60, 0.12);
}

/* 2. Cool Slate (Gentle Silver Gray - 0% harsh white, 0% dark) */
body.theme-offwhite {
  --bg-page: #e7ecf2;
  --bg-container: #f4f7fa;
  --bg-header: #f4f7fa;
  --bg-subtle: #dbe2ea;
  --bg-input: #ffffff;
  --border-main: #c4d0de;
  --border-subtle: #d3dde9;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --table-header: #e2e8f0;
  --table-row-bg: #f4f7fa;
  --table-hover: #e8eef5;
  --card-shadow: 0 15px 35px -10px rgba(30, 41, 59, 0.09);
}

/* 3. Twilight Theme (Gentle Night Slate - Balanced Low-Strain Night Mode) */
body.theme-dark {
  --bg-page: #151c28;
  --bg-container: #1b2434;
  --bg-header: #1b2434;
  --bg-subtle: #243046;
  --bg-input: #1f2a3d;
  --border-main: #31425e;
  --border-subtle: #243046;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --table-header: #202b3e;
  --table-row-bg: #1b2434;
  --table-hover: #232f44;
  --card-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.45);
}

/* Dynamic Theme Rules */
body {
  background-color: var(--bg-page) !important;
  color: var(--text-main) !important;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.theme-container {
  background-color: var(--bg-container) !important;
  border-color: var(--border-main) !important;
  color: var(--text-main) !important;
  box-shadow: var(--card-shadow) !important;
}

.theme-header {
  background-color: var(--bg-header) !important;
  border-color: var(--border-main) !important;
}

.theme-subtle {
  background-color: var(--bg-subtle) !important;
  border-color: var(--border-main) !important;
  color: var(--text-main) !important;
}

.theme-input {
  background-color: var(--bg-input) !important;
  border-color: var(--border-main) !important;
  color: var(--text-main) !important;
}

.theme-text {
  color: var(--text-main) !important;
}

.theme-text-muted {
  color: var(--text-muted) !important;
}

.theme-border {
  border-color: var(--border-main) !important;
}

.theme-table {
  background-color: var(--table-row-bg) !important;
  border-color: var(--border-main) !important;
}

.theme-table thead tr {
  background-color: var(--table-header) !important;
  border-color: var(--border-main) !important;
  color: var(--text-main) !important;
}

.theme-table tbody tr {
  background-color: var(--table-row-bg) !important;
  border-color: var(--border-subtle) !important;
}

.theme-table tbody tr:hover {
  background-color: var(--table-hover) !important;
}

/* ================= LIGHT THEME UTILITY COLOR OVERRIDES ================= */
/* 2. Cool Slate (theme-offwhite) Utility Overrides */
body.theme-offwhite .text-slate-900,
body.theme-offwhite .text-slate-800,
body.theme-offwhite .text-slate-700 {
  color: #1e293b !important;
}

body.theme-offwhite .text-slate-600,
body.theme-offwhite .text-slate-500 {
  color: #64748b !important;
}

body.theme-offwhite .bg-white {
  background-color: #f4f7fa !important;
}

body.theme-offwhite .bg-slate-50,
body.theme-offwhite .bg-slate-100 {
  background-color: #e2e8f0 !important;
}

body.theme-offwhite .border-slate-100,
body.theme-offwhite .border-slate-200,
body.theme-offwhite .border-slate-300 {
  border-color: #c4d0de !important;
}

body.theme-offwhite #taskTableBody tr {
  background-color: #f4f7fa !important;
  border-bottom: 1px solid #dbe2ea !important;
}

body.theme-offwhite #taskTableBody tr:hover {
  background-color: #e8eef5 !important;
}

body.theme-offwhite #taskTableBody td {
  color: #334155 !important;
}

body.theme-offwhite #taskTableBody td .task-title-text {
  color: #0f172a !important;
  font-weight: 600;
}

body.theme-offwhite #taskTableBody td .font-mono {
  color: #1e293b !important;
}

body.theme-offwhite #taskTableBody button:has(i[data-lucide="lock"]),
body.theme-offwhite button[title*="Password required"] {
  background-color: #e2e8f0 !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}

body.theme-offwhite #taskTableBody button:has(i[data-lucide="lock"]):hover,
body.theme-offwhite button[title*="Password required"]:hover {
  background-color: #cbd5e1 !important;
  color: #0f172a !important;
}

body.theme-offwhite #roleSwitcherContainer {
  background-color: #dbe2ea !important;
  border-color: #c4d0de !important;
}

body.theme-offwhite #themeMenu,
body.theme-offwhite #statusMenu,
body.theme-offwhite #dateMenu,
body.theme-offwhite #priorityMenu {
  background-color: #ffffff !important;
  border-color: #c4d0de !important;
  color: #1e293b !important;
}

/* 3. Twilight Theme (theme-dark) Utility Overrides */
body.theme-dark .text-slate-900,
body.theme-dark .text-slate-800,
body.theme-dark .text-slate-700 {
  color: #e2e8f0 !important;
}

body.theme-dark .text-slate-600,
body.theme-dark .text-slate-500 {
  color: #94a3b8 !important;
}

body.theme-dark .bg-white {
  background-color: #1b2434 !important;
}

body.theme-dark .bg-slate-50,
body.theme-dark .bg-slate-100 {
  background-color: #243046 !important;
}

body.theme-dark .border-slate-100,
body.theme-dark .border-slate-200,
body.theme-dark .border-slate-300 {
  border-color: #31425e !important;
}

body.theme-dark #taskTableBody tr {
  background-color: #1b2434 !important;
  border-bottom: 1px solid #243046 !important;
}

body.theme-dark #taskTableBody tr:hover {
  background-color: #212c3f !important;
}

body.theme-dark #taskTableBody td {
  color: #cbd5e1 !important;
}

body.theme-dark #taskTableBody td .task-title-text {
  color: #f1f5f9 !important;
  font-weight: 500;
}

body.theme-dark #taskTableBody td .font-mono {
  color: #e2e8f0 !important;
}

body.theme-dark #taskTableBody button:has(i[data-lucide="lock"]),
body.theme-dark button[title*="Password required"] {
  background-color: #243046 !important;
  border-color: #384b6b !important;
  color: #94a3b8 !important;
}

body.theme-dark #taskTableBody button:has(i[data-lucide="lock"]):hover,
body.theme-dark button[title*="Password required"]:hover {
  background-color: #2b3a54 !important;
  color: #f1f5f9 !important;
}

body.theme-dark #roleSwitcherContainer {
  background-color: #151c28 !important;
  border-color: #31425e !important;
}

body.theme-dark #themeMenu,
body.theme-dark #statusMenu,
body.theme-dark #dateMenu,
body.theme-dark #priorityMenu {
  background-color: #1b2434 !important;
  border-color: #31425e !important;
  color: #e2e8f0 !important;
}

/* 1. Warm Theme (theme-white) Utility Overrides */
body.theme-white #themeMenu,
body.theme-white #statusMenu,
body.theme-white #dateMenu,
body.theme-white #priorityMenu {
  background-color: #ffffff !important;
  border-color: #ded0b6 !important;
  color: #2a241f !important;
}

/* ================= AESTHETIC ANIMATIONS & DROPDOWNS ================= */
@keyframes dropdownPop {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.animate-dropdown-pop {
  animation: dropdownPop 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: top;
}

/* Custom Item Hover Transition */
.dropdown-item {
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown-item:hover {
  background-color: rgba(14, 165, 233, 0.08);
  transform: translateX(2px);
}

body.theme-dark .dropdown-item:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

body.theme-offwhite .dropdown-item:hover {
  background-color: rgba(180, 83, 9, 0.08);
}

/* Custom Calendar & Date Picker Indicator */
input[type="date"] {
  position: relative;
  font-family: inherit;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.75;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
  padding: 3px;
  border-radius: 6px;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  transform: scale(1.18);
  background-color: rgba(14, 165, 233, 0.15);
}

body.theme-dark input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.9) hue-rotate(180deg);
}

/* ============================================================================
   Physical Switch Key (iOS / Modern SaaS Design)
   ============================================================================ */
.switch-container {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
  padding: 3px 6px;
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.switch-container:hover {
  background-color: rgba(148, 163, 184, 0.12);
}

.switch-track {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 9999px;
  background-color: #cbd5e1;
  box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, 0.12);
  transition: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 2px;
}

body.theme-dark .switch-track {
  background-color: #334155;
  box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, 0.35);
}

.switch-track.active {
  background-color: #059669;
  box-shadow: inset 0 1.5px 3px rgba(0, 0, 0, 0.2), 0 0 10px rgba(5, 150, 105, 0.3);
}

.switch-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.18), 0 1px 2px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(0);
  transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
  flex-shrink: 0;
}

.switch-track.active .switch-thumb {
  transform: translateX(20px);
}

.switch-thumb-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  line-height: 0;
  pointer-events: none;
}

.switch-thumb-icon svg {
  width: 12px;
  height: 12px;
  display: block;
}

/* ============================================================================
   Custom SaaS Calendar Component (UI/UX Pro Max)
   ============================================================================ */
.custom-calendar {
  user-select: none;
  font-family: inherit;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 2px;
}

.calendar-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.calendar-nav-btn {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #64748b;
  border: 1px solid transparent;
}

.calendar-nav-btn:hover {
  background-color: rgba(148, 163, 184, 0.18);
  color: #0f172a;
  border-color: rgba(148, 163, 184, 0.2);
}

body.theme-dark .calendar-nav-btn {
  color: #94a3b8;
}

body.theme-dark .calendar-nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.1);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2.5px;
  text-align: center;
}

.calendar-weekday {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 3px 0 5px;
  letter-spacing: 0.04em;
}

body.theme-dark .calendar-weekday {
  color: #64748b;
}

.calendar-day-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: 1px solid transparent;
  color: inherit;
  background: transparent;
}

.calendar-day-btn:hover:not(.disabled):not(.selected) {
  background-color: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  transform: scale(1.06);
  z-index: 2;
}

body.theme-dark .calendar-day-btn:hover:not(.disabled):not(.selected) {
  background-color: rgba(255, 255, 255, 0.12);
  color: #38bdf8;
}

/* Today indicator */
.calendar-day-btn.is-today {
  border-color: #38bdf8;
  font-weight: 700;
}

.calendar-day-btn.is-today::after {
  content: "";
  position: absolute;
  bottom: 2px;
  width: 3.5px;
  height: 3.5px;
  border-radius: 50%;
  background-color: #0284c7;
}

body.theme-dark .calendar-day-btn.is-today::after {
  background-color: #38bdf8;
}

/* Selected state in Modal (Emerald) */
.calendar-day-btn.selected {
  background-color: #059669 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.35);
  transform: scale(1.05);
  z-index: 3;
}

/* Selected state in Filter (Sky Blue) */
.calendar-day-btn.selected.filter-mode {
  background-color: #0284c7 !important;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

.calendar-day-btn.selected::after {
  display: none;
}

/* Disabled (past dates / outside allowed range) */
.calendar-day-btn.disabled {
  opacity: 0.22;
  cursor: not-allowed;
  pointer-events: none;
  text-decoration: line-through;
}

/* Other month days */
.calendar-day-btn.other-month {
  opacity: 0.28;
}

/* ============================================================================
   Task Details & Remarks Inspector Styling
   ============================================================================ */
#taskRemarksModal textarea:focus {
  border-color: #10b981 !important;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

body.theme-dark #taskRemarksModal .bg-slate-50\/80 {
  background-color: rgba(30, 41, 59, 0.5) !important;
}

body.theme-dark #inspectorAssignerRemarksBox {
  background-color: rgba(120, 53, 15, 0.18) !important;
  border-color: rgba(217, 119, 6, 0.35) !important;
  color: #fef3c7 !important;
}

body.theme-dark #inspectorOfficerReadOnlyBox {
  background-color: rgba(6, 78, 59, 0.22) !important;
  border-color: rgba(16, 185, 129, 0.35) !important;
  color: #d1fae5 !important;
}

