/* ============================================
   HRMS Dark Theme - Complete Stylesheet
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg: #0a0a12;
  --bg-card: #12121e;
  --bg-input: #0e0e1a;
  --surface: #1a1a2e;
  --border: #252540;
  --border-focus: #6c5ce7;
  --text: #e8e8f0;
  --text-dim: #8888a8;
  --text-muted: #5a5a7a;
  --accent: #6c5ce7;
  --accent-glow: rgba(108, 92, 231, 0.3);
  --accent2: #00cec9;
  --success: #00b894;
  --danger: #ff6b6b;
  --warning: #feca57;
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  --gradient: linear-gradient(135deg, #6c5ce7, #a855f7);
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 260px;
  --topbar-height: 64px;
}

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

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
  color: var(--accent2);
}

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

::selection {
  background: var(--accent);
  color: #fff;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

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

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

/* --- App Layout --- */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: rgba(18, 18, 30, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform var(--transition);
  overflow: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  min-height: 64px;
}

.sidebar-brand img,
.sidebar-brand svg {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.sidebar-brand .brand-text {
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

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

.sidebar-nav .nav-section {
  margin-bottom: 8px;
}

.sidebar-nav .nav-section-header {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 8px 12px 6px;
  user-select: none;
}

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
  overflow: hidden;
}

.sidebar-nav a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient);
  border-radius: 0 3px 3px 0;
  transform: scaleY(0);
  transition: transform var(--transition);
}

.sidebar-nav a:hover {
  color: var(--text);
  background: rgba(108, 92, 231, 0.08);
}

.sidebar-nav a.active {
  color: var(--text);
  background: rgba(108, 92, 231, 0.15);
  font-weight: 600;
}

.sidebar-nav a.active::before {
  transform: scaleY(1);
}

.sidebar-nav a .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-nav a.active .nav-icon {
  opacity: 1;
}

.sidebar-nav a .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.sidebar-user {
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-user .avatar {
  width: 36px;
  height: 36px;
  font-size: 0.85rem;
}

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

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

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

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

.main-content {
  flex: 1;
  padding: 28px;
}

/* --- Topbar --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 900;
  height: var(--topbar-height);
  background: rgba(10, 10, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

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

.topbar-left .page-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.topbar-left .breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.topbar-left .breadcrumb a {
  color: var(--text-dim);
}

.topbar-left .breadcrumb .separator {
  color: var(--text-muted);
}

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

.topbar-search {
  position: relative;
}

.topbar-search input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px 8px 36px;
  color: var(--text);
  font-size: 0.88rem;
  width: 220px;
  transition: all var(--transition);
}

.topbar-search input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
  width: 280px;
}

.topbar-search input::placeholder {
  color: var(--text-muted);
}

.topbar-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.topbar-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.topbar-btn:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-focus);
}

.topbar-btn .badge-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--bg);
}

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

.topbar-user:hover {
  background: var(--surface);
}

.topbar-user .user-name {
  font-weight: 600;
  font-size: 0.88rem;
}

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

.sidebar-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all var(--transition);
}

.sidebar-toggle:hover {
  background: var(--surface);
  color: var(--text);
}

/* --- Content Area --- */
.content-area {
  flex: 1;
  padding: 28px;
}

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

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

.page-header .page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.card:hover {
  border-color: rgba(108, 92, 231, 0.2);
}

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

.card-header h2,
.card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.card-body {
  padding: 24px;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(108, 92, 231, 0.3);
}

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

.stat-card .stat-icon.accent {
  background: rgba(108, 92, 231, 0.15);
  color: var(--accent);
}

.stat-card .stat-icon.success {
  background: rgba(0, 184, 148, 0.15);
  color: var(--success);
}

.stat-card .stat-icon.warning {
  background: rgba(254, 202, 87, 0.15);
  color: var(--warning);
}

.stat-card .stat-icon.danger {
  background: rgba(255, 107, 107, 0.15);
  color: var(--danger);
}

.stat-card .stat-icon.info {
  background: rgba(0, 206, 201, 0.15);
  color: var(--accent2);
}

.stat-card .stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-card .stat-label {
  font-size: 0.82rem;
  color: var(--text-dim);
}

.stat-card .stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 20px;
}

.stat-card .stat-change.up {
  background: rgba(0, 184, 148, 0.12);
  color: var(--success);
}

