/* Shadcn UI Style - CSS Variables */
:root {
  --background: 0 0% 100%;
  --foreground: 222.2 84% 4.9%;
  --card: 0 0% 100%;
  --card-foreground: 222.2 84% 4.9%;
  --popover: 0 0% 100%;
  --popover-foreground: 222.2 84% 4.9%;
  --primary: 221.2 83.2% 53.3%;
  --primary-foreground: 210 40% 98%;
  --secondary: 210 40% 96.1%;
  --secondary-foreground: 222.2 47.4% 11.2%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215.4 16.3% 46.9%;
  --accent: 210 40% 96.1%;
  --accent-foreground: 222.2 47.4% 11.2%;
  --destructive: 0 84.2% 60.2%;
  --destructive-foreground: 210 40% 98%;
  --border: 214.3 31.8% 91.4%;
  --input: 214.3 31.8% 91.4%;
  --ring: 221.2 83.2% 53.3%;
  --radius: 0.5rem;
  --success: 142.1 76.2% 36.3%;
  --success-foreground: 355.7 100% 97.3%;
  --warning: 38.7 92% 50%;
  --warning-foreground: 26 83.3% 14.1%;
}

.dark {
  --background: 222.2 84% 4.9%;
  --foreground: 210 40% 98%;
  --card: 222.2 84% 4.9%;
  --card-foreground: 210 40% 98%;
  --popover: 222.2 84% 4.9%;
  --popover-foreground: 210 40% 98%;
  --primary: 217.2 91.2% 59.8%;
  --primary-foreground: 222.2 47.4% 11.2%;
  --secondary: 217.2 32.6% 17.5%;
  --secondary-foreground: 210 40% 98%;
  --muted: 217.2 32.6% 17.5%;
  --muted-foreground: 215 20.2% 65.1%;
  --accent: 217.2 32.6% 17.5%;
  --accent-foreground: 210 40% 98%;
  --destructive: 0 62.8% 30.6%;
  --destructive-foreground: 210 40% 98%;
  --border: 217.2 32.6% 17.5%;
  --input: 217.2 32.6% 17.5%;
  --ring: 224.3 76.3% 94.9%;
  --success: 142.1 70.6% 45.3%;
  --success-foreground: 144.9 80.4% 10%;
  --warning: 38.7 92% 50%;
  --warning-foreground: 26 83.3% 14.1%;
}

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

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-optical-sizing: auto;
  font-weight: 400;
  font-style: normal;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  min-height: 100vh;
  padding: 1.5rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

/* Header */
header {
  background-color: hsl(var(--card));
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  color: hsl(var(--foreground));
  font-size: 1.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  letter-spacing: -0.025em;
}

.subtitle {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  font-weight: 400;
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

/* Card */
.card {
  background-color: hsl(var(--card));
  padding: 1.5rem;
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid hsl(var(--border));
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  margin-bottom: 1.5rem;
}

.card h2 {
  color: hsl(var(--foreground));
  margin-bottom: 1.25rem;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.card h3 {
  color: hsl(var(--foreground));
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
}

.form-control {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  font-size: 0.875rem;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  transition: all 0.2s;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.form-control::placeholder {
  color: hsl(var(--muted-foreground));
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

textarea.form-control {
  resize: vertical;
  font-family: inherit;
  min-height: 80px;
}

input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  border: 1px solid hsl(var(--input));
  border-radius: calc(var(--radius) / 2);
  accent-color: hsl(var(--primary));
  cursor: pointer;
}

input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  line-height: 1.5;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--ring));
}

.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.btn-primary:hover {
  background-color: hsl(var(--primary) / 0.9);
}

.btn-primary:active {
  background-color: hsl(var(--primary) / 0.8);
}

.btn-secondary {
  background-color: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
}

.btn-secondary:hover {
  background-color: hsl(var(--secondary) / 0.8);
}

