:root {
  --blue-900: #8f0623;
  --blue-700: #c1092d;
  --blue-500: #f10d36;
  --sky-100: #fff0f4;
  --line: #f7cad6;
  --text: #2a1720;
  --ok: #1a8f49;
  --warn: #d46f00;
  --bad: #c33535;
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: #fff0f4;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(130deg, rgba(241, 13, 54, 0.08) 25%, transparent 25%),
    linear-gradient(130deg, transparent 75%, rgba(241, 13, 54, 0.08) 75%);
  background-size: 60px 60px;
  opacity: 0.4;
}

.topbar {
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 100%);
  color: var(--white);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(143, 6, 35, 0.18);
  flex-wrap: wrap;
  gap: 16px;
}

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

.logo-9xai {
  min-width: 50px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--white);
  color: var(--blue-500);
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  flex-shrink: 0;
}

.brand {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.welcome {
  font-size: 0.9rem;
  font-weight: 600;
}

main {
  flex: 1;
  position: relative;
  z-index: 1;
}

.container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 16px 40px;
  width: 100%;
}

.panel {
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  margin-bottom: 20px;
  box-shadow: 0 10px 32px rgba(160, 8, 44, 0.12);
  overflow: hidden;
  animation: slideIn 0.4s ease-out;
}

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

.section-title {
  margin: 0;
  padding: 14px 18px;
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--blue-700) 0%, var(--blue-500) 100%);
  letter-spacing: 0.3px;
}

.panel > *:not(.section-title) {
  padding: 20px;
}

.transaction-entry-panel > *:not(.section-title) {
  padding: 0 !important;
}

.panel > .section-title + * {
  padding-top: 20px;
}

.hint {
  margin: 8px 0 0;
  color: #6b7280;
  font-size: 0.9rem;
  font-weight: 500;
}

.auth-panel {
  max-width: 480px;
  margin: 60px auto;
}

.auth-panel .panel {
  padding: 32px;
}

.auth-panel .section-title {
  margin: -32px -32px 16px;
  padding: 16px 32px;
}

.table-form {
  display: grid;
  gap: 14px;
  padding: 18px 0;
}

.form-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px solid #f3e8ec;
}

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

.form-row.two-col {
  grid-template-columns: 1fr 1fr;
  border-bottom: none;
}

.form-row.two-col > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-weight: 700;
  color: #5a3a42;
  font-size: 0.9rem;
}

input, select, textarea {
  width: 100%;
  border: 1.5px solid #f4bccb;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.95rem;
  background: #fffdfd;
  color: var(--text);
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(241, 13, 54, 0.1);
  background: var(--white);
}

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

.row-actions {
  border-bottom: none;
  padding-top: 8px;
  display: flex;
  gap: 12px;
}

.btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
  color: var(--white);
}

.transaction-entry-panel .btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, #c1092d 0%, #8f0623 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 48px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.12s;
  letter-spacing: 0.02em;
}

.form-submit-area {
  margin-top: 28px;
  padding: 0 0 4px;
}

.btn-light {
  background: var(--gray-100);
  color: var(--blue-700);
  border: 1px solid #e8d5db;
}

.btn-success {
  background: var(--ok);
  color: var(--white);
}

.btn-danger {
  background: var(--bad);
  color: var(--white);
}

.alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  border-left: 4px solid;
}

.alert-success {
  background: #f0fdf4;
  color: #166534;
  border-left-color: var(--ok);
}

.alert-success a {
  color: #166534;
  text-decoration: underline;
}

.reset-link-box {
  margin: 12px 0;
  padding: 16px;
  background: #fff8fa;
  border: 1.5px solid #f3d6df;
  border-radius: 10px;
  text-align: center;
}

.reset-link-label {
  font-size: 0.85rem;
  color: #6b7280;
  margin: 0 0 10px;
  font-weight: 600;
}