.stat-card .stat-change.down {
  background: rgba(255, 107, 107, 0.12);
  color: var(--danger);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

/* --- Tables --- */
.data-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table thead th {
  background: var(--surface);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.data-table tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

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

.data-table tbody tr:hover {
  background: rgba(108, 92, 231, 0.05);
}

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

.data-table .actions {
  display: flex;
  gap: 6px;
}

.data-table .actions .btn-icon {
  width: 32px;
  height: 32px;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

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

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

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

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

.form-group .form-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 4px;
}

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

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

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="tel"],
input[type="url"],
input[type="search"],
select,
textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--surface);
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238888a8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

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

.form-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

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

.form-check label {
  margin-bottom: 0;
  cursor: pointer;
}

.input-group {
  display: flex;
  align-items: stretch;
}

.input-group input {
  border-radius: 0;
  flex: 1;
}

.input-group input:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

.input-group input:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.88rem;
  white-space: nowrap;
}

.input-group-text:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

.input-group-text:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.form-inline {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.form-inline .form-group {
  margin-bottom: 0;
  flex: 1;
}

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

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

.btn-primary {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

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

.btn-success:hover {
  background: #00a381;
  transform: translateY(-1px);
}

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

.btn-danger:hover {
  background: #e55a5a;
  transform: translateY(-1px);
}

.btn-warning {
  background: var(--warning);
  color: #1a1a2e;
}

.btn-warning:hover {
  background: #e5b84c;
  transform: translateY(-1px);
}

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

.btn-outline:hover {
  background: var(--surface);
  border-color: var(--text-muted);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-dim);
}

.btn-ghost:hover {
  background: var(--surface);
  color: var(--text);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

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

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

.btn-block {
  width: 100%;
}

.btn-group {
  display: inline-flex;
}

.btn-group .btn {
  border-radius: 0;
}

.btn-group .btn:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

.btn-group .btn:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.btn-group .btn + .btn {
  margin-left: -1px;
}

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

.badge-success {
  background: rgba(0, 184, 148, 0.15);
  color: var(--success);
}

.badge-danger {
  background: rgba(255, 107, 107, 0.15);
  color: var(--danger);
}

.badge-warning {
  background: rgba(254, 202, 87, 0.15);
  color: var(--warning);
}

.badge-info {
  background: rgba(0, 206, 201, 0.15);
  color: var(--accent2);
}

.badge-pending {
  background: rgba(136, 136, 168, 0.15);
  color: var(--text-dim);
}

.badge-accent {
  background: rgba(108, 92, 231, 0.15);
  color: var(--accent);
}

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

/* --- Modals --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 540px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

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

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

.modal-xl {
  max-width: 960px;
}

.modal-header {
  padding: 24px 28px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2,
.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.modal-body {
  padding: 0 28px 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 28px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* --- Alerts --- */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 0.88rem;
  border: 1px solid transparent;
}

.alert-success {
  background: rgba(0, 184, 148, 0.1);
  border-color: rgba(0, 184, 148, 0.25);
  color: var(--success);
}

.alert-danger {
  background: rgba(255, 107, 107, 0.1);
  border-color: rgba(255, 107, 107, 0.25);
  color: var(--danger);
}

.alert-warning {
  background: rgba(254, 202, 87, 0.1);
  border-color: rgba(254, 202, 87, 0.25);
  color: var(--warning);
}

.alert-info {
  background: rgba(0, 206, 201, 0.1);
  border-color: rgba(0, 206, 201, 0.25);
  color: var(--accent2);
}

.alert .alert-icon {
  flex-shrink: 0;
  font-size: 1.1rem;
  margin-top: 1px;
}

.alert .alert-content {
  flex: 1;
}

.alert .alert-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  transition: opacity var(--transition);
}

.alert .alert-close:hover {
  opacity: 1;
}

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

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

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

.dropdown-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.dropdown-menu .dropdown-item:hover {
  background: var(--surface);
  color: var(--text);
}

.dropdown-menu .dropdown-item.danger {
  color: var(--danger);
}

.dropdown-menu .dropdown-item.danger:hover {
  background: rgba(255, 107, 107, 0.1);
}

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

/* --- Tabs --- */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tab-item {
  padding: 12px 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: inherit;
}

.tab-item:hover {
  color: var(--text);
}

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

.tab-content {
  display: none;
}

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

/* --- Progress Bars --- */
.progress {
  height: 8px;
  background: var(--surface);
  border-radius: 20px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 20px;
  background: var(--gradient);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

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

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

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

.progress-bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  animation: progress-shimmer 2s infinite;
}