.btn-success {
  background-color: hsl(var(--success));
  color: hsl(var(--success-foreground));
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-success:hover {
  background-color: hsl(var(--success) / 0.9);
}

.btn-danger {
  background-color: hsl(var(--destructive));
  color: hsl(var(--destructive-foreground));
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-danger:hover {
  background-color: hsl(var(--destructive) / 0.9);
}

.btn-warning {
  background-color: hsl(var(--warning));
  color: hsl(var(--warning-foreground));
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-warning:hover {
  background-color: hsl(var(--warning) / 0.9);
}

.button-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin: 1rem 0;
  border: 1px solid;
}

.alert-success {
  background-color: hsl(var(--success) / 0.1);
  color: hsl(var(--success));
  border-color: hsl(var(--success) / 0.3);
}

.alert-error {
  background-color: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
  border-color: hsl(var(--destructive) / 0.3);
}

.info-text {
  color: hsl(var(--muted-foreground));
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* Calendar Navigation */
.calendar-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.5rem 0;
  gap: 1rem;
}

.week-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.week-label {
  font-weight: 600;
  font-size: 1rem;
  color: hsl(var(--foreground));
}

.btn-nav {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.btn-nav:hover:not(:disabled) {
  background-color: hsl(var(--primary) / 0.9);
  transform: scale(1.05);
}

.btn-nav:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--ring));
}

.btn-nav:disabled {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  cursor: not-allowed;
  opacity: 0.5;
}

.nav-arrow {
  line-height: 1;
}

.btn-current-week {
  padding: 0.375rem 1rem;
  background-color: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--foreground));
  border-radius: 9999px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-current-week:hover:not(:disabled) {
  background-color: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.btn-current-week:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--ring));
}

.btn-current-week:disabled {
  border-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  cursor: not-allowed;
  opacity: 0.5;
}

/* Calendar Week View */
.calendar-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  margin-top: 1.5rem;
  position: relative;
}

.calendar-day {
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius);
  text-align: center;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid hsl(var(--border));
  background-color: hsl(var(--card));
  position: relative;
  min-height: 85px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.calendar-day .day-name {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.calendar-day .day-number {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0.25rem 0;
  color: hsl(var(--foreground));
}

.calendar-day .day-month {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-top: 0.125rem;
}

.calendar-day:hover:not(.future):not(.selected):not(.locked) {
  /* background-color: hsl(var(--accent));
  border-color: hsl(var(--ring)); */
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.calendar-day.selected:hover {
  cursor: pointer;
}

.calendar-day.submitted {
  background-color: hsl(var(--success) / 0.1);
  border-color: hsl(var(--success));
  color: hsl(var(--success));
}

.calendar-day.submitted .day-name,
.calendar-day.submitted .day-month {
  color: hsl(var(--success));
}

.calendar-day.submitted .day-number {
  color: hsl(var(--success));
}

.calendar-day.missing {
  background-color: hsl(var(--warning) / 0.1);
  border-color: hsl(var(--warning));
  color: hsl(var(--warning-foreground));
}

.calendar-day.missing .day-name,
.calendar-day.missing .day-month {
  color: hsl(var(--warning-foreground));
}

.calendar-day.missing .day-number {
  color: hsl(var(--warning-foreground));
}

.calendar-day.future {
  background-color: hsl(var(--muted) / 0.5);
  color: hsl(var(--muted-foreground));
  cursor: not-allowed;
  opacity: 0.6;
}

.calendar-day.future .day-name,
.calendar-day.future .day-month,
.calendar-day.future .day-number {
  color: hsl(var(--muted-foreground));
}

.calendar-day.future:hover {
  transform: none;
  box-shadow: none;
  background-color: hsl(var(--muted) / 0.5);
}

.calendar-day.locked {
  background-color: hsl(var(--muted) / 0.5);
  color: hsl(var(--muted-foreground));
  cursor: not-allowed;
  opacity: 0.6;
  position: relative;
}

.calendar-day.locked::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.1) 2px,
    rgba(0, 0, 0, 0.1) 4px
  );
  pointer-events: none;
}

.calendar-day.locked .day-name,
.calendar-day.locked .day-month,
.calendar-day.locked .day-number {
  color: hsl(var(--muted-foreground));
  opacity: 0.7;
}

.calendar-day.locked:hover {
  transform: none;
  box-shadow: none;
  background-color: hsl(var(--muted) / 0.5);
}

/* .calendar-day.today {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.2);
} */

/* .calendar-day.today::before {
  content: '●';
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  color: rgb(211, 35, 211);
  font-size: 0.75rem;
} */

.calendar-day.selected {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.2), 0 4px 6px -1px rgb(0 0 0 / 0.1);
  background-color: hsl(var(--primary) / 0.1);
  transform: scale(1.02);
  z-index: 10;
}

/* .calendar-day.selected::after {
  content: '✓';
  position: absolute;
  top: 0.25rem;
  left: 0.25rem;
  color: hsl(var(--primary));
  font-size: 1rem;
  font-weight: 600;
} */