.reset-link-btn {
  display: inline-block;
  background: linear-gradient(135deg, #c1092d 0%, #8f0623 100%);
  color: #fff;
  text-decoration: none;
  padding: 10px 28px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.reset-link-btn:hover {
  opacity: 0.88;
}

.reset-link-copy {
  font-size: 0.75rem;
  color: #9ca3af;
  word-break: break-all;
  margin: 8px 0 0;
}

/* ── Sick Leave Toast ─────────────────────────────────── */
.sl-toast {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12000;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-left: 5px solid #c1092d;
  border-radius: 10px;
  padding: 14px 20px;
  box-shadow: 0 8px 32px rgba(143, 6, 35, 0.18);
  min-width: 320px;
  max-width: 90vw;
  animation: slToastIn 0.25s ease;
}

@keyframes slToastIn {
  from { opacity: 0; top: 64px; }
  to   { opacity: 1; top: 84px; }
}

.sl-toast-icon {
  font-size: 1.4rem;
  color: #c1092d;
  flex-shrink: 0;
}

.sl-toast-msg {
  font-size: 0.92rem;
  font-weight: 600;
  color: #1a202c;
  flex: 1;
}

.sl-toast-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}

.sl-toast-close:hover { color: #c1092d; }

.sl-toast-success {
  border-left-color: #16a34a;
}
.sl-toast-success .sl-toast-icon {
  color: #16a34a;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border-left-color: var(--bad);
}

.auth-links {
  margin-top: 20px;
  text-align: center;
  font-size: 0.85rem;
}

.auth-links a {
  color: var(--blue-500);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.auth-links a:hover {
  color: var(--blue-700);
  text-decoration: underline;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.info-table th,
.info-table td {
  border: 1px solid #f3e8ec;
  padding: 12px;
  text-align: left;
}

.info-table th {
  background: var(--sky-100);
  font-weight: 700;
  color: #5a3a42;
  width: 40%;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  font-size: 0.9rem;
}

.data-table.compact {
  min-width: 700px;
}

.data-table th,
.data-table td {
  border: 1px solid #f3e8ec;
  padding: 10px;
  vertical-align: top;
}

.data-table th {
  background: var(--sky-100);
  color: #5a3a42;
  font-weight: 700;
  white-space: nowrap;
}

.data-table tr:hover {
  background: #fef9fa;
}

.empty {
  text-align: center;
  color: #8b5860;
  font-weight: 600;
  padding: 20px !important;
}

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
}

.status-pending {
  background: #fff4dd;
  color: #92400e;
}

.status-approved {
  background: #e8f7ee;
  color: #166534;
}

.status-declined {
  background: #fef2f2;
  color: #991b1b;
}

.decision-form {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--gray-50);
  border-radius: 8px;
}

.decision-buttons {
  display: flex;
  gap: 8px;
}

.decision-buttons .btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.85rem;
}

@media (max-width: 1024px) {
  .container {
    max-width: 100%;
  }

  .table-wrap {
    overflow-x: auto;
  }

  .data-table {
    min-width: 800px;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .brand-wrap {
    width: 100%;
  }

  .brand {
    font-size: 0.85rem;
  }

  .user-actions {
    width: 100%;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }

  .welcome {
    font-size: 0.8rem;
  }

  .container {
    padding: 16px 12px 32px;
    margin: 16px auto;
  }

  .panel {
    margin-bottom: 16px;
    border-radius: 10px;
  }

  .auth-panel {
    margin: 40px auto;
    max-width: 100%;
  }

  .auth-panel .panel {
    padding: 24px;
  }

  .auth-panel .section-title {
    margin: -24px -24px 12px;
    padding: 12px 24px;
  }

  .form-row,
  .form-row.two-col {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 6px 0;
  }

  .form-row label {
    font-weight: 700;
  }

  .section-title {
    padding: 12px 16px;
    font-size: 0.9rem;
  }

  .panel > *:not(.section-title) {
    padding: 20px;
  }

  .table-wrap {
    overflow-x: auto;
  }

  .data-table,
  .data-table.compact {
    min-width: 600px;
    font-size: 0.85rem;
  }

  .data-table th,
  .data-table td {
    padding: 8px;
  }

  .info-table th {
    width: 50%;
  }

  .btn {
    padding: 9px 12px;
    font-size: 0.85rem;
  }

  .btn:hover {
    transform: none;
  }

  .row-actions {
    flex-direction: column;
  }

  .decision-buttons {
    flex-direction: column;
  }

  .decision-buttons .btn {
    flex: 1;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 10px 12px;
  }

  .logo-9xai {
    min-width: 44px;
    height: 32px;
    font-size: 0.8rem;
  }

  .brand {
    font-size: 0.8rem;
  }

  .container {
    padding: 12px 10px 24px;
    margin: 12px auto;
  }

  .panel {
    border-radius: 8px;
  }

  .auth-panel .panel {
    padding: 20px;
  }

  .auth-panel .section-title {
    margin: -20px -20px 10px;
    padding: 10px 20px;
  }

  .section-title {
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  .hint {
    font-size: 0.8rem;
  }

  .form-row {
    padding: 4px 0;
  }

  .form-row label {
    font-size: 0.85rem;
  }

  input, select, textarea {
    padding: 8px 10px;
    font-size: 16px;
  }

  .btn {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .data-table,
  .data-table.compact {
    min-width: 100%;
    font-size: 0.8rem;
  }

  .data-table th,
  .data-table td {
    padding: 6px;
  }

  .alert {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .auth-links {
    font-size: 0.8rem;
    margin-top: 16px;
  }
}

/* Login Page Styles */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: transparent;
}

.login-panel {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 420px;
  padding: 40px;
  animation: slideUp 0.5s ease-out;
}

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

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

.login-logo {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--blue-500);
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.login-title {
  margin: 8px 0;
  font-size: 1.6rem;
  color: var(--text);
  font-weight: 700;
}

.login-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: #6b7280;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.login-form {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
}

.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input {
  width: 100%;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: #f9fafb;
  transition: all 0.2s ease;
}

.login-input:focus {
  outline: none;
  border-color: var(--blue-500);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(241, 13, 54, 0.1);
}

.login-input::placeholder {
  color: #9ca3af;
}

.language-selector {
  display: flex;
  gap: 32px;
  justify-content: center;
  margin: 20px 0;
  padding: 16px 0;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.language-selector label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  color: #6b7280;
  transition: color 0.2s ease;
}

.language-selector label:hover {
  color: var(--text);
}

.language-selector input[type="radio"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
}

.btn-login {
  background: linear-gradient(135deg, var(--blue-700) 0%, var(--blue-500) 100%);
  color: var(--white);
  border: 0;
  border-radius: 8px;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 18px rgba(193, 9, 45, 0.28);
  width: 100%;
  letter-spacing: 0.3px;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(193, 9, 45, 0.34);
}

.btn-login:active {
  transform: translateY(0);
}

.login-footer {
  text-align: center;
  margin-bottom: 16px;
}

.lost-password {
  color: #1e40af;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.lost-password:hover {
  color: var(--blue-500);
  text-decoration: underline;
}

.login-links {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid #e5e7eb;
}

.login-links a {
  color: #6b7280;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

html[dir="rtl"] body {
  direction: rtl;
}

html[dir="rtl"] .login-panel,
html[dir="rtl"] .login-input,
html[dir="rtl"] .language-selector,
html[dir="rtl"] .login-footer,
html[dir="rtl"] .login-links {
  text-align: right;
}

html[dir="rtl"] .language-selector {
  justify-content: space-between;
}

html[dir="rtl"] .language-selector label {
  flex-direction: row-reverse;
}

/* Admin Navigation */
.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e5e7eb;
  flex-wrap: wrap;
}

.admin-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
  flex-wrap: wrap;
}

.nav-link {
  padding: 7px 12px;
  border-radius: 6px;
  text-decoration: none;
  color: #6b7280;
  font-weight: 600;
  font-size: 0.86rem;
  transition: all 0.2s ease;
  background: #f3f4f6;
  line-height: 1.2;
}

.nav-link:hover {
  color: var(--blue-500);
  background: #f9fafb;
}

.nav-link.active {
  color: var(--white);
  background: var(--blue-500);
}

.admin-export-btn {
  padding: 7px 12px;
  font-size: 0.84rem;
  border-radius: 8px;
  white-space: nowrap;
  max-width: 100%;
}

.login-links a:hover {
  color: var(--blue-500);
  text-decoration: underline;
}

@media (max-width: 768px) {
  .admin-toolbar {
    align-items: stretch;
  }

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

  .admin-export-btn {
    width: 100%;
    text-align: center;
  }

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

  .login-logo {
    font-size: 2rem;
  }

  .login-title {
    font-size: 1.4rem;
  }

  .login-subtitle {
    font-size: 0.9rem;
  }

  .login-form {
    gap: 14px;
  }

  .login-input {
    padding: 11px 14px;
    font-size: 0.9rem;
  }

  .language-selector {
    gap: 24px;
    margin: 16px 0;
    padding: 12px 0;
  }

  .btn-login {
    padding: 12px 18px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .login-container {
    padding: 16px;
  }

  .login-panel {
    padding: 24px 20px;
  }

  .login-logo {
    font-size: 1.8rem;
  }

  .login-title {
    font-size: 1.2rem;
    margin: 6px 0;
  }

  .login-subtitle {
    font-size: 0.85rem;
  }

  .login-form {
    gap: 12px;
    margin-bottom: 20px;
  }

  .login-input {
    padding: 10px 12px;
    font-size: 16px;
  }

  .language-selector {
    gap: 20px;
    margin: 14px 0;
    padding: 10px 0;
  }

  .language-selector label {
    font-size: 0.85rem;
  }

  .btn-login {
    padding: 11px 16px;
    font-size: 0.85rem;
  }

  .lost-password {
    font-size: 0.85rem;
  }

  .login-links a {
    font-size: 0.8rem;
  }
}

/* Sidebar Navigation */
.layout-with-sidebar {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 250px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 20px;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 90;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
}

.main-content {
  margin-left: 250px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 2px solid #e5e7eb;
}

.profile-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-700) 100%);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.profile-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-name {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}

.profile-status {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 500;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: #4b5563;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: #f0f1f3;
  color: var(--blue-500);
}

.nav-item.active {
  background: linear-gradient(135deg, var(--blue-500) 0%, var(--blue-700) 100%);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(241, 13, 54, 0.3);
}

.nav-icon {
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  flex-shrink: 0;
}

.nav-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 8px;
}