@keyframes progress-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* --- Tags --- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.tag-accent {
  background: rgba(108, 92, 231, 0.12);
  color: var(--accent);
  border-color: rgba(108, 92, 231, 0.25);
}

.tag-success {
  background: rgba(0, 184, 148, 0.12);
  color: var(--success);
  border-color: rgba(0, 184, 148, 0.25);
}

.tag-danger {
  background: rgba(255, 107, 107, 0.12);
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.25);
}

.tag-remove {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition);
}

.tag-remove:hover {
  opacity: 1;
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination .page-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.pagination .page-btn:hover {
  background: var(--surface);
  color: var(--text);
}

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

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

.pagination-info {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* --- Empty States --- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-dim);
}

.empty-state p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

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

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

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

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

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

.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface) 25%,
    var(--border) 50%,
    var(--surface) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 8px;
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 100%;
}

.skeleton-text:last-child {
  width: 60%;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-card {
  height: 120px;
}

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

/* --- Avatar --- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--gradient);
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  user-select: none;
}

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

.avatar-xs {
  width: 28px;
  height: 28px;
  font-size: 0.7rem;
}

.avatar-sm {
  width: 36px;
  height: 36px;
  font-size: 0.8rem;
}

.avatar-md {
  width: 44px;
  height: 44px;
  font-size: 0.95rem;
}

.avatar-lg {
  width: 60px;
  height: 60px;
  font-size: 1.2rem;
}

.avatar-xl {
  width: 80px;
  height: 80px;
  font-size: 1.5rem;
}

.avatar-group {
  display: flex;
}

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

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

/* --- Tooltip --- */
.tooltip-wrapper {
  position: relative;
  display: inline-block;
}

.tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--text);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
  z-index: 3000;
  box-shadow: var(--shadow);
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--surface);
}

.tooltip-wrapper:hover .tooltip {
  opacity: 1;
  visibility: visible;
}

/* --- Charts --- */
.chart-container {
  position: relative;
  width: 100%;
  padding: 20px;
}

.chart-container canvas {
  max-height: 360px;
}

/* --- Utilities --- */
.text-center {
  text-align: center;
}

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

.text-left {
  text-align: left;
}

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

.text-dim {
  color: var(--text-dim);
}

.text-accent {
  color: var(--accent);
}

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-warning {
  color: var(--warning);
}

.text-sm {
  font-size: 0.82rem;
}

.text-xs {
  font-size: 0.75rem;
}

.text-lg {
  font-size: 1.15rem;
}

.text-xl {
  font-size: 1.35rem;
}

.text-gradient {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.font-bold {
  font-weight: 700;
}

.font-semibold {
  font-weight: 600;
}

.flex {
  display: flex;
}

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

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

.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;
}

.flex-1 {
  flex: 1;
}

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