/* Selected + Submitted: Green styling */
.calendar-day.selected.submitted {
  border-color: hsl(var(--success));
  box-shadow: 0 0 0 3px hsl(var(--success) / 0.25), 0 4px 6px -1px rgb(0 0 0 / 0.1);
  background-color: hsl(var(--success) / 0.15);
}

.calendar-day.selected.submitted::after {
  color: hsl(var(--success));
}

/* Selected + Missing: Orange/Warning styling */
.calendar-day.selected.missing {
  border-color: hsl(var(--warning));
  box-shadow: 0 0 0 3px hsl(var(--warning) / 0.35), 0 4px 6px -1px rgb(0 0 0 / 0.1);
  background-color: hsl(var(--warning) / 0.2);
}

.calendar-day.selected.missing::after {
  color: hsl(38.7 92% 35%);
}

/* Calculation Results */
.calculation-results {
  background-color: hsl(var(--muted) / 0.5);
  padding: 1.25rem;
  border-radius: var(--radius);
  margin: 1.25rem 0;
  border: 1px solid hsl(var(--border));
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.result-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem;
  background-color: hsl(var(--background));
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
}

.result-item.total {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  border-color: hsl(var(--primary));
}

.result-label {
  font-weight: 500;
  font-size: 0.875rem;
}

.result-value {
  font-size: 1rem;
  font-weight: 600;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid hsl(var(--border));
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  background-color: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  cursor: pointer;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: all 0.2s;
  font-size: 0.875rem;
  margin-bottom: -1px;
}

.tab-btn.active {
  color: hsl(var(--foreground));
  border-bottom-color: hsl(var(--primary));
}

.tab-btn:hover:not(.active) {
  color: hsl(var(--foreground));
  background-color: hsl(var(--accent));
}

.tab-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--ring));
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Sub-tabs (within main tabs) */
.sub-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  margin-top: 0.5rem;
  padding: 0.25rem;
  background-color: hsl(var(--muted) / 0.5);
  border-radius: var(--radius);
  width: fit-content;
}

.sub-tab-btn {
  padding: 0.5rem 1rem;
  background-color: transparent;
  border: none;
  border-radius: calc(var(--radius) - 0.125rem);
  cursor: pointer;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  transition: all 0.2s;
  font-size: 0.875rem;
}

.sub-tab-btn.active {
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sub-tab-btn:hover:not(.active) {
  color: hsl(var(--foreground));
  background-color: hsl(var(--background) / 0.5);
}

.sub-tab-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(var(--ring));
}

.sub-tab-content {
  display: none;
}

.sub-tab-content.active {
  display: block;
}

/* Data Table */
.data-table {
  overflow-x: auto;
  margin-top: 1.5rem;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  background-color: hsl(var(--card));
}

table th,
table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid hsl(var(--border));
}

table th {
  background-color: hsl(var(--muted) / 0.5);
  font-weight: 600;
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

table tr:hover {
  background-color: hsl(var(--accent) / 0.5);
}

/* Timesheet Cards */
.timesheet-card {
  background-color: hsl(var(--muted) / 0.3);
  padding: 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  border-left: 3px solid hsl(var(--primary));
  border: 1px solid hsl(var(--border));
}

.timesheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.timesheet-header h4 {
  color: hsl(var(--foreground));
  margin: 0;
  font-weight: 600;
  font-size: 1.125rem;
}

.timesheet-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
}

