/* AVS Human Capital - Enterprise Zimbabwe HR ERP Styles */
@import url('../vendor/fonts/fonts.css');

:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --color-primary: #0f172a;
  --color-primary-light: #1e293b;
  --color-secondary: #059669; /* Zimbabwe emerald green */
  --color-accent: #d97706;    /* Zimbabwe gold (ZiG) */
  --color-accent-light: #fef3c7;
  --color-surface: #ffffff;
  --color-surface-subtle: #f8fafc;
  --color-border: #e2e8f0;
  --color-text-main: #0f172a;
  --color-text-muted: #64748b;
  --color-danger: #dc2626;
  --sidebar-width: 260px;
  --topbar-height: 64px;
}

body {
  font-family: var(--font-main);
  background-color: #f1f5f9;
  color: var(--color-text-main);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

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

.app-sidebar {
  width: var(--sidebar-width);
  background-color: var(--color-primary);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.25s ease-in-out;
}

/* Mobile Sidebar Backdrop Overlay */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1040;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.sidebar-backdrop.show {
  opacity: 1;
  visibility: visible;
}

body.sidebar-open {
  overflow: hidden;
}

.sidebar-brand {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand img {
  height: 34px;
  width: auto;
  border-radius: 6px;
}

.sidebar-brand-text {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.2;
}

.sidebar-tenant-badge {
  background-color: rgba(5, 150, 105, 0.2);
  color: #34d399;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
  margin-top: 0.2rem;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.sidebar-nav {
  padding: 1rem 0.75rem;
  flex-grow: 1;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  padding: 0.75rem 0.75rem 0.35rem 0.75rem;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: #cbd5e1;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.15s ease;
  margin-bottom: 0.2rem;
  text-decoration: none;
}

.sidebar-nav .nav-link:hover {
  background-color: var(--color-primary-light);
  color: #ffffff;
}

.sidebar-nav .nav-link.active {
  background-color: var(--color-secondary);
  color: #ffffff;
  font-weight: 600;
}

.sidebar-nav .nav-link i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(0, 0, 0, 0.2);
}

/* Main Content Area */
.app-main {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  height: var(--topbar-height);
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 900;
}

.topbar-title {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--color-text-main);
}

.app-content {
  padding: 2rem;
  flex-grow: 1;
}

/* Cards & Elements */
.card {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  background-color: var(--color-surface);
  margin-bottom: 1.5rem;
}

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

.card-body {
  padding: 1.5rem;
}

/* Stat KPI Cards */
.stat-card {
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background-color: #ffffff;
  padding: 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
}

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

a.stat-card,
.stat-card-clickable {
  text-decoration: none !important;
  color: inherit !important;
  display: flex !important;
  cursor: pointer;
}

a.stat-card:hover,
.stat-card-clickable:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e1;
}

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

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0.25rem 0;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Currency Badges */
.badge-currency-usd {
  background-color: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-weight: 600;
  padding: 0.35em 0.65em;
  border-radius: 6px;
}

.badge-currency-zig {
  background-color: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
  font-weight: 600;
  padding: 0.35em 0.65em;
  border-radius: 6px;
}

/* Data Tables */
.table-responsive {
  -webkit-overflow-scrolling: touch;
}

.table {
  vertical-align: middle;
  margin-bottom: 0;
}

.table thead th {
  background-color: var(--color-surface-subtle);
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--color-border);
  padding: 0.85rem 1rem;
  white-space: nowrap;
}

.table tbody td {
  padding: 0.95rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9rem;
  white-space: nowrap;
}

.table tbody td.wrap-text,
.table tbody td .wrap-text {
  white-space: normal;
}

.table-hover tbody tr:hover {
  background-color: #f8fafc;
}

/* Forms */
.form-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: #334155;
  margin-bottom: 0.4rem;
}

.form-control, .form-select {
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  padding: 0.6rem 0.85rem;
  font-size: 0.925rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.btn-primary {
  background-color: var(--color-secondary);
  border-color: var(--color-secondary);
  font-weight: 600;
  border-radius: 8px;
  padding: 0.6rem 1.25rem;
}

.btn-primary:hover {
  background-color: #047857;
  border-color: #047857;
}

.btn-dark {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  font-weight: 600;
  border-radius: 8px;
}

/* Payslip View Styling */
.payslip-sheet {
  background: #ffffff;
  padding: 2.5rem;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  max-width: 900px;
  margin: 0 auto;
  position: relative;
}

.payslip-header {
  border-bottom: 2px solid var(--color-primary);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.payslip-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--color-primary);
  margin: 0;
}