.gap-1 {
  gap: 4px;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.gap-5 {
  gap: 20px;
}

.gap-6 {
  gap: 24px;
}

.mt-0 {
  margin-top: 0;
}

.mt-1 {
  margin-top: 4px;
}

.mt-2 {
  margin-top: 8px;
}

.mt-3 {
  margin-top: 12px;
}

.mt-4 {
  margin-top: 16px;
}

.mt-5 {
  margin-top: 20px;
}

.mt-6 {
  margin-top: 24px;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-1 {
  margin-bottom: 4px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-3 {
  margin-bottom: 12px;
}

.mb-4 {
  margin-bottom: 16px;
}

.mb-5 {
  margin-bottom: 20px;
}

.mb-6 {
  margin-bottom: 24px;
}

.ml-auto {
  margin-left: auto;
}

.mr-auto {
  margin-right: auto;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.p-0 {
  padding: 0;
}

.p-1 {
  padding: 4px;
}

.p-2 {
  padding: 8px;
}

.p-3 {
  padding: 12px;
}

.p-4 {
  padding: 16px;
}

.p-5 {
  padding: 20px;
}

.p-6 {
  padding: 24px;
}

.px-4 {
  padding-left: 16px;
  padding-right: 16px;
}

.py-4 {
  padding-top: 16px;
  padding-bottom: 16px;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.hidden {
  display: none !important;
}

.visible {
  visibility: visible;
}

.invisible {
  visibility: hidden;
}

.overflow-hidden {
  overflow: hidden;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.rounded {
  border-radius: var(--radius);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.rounded-full {
  border-radius: 50%;
}

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

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.no-select {
  user-select: none;
}

.pointer {
  cursor: pointer;
}

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

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

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

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.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;
}

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  min-width: 300px;
  max-width: 420px;
  pointer-events: all;
  animation: toast-in 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.removing {
  animation: toast-out 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  font-size: 0.88rem;
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  flex-shrink: 0;
  transition: color var(--transition);
}

.toast-close:hover {
  color: var(--text);
}

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

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

.toast-danger {
  border-left: 3px solid var(--danger);
}

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

.toast-warning {
  border-left: 3px solid var(--warning);
}

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

.toast-info {
  border-left: 3px solid var(--accent2);
}

.toast-info .toast-icon {
  color: var(--accent2);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* --- Flash Messages --- */
.flash-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 0.88rem;
  animation: flash-in 0.3s ease;
}

.flash-message.flash-success {
  background: rgba(0, 184, 148, 0.1);
  border: 1px solid rgba(0, 184, 148, 0.25);
  color: var(--success);
}

.flash-message.flash-danger {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.25);
  color: var(--danger);
}

.flash-message.flash-warning {
  background: rgba(254, 202, 87, 0.1);
  border: 1px solid rgba(254, 202, 87, 0.25);
  color: var(--warning);
}

.flash-message.flash-info {
  background: rgba(0, 206, 201, 0.1);
  border: 1px solid rgba(0, 206, 201, 0.25);
  color: var(--accent2);
}

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

/* --- Sidebar Overlay (mobile) --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

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

/* --- Punch System --- */
.punch-section {
  text-align: center;
  padding: 40px 20px;
}

.punch-time {
  font-size: 3.5rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.punch-date {
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 24px;
}

.punch-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.punch-btn {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
  font-family: inherit;
}

.punch-btn .punch-btn-icon {
  font-size: 2rem;
}

.punch-btn:hover {
  transform: scale(1.05);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
}

.punch-btn.active {
  background: var(--gradient);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 30px var(--accent-glow);
}

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

.punch-status {
  margin-top: 24px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
}

.break-timer {
  font-size: 2rem;
  font-weight: 700;
  color: var(--warning);
  margin: 16px 0;
  font-variant-numeric: tabular-nums;
}

/* --- Attendance Log --- */
.attendance-log {
  max-height: 400px;
  overflow-y: auto;
}

.log-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

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

.log-entry .log-type {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.log-entry .log-type.punch-in {
  background: rgba(0, 184, 148, 0.15);
  color: var(--success);
}

.log-entry .log-type.punch-out {
  background: rgba(255, 107, 107, 0.15);
  color: var(--danger);
}

.log-entry .log-type.break-start {
  background: rgba(254, 202, 87, 0.15);
  color: var(--warning);
}

.log-entry .log-type.break-end {
  background: rgba(0, 206, 201, 0.15);
  color: var(--accent2);
}

.log-entry .log-info {
  flex: 1;
}

.log-entry .log-info .log-label {
  font-weight: 600;
  font-size: 0.88rem;
}

.log-entry .log-info .log-time {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.log-entry .log-duration {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 600;
}

/* --- Confirm Dialog --- */
.confirm-dialog {
  text-align: center;
}

.confirm-dialog .confirm-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 107, 107, 0.12);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 20px;
}

.confirm-dialog h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.confirm-dialog p {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 24px;
}

.confirm-dialog .confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* --- CSV Preview --- */
.csv-preview {
  overflow-x: auto;
  margin-top: 12px;
}

.csv-preview table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.csv-preview th,
.csv-preview td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.csv-preview th {
  background: var(--surface);
  font-weight: 600;
  color: var(--text-dim);
}

/* --- Password Strength --- */
.password-strength {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.password-strength .strength-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  transition: background var(--transition);
}

.password-strength .strength-bar.active.weak {
  background: var(--danger);
}

.password-strength .strength-bar.active.medium {
  background: var(--warning);
}

.password-strength .strength-bar.active.strong {
  background: var(--success);
}

.password-strength-text {
  font-size: 0.75rem;
  margin-top: 4px;
  color: var(--text-muted);
}

/* --- Slug Input --- */
.slug-preview {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 8px 12px;
  background: var(--surface);
  border-radius: 8px;
  margin-top: 6px;
  word-break: break-all;
}

/* --- Layout Class Aliases --- */
.sidebar-brand a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
  overflow: hidden;
}

.sidebar-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gradient);
  border-radius: 0 3px 3px 0;
  transform: scaleY(0);
  transition: transform var(--transition);
}

.sidebar-link:hover {
  color: var(--text);
  background: rgba(108, 92, 231, 0.08);
}

.sidebar-link.active {
  color: var(--text);
  background: rgba(108, 92, 231, 0.15);
  font-weight: 600;
}

.sidebar-link.active::before {
  transform: scaleY(1);
}

.sidebar-link.active .sidebar-icon {
  opacity: 1;
}

.sidebar-section {
  margin-bottom: 8px;
}

.sidebar-section-title {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 8px 12px 6px;
  user-select: none;
}

.sidebar-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-brand-text {
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

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

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

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

.sidebar-logout {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
  text-decoration: none;
}

.sidebar-logout:hover {
  background: rgba(255, 107, 107, 0.1);
  color: var(--danger);
}

.topbar-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.topbar-search-input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px 8px 36px;
  color: var(--text);
  font-size: 0.88rem;
  width: 220px;
  transition: all var(--transition);
}

.topbar-search-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
  outline: none;
  width: 280px;
}

.topbar-search-input::placeholder {
  color: var(--text-muted);
}

.topbar-bell {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.topbar-bell:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-focus);
}

.topbar-bell-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}