.detail-label {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.detail-value {
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  font-weight: 500;
}

.timesheet-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(0 0 0 / 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background-color: hsl(var(--card));
  padding: 1.5rem;
  border-radius: calc(var(--radius) + 4px);
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  border: 1px solid hsl(var(--border));
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: all 0.2s;
}

.modal-close:hover {
  color: hsl(var(--foreground));
  background-color: hsl(var(--accent));
}

/* Form Section */
.form-section {
  background-color: hsl(var(--muted) / 0.3);
  padding: 1.25rem;
  border-radius: var(--radius);
  margin: 1.25rem 0;
  border: 1px solid hsl(var(--border));
}

/* Loading State */
.loading {
  text-align: center;
  padding: 2.5rem;
  color: hsl(var(--muted-foreground));
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid hsl(var(--muted));
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.spinner-lg {
  width: 2rem;
  height: 2rem;
  border-width: 3px;
}

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

/* Loading overlay for sections */
.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3rem 2rem;
  color: hsl(var(--muted-foreground));
  min-height: 120px;
  text-align: center;
}

.loading-overlay .spinner {
  border-top-color: hsl(var(--primary));
}

.loading-text {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

/* Calendar week container needs min-height when loading */
.calendar-week:has(.loading-overlay) {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Button loading state - shows "Submitting..." with spinner */
.btn.loading {
  pointer-events: none;
  opacity: 0.9;
}

.btn.loading .btn-spinner {
  display: inline-block;
  width: 0.875rem;
  height: 0.875rem;
  border: 2px solid hsl(var(--primary-foreground) / 0.3);
  border-top-color: hsl(var(--primary-foreground));
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* Select/dropdown loading state */
.form-control.loading {
  background-image: none;
  color: hsl(var(--muted-foreground));
  pointer-events: none;
}

/* Inline spinner for dropdowns */
.select-loading-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.select-loading-wrapper .spinner {
  position: absolute;
  right: 2.5rem;
  pointer-events: none;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 2.5rem;
  color: hsl(var(--muted-foreground));
}

.empty-state p {
  font-size: 1rem;
}

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid;
}

.status-pending {
  background-color: hsl(var(--warning) / 0.1);
  color: hsl(var(--warning-foreground));
  border-color: hsl(var(--warning) / 0.3);
}

.status-approved {
  background-color: hsl(var(--success) / 0.1);
  color: hsl(var(--success));
  border-color: hsl(var(--success) / 0.3);
}

.status-active {
  background-color: hsl(var(--primary) / 0.1);
  color: hsl(var(--primary));
  border-color: hsl(var(--primary) / 0.3);
}

.status-inactive {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border-color: hsl(var(--border));
}

.status-approved {
  background-color: hsl(var(--success) / 0.1);
  color: hsl(var(--success));
  border-color: hsl(var(--success) / 0.3);
}

/* Notification Popup */
.notification-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(0 0 0 / 0.5);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
}

.notification-overlay.show {
  display: flex;
}

.notification-popup {
  background-color: hsl(var(--card));
  padding: 2rem;
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  max-width: 500px;
  width: 90%;
  text-align: center;
  animation: slideDown 0.3s ease;
  border: 1px solid hsl(var(--border));
}

.notification-popup.success {
  border-top: 3px solid hsl(var(--success));
}

.notification-popup.error {
  border-top: 3px solid hsl(var(--destructive));
}

.notification-popup.warning {
  border-top: 3px solid hsl(var(--warning));
}

.notification-popup.info {
  border-top: 3px solid hsl(var(--primary));
}

.notification-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.notification-popup.success .notification-icon {
  color: hsl(var(--success));
}

.notification-popup.error .notification-icon {
  color: hsl(var(--destructive));
}

.notification-popup.warning .notification-icon {
  color: hsl(var(--warning));
}

.notification-popup.info .notification-icon {
  color: hsl(var(--primary));
}

.notification-message {
  font-size: 1rem;
  color: hsl(var(--foreground));
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.notification-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.notification-buttons .btn {
  min-width: 100px;
}

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

@keyframes slideDown {
  from {
    transform: translateY(-1rem);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 3000;
  pointer-events: none;
}

.toast {
  background-color: hsl(var(--card));
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  margin-bottom: 0.5rem;
  min-width: 300px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s;
  pointer-events: all;
  border-left: 3px solid hsl(var(--primary));
  border: 1px solid hsl(var(--border));
}

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

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

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

.toast-icon {
  font-size: 1.25rem;
}

.toast.success .toast-icon {
  color: hsl(var(--success));
}

.toast.error .toast-icon {
  color: hsl(var(--destructive));
}

.toast.warning .toast-icon {
  color: hsl(var(--warning));
}

.toast-message {
  flex: 1;
  color: hsl(var(--foreground));
  font-size: 0.875rem;
}

/* Submitted Notice */
.submitted-notice {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem;
  background-color: hsl(var(--success) / 0.08);
  border: 2px solid hsl(var(--success) / 0.3);
  border-radius: var(--radius);
  text-align: left;
}

.submitted-notice-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  background-color: hsl(var(--success));
  color: white;
  border-radius: 50%;
  font-size: 1.75rem;
  font-weight: 600;
  flex-shrink: 0;
}

.submitted-notice-text {
  flex: 1;
}

.submitted-notice-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0.375rem;
}

.submitted-notice-subtitle {
  font-size: 0.9375rem;
  color: hsl(var(--muted-foreground));
  margin: 0;
  line-height: 1.5;
}

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

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(400px);
  }
}

/* Hours Category Styles */
.hours-category {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: hsl(var(--muted) / 0.3);
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.category-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: hsl(var(--foreground));
}

.category-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.category-icon.complete {
  color: hsl(var(--success));
}