.nav-section-title {
  padding: 12px 14px;
  font-weight: 700;
  color: var(--text);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 2px solid #e5e7eb;
}

.logout-btn {
  width: 100%;
}

.logout-btn:hover {
  background: #fee;
  color: var(--bad);
}

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

.topbar-title {
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}

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

@media (max-width: 1024px) {
  .sidebar {
    width: 220px;
    padding: 16px;
  }

  .main-content {
    margin-left: 220px;
  }

  .nav-item {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .nav-section-title {
    font-size: 0.75rem;
    padding: 10px 12px;
  }
}

@media (max-width: 768px) {
  .layout-with-sidebar {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 16px;
    gap: 12px;
  }

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

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .nav-section {
    display: flex;
    flex-direction: row;
    gap: 8px;
    margin-top: 0;
    width: 100%;
  }

  .nav-section-title {
    display: none;
  }

  .nav-item {
    padding: 8px 10px;
    font-size: 0.8rem;
    flex: 0 1 auto;
  }

  .profile-info {
    display: none;
  }

  .sidebar-profile {
    padding-bottom: 0;
    border-bottom: none;
    gap: 6px;
  }

  .profile-avatar {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .profile-name {
    display: none;
  }

  .profile-status {
    display: none;
  }

  .sidebar-footer {
    padding-top: 0;
    border-top: none;
  }
}

/* Balance Cards */
.balance-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.balance-card {
  background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.balance-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-label {
  font-size: 0.9rem;
  color: #4b5563;
  font-weight: 600;
  margin-bottom: 12px;
}

.card-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1a202c;
  margin-bottom: 4px;
}

.card-unit {
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 500;
}

/* Balance Info Table */
.section-subtitle {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 16px;
  margin-top: 24px;
}

.balance-info-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.balance-info-table tbody tr {
  border-bottom: 1px solid #e5e7eb;
}

.balance-info-table tbody tr:last-child {
  border-bottom: none;
}

.info-label {
  padding: 12px 16px;
  font-weight: 600;
  color: #4b5563;
  width: 40%;
  background-color: #f9fafb;
}

.info-value {
  padding: 12px 16px;
  color: #1a202c;
}

/* Request Page Layout */
.request-panel,
.transaction-entry-panel,
.transaction-list-panel {
  padding: 18px 22px 22px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #f3d6df;
  box-shadow: 0 10px 24px rgba(143, 6, 35, 0.08);
}

.request-panel > *:first-child,
.transaction-entry-panel > *:first-child,
.transaction-list-panel > *:first-child {
  margin-top: 0;
}

.structured-request-form {
  display: grid;
  gap: 0;
}

.structured-request-form .form-row {
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  padding: 10px 0;
}

.structured-request-form .form-row.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.structured-request-form .form-row.two-col > div {
  gap: 8px;
}

.structured-request-form input,
.structured-request-form select,
.structured-request-form textarea,
.transaction-entry-panel .form-control,
.transaction-entry-panel textarea,
.transaction-list-panel .form-control {
  min-height: 52px;
}

.structured-request-form textarea,
.transaction-entry-panel textarea {
  min-height: 120px;
}

.structured-request-form input[type="file"],
.transaction-entry-panel input[type="file"] {
  padding: 12px;
  background: #fff;
}

.structured-request-form .employee-info,
.compact-requester-info {
  padding-top: 12px;
  border-top: 1px solid #f3e8ec;
  margin-top: 8px;
}

.structured-request-form .info-box label,
.compact-requester-info .info-label {
  color: #6b7280;
  font-size: 0.85rem;
  font-weight: 600;
}

.structured-request-form .info-box span,
.compact-requester-info .info-value {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
}

/* Transaction Entry Form */
.transaction-entry-panel {
  background: white;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.form-group label {
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

.form-control {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(241, 13, 54, 0.1);
}

.form-row-time {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 12px;
  margin-bottom: 12px;
}

.time-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.time-group label {
  font-weight: 600;
  color: #1a202c;
  font-size: 0.95rem;
}

.time-control {
  max-width: 220px;
}

.form-group textarea {
  resize: vertical;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px rgba(241, 13, 54, 0.1);
}

.requester-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 16px;
  background-color: #f9fafb;
  border-radius: 4px;
  margin: 20px 0;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-item .info-label {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  color: #6b7280;
  font-weight: 500;
}

.info-item .info-value {
  padding: 0;
  color: #1a202c;
  font-weight: 600;
  font-size: 0.95rem;
}

/* Vacation Transactions */
.transaction-list-panel {
  background: white;
}

.form-actions {
  margin-bottom: 24px;
}

.form-actions .btn {
  min-width: 220px;
}

.search-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(150px, 0.8fr) minmax(220px, 1.2fr) minmax(170px, 0.9fr) auto;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 24px;
  padding: 16px;
  background-color: #fff7f9;
  border: 1px solid #f3d6df;
  border-radius: 10px;
}

.search-filters .form-group {
  min-width: 0;
}

.search-filters .form-control {
  min-height: 54px;
}

.search-filters .btn-search {
  min-height: 54px;
  align-self: end;
}

.record-count {
  align-self: center;
  white-space: nowrap;
}

.btn-search {
  background: linear-gradient(135deg, var(--blue-700), var(--blue-500));
  color: white;
  padding: 10px 24px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-search:hover {
  box-shadow: 0 6px 16px rgba(193, 9, 45, 0.22);
}

.record-count {
  color: #f10d36;
  font-weight: 600;
  font-size: 0.95rem;
}

.no-data {
  text-align: center;
  padding: 44px 24px;
  color: #7a4754;
  font-size: 1rem;
  font-weight: 700;
  border: 1px dashed #f0b8c7;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffafb 0%, #fff2f6 100%);
}

/* Vacation Data Table */
.vacation-data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  margin-top: 20px;
  border-radius: 12px;
  overflow: hidden;
}

.transaction-list-panel,
.transaction-entry-panel {
  overflow: hidden;
}

.transaction-list-panel .table-wrap {
  margin-top: 0;
}

.vacation-data-table thead {
  background: linear-gradient(135deg, #a70a28, var(--blue-700));
  color: white;
}

.vacation-data-table thead th {
  padding: 14px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
}

.vacation-data-table tbody tr {
  border-bottom: 1px solid #e5e7eb;
}

.vacation-data-table tbody tr.status-approved {
  background-color: #f0f9ff;
}

.vacation-data-table tbody tr.status-declined {
  background-color: #fef2f2;
}

.vacation-data-table tbody tr.status-pending {
  background-color: #fffbeb;
}

.vacation-data-table tbody td {
  padding: 12px;
  color: #1a202c;
  font-size: 0.95rem;
}

.status-badge {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.85rem;
}

.vacation-data-table tbody tr.status-approved .status-badge {
  background-color: #d1fae5;
  color: #065f46;
}

.vacation-data-table tbody tr.status-pending .status-badge {
  background-color: #fef3c7;
  color: #92400e;
}

.vacation-data-table tbody tr.status-declined .status-badge {
  background-color: #fee2e2;
  color: #991b1b;
}

.show-link {
  color: var(--blue-500);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
}

.show-link:hover {
  color: var(--blue-700);
  text-decoration: underline;
}

@media (max-width: 1024px) {
  .search-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .record-count {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 768px) {
  .request-panel,
  .transaction-entry-panel,
  .transaction-list-panel {
    padding: 14px 16px 18px;
  }

  .form-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .structured-request-form .form-row,
  .structured-request-form .form-row.two-col,
  .form-grid,
  .search-filters,
  .requester-info {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .form-row-time {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .time-control {
    max-width: 100%;
  }

  .search-filters .btn-search {
    width: 100%;
  }

  .record-count {
    white-space: normal;
  }
}

/* ── Online dot ─────────────────────────────────────── */
.online-dot {
  color: #16a34a;
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: 0.01em;
}

/* ── User avatar button ──────────────────────────────── */
.user-avatar-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(143,6,35,0.08);
  border: 1.5px solid rgba(143,6,35,0.18);
  border-radius: 50px;
  padding: 5px 14px 5px 8px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  color: #8f0623;
  transition: background 0.15s;
}
.user-avatar-btn:hover { background: rgba(143,6,35,0.15); }
.user-avatar-btn .user-icon {
  width: 22px;
  height: 22px;
  stroke: #8f0623;
  flex-shrink: 0;
}

/* ── User dropdown menu ──────────────────────────────── */
.user-menu-wrap {
  position: relative;
}
.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #f3d6df;
  border-radius: 12px;
  min-width: 220px;
  box-shadow: 0 8px 32px rgba(143,6,35,0.13);
  z-index: 9999;
  overflow: hidden;
}
.user-dropdown.open { display: block; }
.dropdown-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: #fff8fa;
  border-bottom: 1px solid #f3d6df;
  font-weight: 700;
  font-size: 0.9rem;
  color: #2a1720;
}
.dropdown-header .user-icon {
  width: 20px;
  height: 20px;
  stroke: #8f0623;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: #2a1720;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.12s;
}
.dropdown-item:hover { background: #fff2f6; color: #8f0623; }
.dropdown-item svg {
  width: 17px;
  height: 17px;
  stroke: #8f0623;
  flex-shrink: 0;
}

/* ── Logout icon button ──────────────────────────────── */
.btn-logout-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1.5px solid rgba(143,6,35,0.25);
  border-radius: 50px;
  padding: 5px 14px 5px 10px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 700;
  color: #8f0623;
  transition: background 0.15s, border-color 0.15s;
}
.btn-logout-icon:hover { background: #fff2f6; border-color: #8f0623; }
.btn-logout-icon svg {
  width: 17px;
  height: 17px;
  stroke: #8f0623;
  flex-shrink: 0;
}

/* ── Balance inline row (on request forms) ───────────── */
.balance-inline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 6px;
  margin-bottom: 8px;
}
.balance-inline-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #8b5860;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.balance-inline-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: #8f0623;
}

/* ── Request new vacation button (bigger + link) ─────── */
.btn-req-vacation {
  display: inline-block;
  background: linear-gradient(135deg, #c1092d 0%, #8f0623 100%);
  color: #fff !important;
  border: none;
  border-radius: 10px;
  padding: 14px 36px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.12s;
  margin: 10px 0 14px;
}
.btn-req-vacation:hover { opacity: 0.88; transform: translateY(-1px); }

/* ── Add button (bigger) ─────────────────────────────── */
.form-submit-area {
  margin-top: 28px;
  padding: 0 0 4px;
}
.btn-add-big {
  display: inline-block;
  background: linear-gradient(135deg, #c1092d 0%, #8f0623 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 48px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.12s;
  letter-spacing: 0.02em;
}
.btn-add-big:hover { opacity: 0.88; transform: translateY(-1px); }

/* ── Topbar right spacing ────────────────────────────── */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Improve contrast for controls shown inside the red topbar */
.topbar .user-avatar-btn,
.topbar .btn-logout-icon {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.topbar .user-avatar-btn .user-icon,
.topbar .btn-logout-icon svg {
  stroke: #ffffff;
}

.topbar .user-avatar-btn:hover,
.topbar .btn-logout-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
}
.user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Dropdown online indicator (green) ────────────────── */
.dropdown-name-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dropdown-online {
  color: #16a34a;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ── Smaller search button ────────────────────────────── */
.btn-search-sm {
  background: linear-gradient(135deg, #c1092d 0%, #8f0623 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 22px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  align-self: center;
  transition: opacity 0.15s;
}
.btn-search-sm:hover { opacity: 0.88; }

/* ── Search filters — more padding top/bottom, more visible ── */
.search-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  padding: 22px 20px 22px !important;
  background: #fff8fa;
  border: 1.5px solid #f3d6df;
  border-radius: 12px;
  margin-bottom: 20px;
}
.search-filters .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}
.search-filters .form-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #8b5860;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.search-filters .form-control {
  border: 1.5px solid #e8c0ca;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  background: #fff;
  color: #2a1720;
  cursor: pointer;
  transition: border-color 0.15s;
}
.search-filters .form-control:focus {
  outline: none;
  border-color: #c1092d;
}

/* ── Record count ─────────────────────────────────────── */
.record-count {
  font-size: 0.9rem;
  font-weight: 700;
  color: #c1092d;
  align-self: center;
  padding-bottom: 0;
  white-space: nowrap;
}

/* ── Override padding for transaction entry panel ───────────────────────────────── */
.transaction-entry-panel > *:not(.section-title) {
  padding: 0;
  margin-bottom: 12px;
}