.topbar-user-dropdown {
  position: relative;
  display: inline-block;
}

.topbar-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: background var(--transition);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
}

.topbar-user-btn:hover {
  background: var(--surface);
}

.topbar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--gradient);
  color: #fff;
  flex-shrink: 0;
}

.topbar-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

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

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

.topbar-dropdown-menu a:hover,
.topbar-dropdown-menu button:hover {
  background: var(--surface);
  color: var(--text);
}

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

/* --- Stat Cards --- */
.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-primary {
  border-top: 3px solid var(--accent);
}

.stat-primary .stat-value {
  color: var(--accent);
}

.stat-success {
  border-top: 3px solid var(--success);
}

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

.stat-warning {
  border-top: 3px solid var(--warning);
}

.stat-warning .stat-value {
  color: var(--warning);
}

.stat-danger {
  border-top: 3px solid var(--danger);
}

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

/* --- Cards / Forms --- */
.card-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.card-link {
  display: block;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
}

.card-link:hover {
  border-color: rgba(108, 92, 231, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card-link h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.card-link p {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0;
}

.chart-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.leave-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.leave-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}

.leave-stat .value {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.2;
}

.leave-stat .label {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.leave-stat.pending {
  border-top: 3px solid var(--warning);
}

.leave-stat.pending .value {
  color: var(--warning);
}

.leave-stat.paid {
  border-top: 3px solid var(--success);
}

.leave-stat.paid .value {
  color: var(--success);
}

.leave-stat.sick {
  border-top: 3px solid var(--danger);
}

.leave-stat.sick .value {
  color: var(--danger);
}

/* --- Badges --- */
.badge-present {
  background: rgba(0, 184, 148, 0.15);
  color: var(--success);
}

.badge-absent {
  background: rgba(255, 107, 107, 0.15);
  color: var(--danger);
}

.badge-flagged {
  background: rgba(254, 202, 87, 0.15);
  color: var(--warning);
}

.badge-ok {
  background: rgba(0, 206, 201, 0.15);
  color: var(--accent2);
}

.badge-employee {
  background: rgba(136, 136, 168, 0.15);
  color: var(--text-dim);
}

.badge-admin {
  background: rgba(108, 92, 231, 0.15);
  color: var(--accent);
}

.badge-primary {
  background: rgba(108, 92, 231, 0.15);
  color: var(--accent);
}

/* --- Buttons --- */
.btn-full {
  width: 100%;
}

.btn-punch {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 3px solid var(--border);
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all var(--transition);
  font-family: inherit;
  line-height: 1.2;
}

.btn-punch:hover:not(:disabled) {
  transform: scale(1.05);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 30px var(--accent-glow);
}

.btn-punch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-punch-in {
  background: linear-gradient(135deg, rgba(0, 184, 148, 0.15), rgba(0, 184, 148, 0.05));
  border-color: rgba(0, 184, 148, 0.4);
  color: var(--success);
}

.btn-punch-in:hover:not(:disabled) {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
  box-shadow: 0 0 30px rgba(0, 184, 148, 0.3);
}

.btn-punch-out {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.15), rgba(255, 107, 107, 0.05));
  border-color: rgba(255, 107, 107, 0.4);
  color: var(--danger);
}

