/* ===========================
   TIMPIN - Custom Styles
   =========================== */

:root {
  --timpin-primary: #4F46E5;
  --timpin-primary-hover: #4338CA;
  --timpin-secondary: #6B7280;
  --timpin-success: #10B981;
  --timpin-danger: #EF4444;
  --timpin-warning: #F59E0B;
  --timpin-info: #3B82F6;
  --sidebar-width: 260px;
  --topbar-height: 60px;
  --transition: 0.2s ease;
}

/* ===========================
   Layout
   =========================== */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 0.9rem;
}

.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ===========================
   Sidebar
   =========================== */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  flex-shrink: 0;
  background: var(--bs-body-bg);
  border-right: 1px solid var(--bs-border-color);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-brand {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--bs-border-color);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.sidebar-logo {
  max-height: 36px;
  width: auto;
  max-width: 160px;
}

.sidebar-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bs-secondary-color);
  padding: 1.25rem 1.5rem 0.5rem;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.5rem;
  color: var(--bs-body-color);
  border-radius: 0;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}

.sidebar-nav .nav-link i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  color: var(--bs-secondary-color);
  transition: color var(--transition);
  flex-shrink: 0;
}

.sidebar-nav .nav-link:hover {
  background: var(--bs-tertiary-bg);
  color: var(--timpin-primary);
}

.sidebar-nav .nav-link:hover i {
  color: var(--timpin-primary);
}

.sidebar-nav .nav-link.active {
  background: rgba(79, 70, 229, 0.1);
  color: var(--timpin-primary);
}

.sidebar-nav .nav-link.active i {
  color: var(--timpin-primary);
}

[data-bs-theme="dark"] .sidebar-nav .nav-link.active {
  background: rgba(79, 70, 229, 0.2);
}

[data-bs-theme="dark"] .sidebar-logo,
[data-bs-theme="dark"] .auth-logo-img {
  filter: brightness(0.9) invert(0.05);
}

/* ===========================
   Main content
   =========================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: var(--topbar-height);
  background: var(--bs-body-bg);
  border-bottom: 1px solid var(--bs-border-color);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 99;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-content {
  padding: 1.5rem;
  flex: 1;
}

/* ===========================
   Page header
   =========================== */
.page-header {
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0;
  letter-spacing: -0.3px;
}

.page-subtitle {
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* ===========================
   Cards
   =========================== */
.card {
  border: 1px solid var(--bs-border-color);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid var(--bs-border-color);
  padding: 1rem 1.25rem;
  font-weight: 600;
}

/* ===========================
   Stats cards
   =========================== */
.stat-card {
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid var(--bs-border-color);
  background: var(--bs-body-bg);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
  font-weight: 500;
}

/* ===========================
   Clock button
   =========================== */
.clock-btn-wrapper {
  text-align: center;
  padding: 2rem;
}

.clock-btn {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  font-size: 1rem;
  font-weight: 600;
  color: white;
  text-decoration: none;
}

.clock-btn:hover {
  transform: scale(1.05);
}

.clock-btn:active {
  transform: scale(0.97);
}

.clock-btn-in {
  background: linear-gradient(135deg, #10B981, #059669);
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4);
}

.clock-btn-out {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  box-shadow: 0 8px 32px rgba(239, 68, 68, 0.4);
}

.clock-btn i {
  font-size: 2rem;
}

.clock-btn .clock-btn-label {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.clock-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.875rem;
  font-weight: 600;
}

.clock-status-in {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.clock-status-out {
  background: rgba(107, 114, 128, 0.1);
  color: var(--bs-secondary-color);
}

/* ===========================
   Auth pages
   =========================== */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bs-body-bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo-img {
  max-width: 200px;
  height: auto;
}

/* ===========================
   Tables
   =========================== */
.table-responsive {
  border-radius: 8px;
}

.table th {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--bs-secondary-color);
  border-bottom-width: 1px;
}

/* ===========================
   Badges for status
   =========================== */
.badge-pending { background: rgba(245, 158, 11, 0.15); color: #D97706; }
.badge-approved { background: rgba(16, 185, 129, 0.15); color: #059669; }
.badge-rejected { background: rgba(239, 68, 68, 0.15); color: #DC2626; }
.badge-cancelled { background: rgba(107, 114, 128, 0.15); color: #6B7280; }

/* ===========================
   Work mode badges
   =========================== */
.badge-office { background: rgba(79, 70, 229, 0.1); color: var(--timpin-primary); }
.badge-remote { background: rgba(16, 185, 129, 0.1); color: #059669; }

/* ===========================
   Theme toggle
   =========================== */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--bs-border-color);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--bs-body-color);
  transition: background var(--transition);
}

.theme-toggle:hover {
  background: var(--bs-tertiary-bg);
}

/* ===========================
   Calendar
   =========================== */
#calendar {
  min-height: 600px;
}

.fc .fc-button-primary {
  background-color: var(--timpin-primary);
  border-color: var(--timpin-primary);
}

.fc .fc-button-primary:hover {
  background-color: var(--timpin-primary-hover);
  border-color: var(--timpin-primary-hover);
}

.fc-day-today {
  background: rgba(79, 70, 229, 0.05) !important;
}

/* ===========================
   Alerts
   =========================== */
.alert {
  border-radius: 10px;
  border: none;
  font-size: 0.875rem;
}

/* ===========================
   Buttons
   =========================== */
.btn-primary {
  background: var(--timpin-primary);
  border-color: var(--timpin-primary);
}

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

/* ===========================
   Sidebar toggle (mobile)
   =========================== */
.sidebar-toggle {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--bs-border-color);
  background: transparent;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--bs-body-color);
}

/* ===========================
   Responsive
   =========================== */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

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

  .sidebar-toggle {
    display: flex;
  }

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

  .sidebar-backdrop.show {
    display: block;
  }
}

/* ===========================
   Utilities
   =========================== */
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cursor-pointer { cursor: pointer; }

.rounded-xl { border-radius: 12px; }

.border-dashed { border-style: dashed !important; }

/* scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bs-border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--bs-secondary-color); }