.category-hours {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9375rem;
  font-weight: 600;
}

.allocated-hours {
  color: hsl(var(--primary));
}

.hours-separator {
  color: hsl(var(--muted-foreground));
}

.available-hours {
  color: hsl(var(--foreground));
}

.jobs-list {
  margin: 0.75rem 0;
}

.job-allocation {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr auto auto;
  gap: 0.5rem;
  align-items: start;
  padding: 0.75rem;
  background-color: hsl(var(--background));
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  margin-bottom: 0.5rem;
  transition: all 0.3s;
}

.job-allocation.confirmed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background-color: hsl(var(--success) / 0.05);
  border-color: hsl(var(--success) / 0.3);
}

.job-allocation.confirmed .job-allocation-field {
  display: none;
}

.job-allocation.confirmed > .btn-confirm-job {
  display: none;
}

.job-allocation.confirmed > .btn-remove-job-inline {
  display: none;
}

.job-allocation-summary {
  display: none;
  flex: 1;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  gap: 0.75rem;
  align-items: center;
}

.job-allocation.confirmed .job-allocation-summary {
  display: flex;
}

.job-summary-icon {
  color: hsl(var(--success));
  font-size: 1rem;
  font-weight: 600;
}

.job-summary-name {
  font-weight: 600;
  color: hsl(var(--foreground));
}

.job-summary-hours {
  color: hsl(var(--primary));
  font-weight: 600;
}

.job-summary-description {
  color: hsl(var(--muted-foreground));
  font-style: italic;
}

.job-summary-separator {
  color: hsl(var(--muted-foreground));
}

.job-allocation-field {
  display: flex;
  flex-direction: column;
}

.job-allocation-field label {
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  margin-bottom: 0.25rem;
}

.job-allocation-field select,
.job-allocation-field input {
  padding: 0.375rem 0.5rem;
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  font-size: 0.875rem;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  transition: all 0.2s;
}

.job-allocation-field select:focus,
.job-allocation-field input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

.btn-confirm-job {
  background-color: hsl(var(--success));
  color: white;
  border: none;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 1.125rem;
  height: fit-content;
  font-weight: 600;
}

.btn-confirm-job:hover {
  background-color: hsl(var(--success) / 0.9);
}