.btn-punch-out:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
  box-shadow: 0 0 30px rgba(255, 107, 107, 0.3);
}

/* --- Punch Dashboard --- */
.current-status {
  text-align: center;
  margin-bottom: 24px;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.status-in {
  background: rgba(0, 184, 148, 0.12);
  color: var(--success);
}

.status-out {
  background: rgba(255, 107, 107, 0.12);
  color: var(--danger);
}

.last-punch {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 6px;
}

.today-hours {
  font-size: 1rem;
  color: var(--text-dim);
  margin: 0;
}

.punch-result {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--radius);
  text-align: center;
  font-weight: 500;
}

.punch-result.success {
  background: rgba(0, 184, 148, 0.1);
  color: var(--success);
  border: 1px solid rgba(0, 184, 148, 0.25);
}

.punch-result.error {
  background: rgba(255, 107, 107, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 107, 107, 0.25);
}

.location-note {
  max-width: 420px;
  margin: 16px auto 10px;
}

.location-note input {
  width: 100%;
}

.location-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0 0 4px;
}

.geo-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

/* --- Tables --- */
.actions-cell {
  white-space: nowrap;
}

.actions-cell .btn {
  margin-right: 4px;
}

.actions-cell .btn:last-child {
  margin-right: 0;
}

.row-flagged {
  background: rgba(255, 107, 107, 0.05) !important;
}

.row-flagged:hover {
  background: rgba(255, 107, 107, 0.1) !important;
}

.late-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(254, 202, 87, 0.15);
  color: var(--warning);
}

.overtime-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(0, 184, 148, 0.15);
  color: var(--success);
}

.data-table tbody td {
  white-space: normal;
}

/* --- Alerts --- */
.alert-error {
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.25);
  color: var(--danger);
}

/* --- Footer --- */
.footer {
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
  background: rgba(10, 10, 18, 0.6);
}

/* --- Login / Register --- */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 40px 20px;
  position: relative;
  z-index: 1;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  background: rgba(26, 26, 36, 0.8);
  backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow), 0 0 80px rgba(108, 92, 231, 0.08);
}

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

.login-header h1 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
}

.login-header p {
  color: var(--text-dim);
  font-size: 14px;
}

@media (max-width: 480px) {
  .login-card {
    padding: 28px 20px;
  }

  .reg-card {
    padding: 32px 20px;
  }

  .plan-cards {
    grid-template-columns: 1fr;
  }

  .btn-punch {
    width: 120px;
    height: 120px;
  }
}

/* --- Print --- */
@media print {
  .sidebar,
  .topbar,
  .sidebar-overlay {
    display: none !important;
  }

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

  .content-area {
    padding: 0 !important;
  }

  body {
    background: #fff;
    color: #000;
  }

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

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

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .sidebar {
    transform: translateX(-100%);
    z-index: 1100;
  }

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

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

  .sidebar-toggle {
    display: flex;
  }

  .topbar {
    padding: 0 16px;
  }

  .topbar-search {
    display: none;
  }

  .topbar-user .user-name,
  .topbar-user .user-role {
    display: none;
  }

  .content-area {
    padding: 16px;
  }

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

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

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .modal {
    margin: 10px;
    max-height: 90vh;
  }

  .punch-btn {
    width: 110px;
    height: 110px;
    font-size: 0.88rem;
  }

  .punch-time {
    font-size: 2.5rem;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody tr {
    display: block;
    padding: 12px;
    border-bottom: 1px solid var(--border);
  }

  .data-table tbody td {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: none;
  }

  .data-table tbody td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--text-dim);
    font-size: 0.78rem;
    text-transform: uppercase;
  }

  .tabs {
    gap: 0;
  }

  .tab-item {
    padding: 10px 14px;
    font-size: 0.82rem;
  }

  .toast-container {
    left: 10px;
    right: 10px;
  }

  .toast {
    min-width: auto;
    max-width: 100%;
  }

  .punch-buttons {
    gap: 12px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 13px;
  }

  .topbar-btn {
    width: 36px;
    height: 36px;
  }

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

  .punch-time {
    font-size: 2rem;
  }

  .modal-body {
    padding: 0 16px 16px;
  }

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

  .modal-footer {
    padding: 12px 16px 16px;
  }
}