.payslip-meta-box {
  background-color: var(--color-surface-subtle);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1rem;
  font-size: 0.85rem;
}

.payslip-table-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.payslip-section-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--color-primary);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.payslip-line-item {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0;
  font-size: 0.875rem;
  border-bottom: 1px dashed #f1f5f9;
}

.payslip-summary-box {
  background-color: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  padding: 1.25rem;
  margin-top: 2rem;
}

@media print {
  body {
    background: #ffffff !important;
  }
  .app-sidebar, .app-topbar, .no-print, .btn {
    display: none !important;
  }
  .app-main {
    margin-left: 0 !important;
  }
  .app-content {
    padding: 0 !important;
  }
  .payslip-sheet {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Org Chart Tree */
.org-tree ul {
  padding-top: 20px;
  position: relative;
  transition: all 0.5s;
  display: flex;
  justify-content: center;
}

.org-tree li {
  float: left;
  text-align: center;
  list-style-type: none;
  position: relative;
  padding: 20px 5px 0 5px;
  transition: all 0.5s;
}

.org-node-card {
  border: 1px solid var(--color-border);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  display: inline-block;
  background: #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  min-width: 160px;
}

.org-node-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.org-node-title {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Responsive Mobile & Tablet Media Queries
   ========================================================================== */

/* Large Tablets and Mobile Screens (<= 991.98px) */
@media (max-width: 991.98px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 280px;
    max-width: 85vw;
    z-index: 1050;
    transform: translateX(-100%);
    box-shadow: none;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease;
  }

  .app-sidebar.show {
    transform: translateX(0);
    box-shadow: 6px 0 25px rgba(0, 0, 0, 0.35);
  }

  .app-main {
    margin-left: 0 !important;
    width: 100%;
    min-width: 0;
  }

  .app-topbar {
    padding: 0 1rem;
    height: 58px;
  }

  .topbar-title {
    font-size: 1.1rem;
    max-width: 220px;
  }

  .app-content {
    padding: 1.25rem 1rem;
  }
}

/* Medium & Small Mobile Screens (<= 767.98px) */
@media (max-width: 767.98px) {
  /* Payslip Sheet Mobile Layout */
  .payslip-sheet {
    padding: 1.25rem 1rem;
    border-radius: 8px;
  }

  .payslip-header {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 1rem;
  }

  .payslip-header .text-end {
    text-align: left !important;
  }

  .payslip-table-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .payslip-summary-box {
    padding: 1rem;
  }

  .payslip-title {
    font-size: 1.25rem;
  }

  /* Smooth horizontally scrollable navigation tabs */
  .nav-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 2px;
  }

  .nav-tabs::-webkit-scrollbar {
    height: 3px;
  }

  .nav-tabs::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
  }

  .nav-tabs .nav-item {
    flex: 0 0 auto;
  }

  .nav-tabs .nav-link {
    white-space: nowrap;
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
  }
}

/* Extra Small Phones (<= 575.98px) */
@media (max-width: 575.98px) {
  .app-topbar {
    padding: 0 0.75rem;
    height: 54px;
  }

  .topbar-title {
    font-size: 0.95rem;
    max-width: 140px;
  }

  .app-content {
    padding: 0.85rem 0.65rem;
  }

  .card {
    border-radius: 10px;
    margin-bottom: 1rem;
  }

  .card-header {
    padding: 0.75rem 0.85rem;
    font-size: 0.95rem;
  }

  .card-body {
    padding: 1rem 0.85rem;
  }

  .card-header.d-flex,
  .card-body.d-flex {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-value {
    font-size: 1.35rem;
  }

  .stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  /* Prevent iOS Safari automatic zoom displacement when focusing inputs */
  .form-control,
  .form-select {
    font-size: 16px;
  }

  .btn {
    font-size: 0.85rem;
  }

  /* Hierarchy indentation on mobile */
  .org-tree-branch {
    margin-left: 0.75rem !important;
    padding-left: 0.5rem !important;
  }
}