.btn-confirm-job:disabled {
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-edit-job {
  background-color: transparent;
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit-job:hover {
  background-color: hsl(var(--accent));
  border-color: hsl(var(--primary));
  color: hsl(var(--primary));
}

.btn-remove-job-inline {
  background-color: transparent;
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
  padding: 0.375rem 0.5rem;
  font-size: 0.75rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 1.125rem;
  height: fit-content;
}

.job-allocation.confirmed .btn-remove-job-inline {
  margin-top: 0;
  padding: 0.25rem 0.5rem;
}

.btn-remove-job-inline:hover {
  background-color: hsl(var(--destructive) / 0.1);
  border-color: hsl(var(--destructive));
  color: hsl(var(--destructive));
}

.job-actions {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.btn-add-job {
  background-color: transparent;
  color: hsl(var(--primary));
  border: 1px dashed hsl(var(--border));
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  font-weight: 500;
}

.btn-add-job:hover:not(:disabled) {
  background-color: hsl(var(--primary) / 0.1);
  border-color: hsl(var(--primary));
  border-style: solid;
}

.btn-add-job:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border-color: hsl(var(--border));
}

.hours-total {
  margin-top: 1.5rem;
  padding: 1rem;
  background-color: hsl(var(--primary) / 0.1);
  border-radius: var(--radius);
  border: 2px solid hsl(var(--primary));
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hours-total.complete {
  background-color: hsl(var(--success) / 0.1);
  border-color: hsl(var(--success));
}

.total-label {
  font-weight: 600;
  font-size: 1.125rem;
  color: hsl(var(--foreground));
}

.total-hours-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.5rem;
}

.total-allocated {
  color: hsl(var(--primary));
}

.hours-total.complete .total-allocated {
  color: hsl(var(--success));
}

.total-separator {
  color: hsl(var(--muted-foreground));
  font-weight: 600;
}

.total-available {
  color: hsl(var(--foreground));
}

.category-over-allocated .category-hours {
  color: hsl(var(--destructive));
}

.category-over-allocated {
  border-color: hsl(var(--destructive));
  background-color: hsl(var(--destructive) / 0.05);
}

/* Responsive */
@media (max-width: 768px) {
  body {
    padding: 1rem;
  }

  header {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem;
  }

  .header-actions {
    margin-top: 1rem;
    width: 100%;
    justify-content: center;
  }

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

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

  .job-allocation {
    grid-template-columns: 1fr;
  }

  .job-allocation.confirmed {
    flex-direction: column;
    align-items: flex-start;
  }

  .job-allocation.confirmed .job-allocation-summary {
    flex-wrap: wrap;
  }

  .job-allocation.confirmed .job-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 0.5rem;
  }

  .btn-remove-job-inline {
    margin-top: 0.5rem;
  }

  .btn-confirm-job {
    margin-top: 0.5rem;
  }

  .category-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .category-hours {
    align-self: flex-end;
  }

  .hours-total {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .total-hours-display {
    font-size: 1.25rem;
  }

  .tabs {
    flex-direction: column;
    border-bottom: none;
  }

  .tab-btn {
    border-bottom: none;
    border-left: 2px solid transparent;
    border-radius: var(--radius);
    margin-bottom: 0.25rem;
  }

  .tab-btn.active {
    border-left-color: hsl(var(--primary));
    border-bottom-color: transparent;
  }

  .modal-content {
    width: 95%;
    padding: 1.25rem;
  }
  
  /* Mobile Calendar Optimizations */
  .calendar-week {
    gap: 0.25rem;
  }
  
  .calendar-day {
    padding: 0.5rem 0.25rem;
    min-height: 70px;
  }
  
  .calendar-day .day-name {
    font-size: 0.65rem;
  }
  
  .calendar-day .day-number {
    font-size: 1.25rem;
  }
  
  .calendar-day .day-month {
    font-size: 0.7rem;
  }
  
  .week-label {
    font-size: 0.875rem;
  }
  
  .btn-nav {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.125rem;
  }
  
  .btn-current-week {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
  }
  
  .calendar-navigation {
    gap: 0.5rem;
  }
}

/* =============================================================================
   AUDIT LOG STYLES
   ============================================================================= */

.audit-filters {
  margin-bottom: 1rem;
}

/* Compact single-row audit log entries */
.audit-log-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
  cursor: pointer;
  transition: background-color 0.15s;
}

.audit-log-row:last-child {
  border-bottom: none;
}

.audit-log-row:hover {
  background-color: hsl(var(--muted) / 0.5);
}

.audit-row-icon {
  font-size: 1rem;
  flex-shrink: 0;
  width: 1.5rem;
  text-align: center;
}

.audit-row-desc {
  flex: 1;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audit-row-desc strong {
  font-weight: 600;
  color: hsl(var(--primary));
}

.audit-row-time {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
  white-space: nowrap;
}

.audit-load-more {
  text-align: center;
  padding: 1rem;
  border-top: 1px solid hsl(var(--border));
}

/* Audit Detail Modal/Popup */
.audit-detail-popup {
  background-color: hsl(var(--card));
  padding: 1.5rem;
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border: 1px solid hsl(var(--border));
}

.audit-detail-modal h3 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: hsl(var(--foreground));
}

.audit-detail-section {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background-color: hsl(var(--muted) / 0.3);
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.6;
}

.audit-detail-section strong {
  color: hsl(var(--foreground));
}

.audit-details-json {
  background-color: hsl(var(--background));
  padding: 0.75rem;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border));
  font-size: 0.75rem;
  font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 300px;
  overflow-y: auto;
  color: hsl(var(--foreground));
  margin-top: 0.5rem;
}

/* Extra small mobile devices */
@media (max-width: 480px) {
  .calendar-day {
    padding: 0.375rem 0.125rem;
    min-height: 60px;
  }
  
  .calendar-day .day-name {
    font-size: 0.6rem;
    margin-bottom: 0.125rem;
  }
  
  .calendar-day .day-number {
    font-size: 1.125rem;
    margin: 0.125rem 0;
  }
  
  .calendar-day .day-month {
    font-size: 0.65rem;
    margin-top: 0.0625rem;
  }
  
  .calendar-week {
    gap: 0.125rem;
  }
  
  .week-label {
    font-size: 0.75rem;
  }
  
  .btn-nav {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1rem;
  }
  
  /* Mobile audit log */
  .audit-log-row {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }
  
  .audit-row-desc {
    order: 2;
    flex-basis: 100%;
    white-space: normal;
    margin-top: 0.25rem;
  }
  
  .audit-row-time {
    order: 1;
    margin-left: auto;
  }
  
  .audit-detail-popup {
    width: 95%;
    padding: 1rem;
  }
}
