@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400;
  font-stretch: normal;
  font-display: swap;
  src: url(/vendor/roboto/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWubEbWmT.ttf) format('truetype');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 500;
  font-stretch: normal;
  font-display: swap;
  src: url(/vendor/roboto/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWub2bWmT.ttf) format('truetype');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 600;
  font-stretch: normal;
  font-display: swap;
  src: url(/vendor/roboto/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWuYaammT.ttf) format('truetype');
}
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 700;
  font-stretch: normal;
  font-display: swap;
  src: url(/vendor/roboto/KFOMCnqEu92Fr1ME7kSn66aGLdTylUAMQXC89YmC2DPNWuYjammT.ttf) format('truetype');
}


:root {
  --farm-dark: #123524;
  --farm-sidebar: #173c2b;
  --farm-green: #2e7d32;
  --farm-green-light: #264d35;
  --farm-bg: #0f1712;
  --farm-surface: #18231d;
  --farm-border: #2c3e33;
  --farm-text: #edf5ef;
  --farm-muted: #a8b9ad;
}

.pwa-install-banner {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1090;
  display: grid;
  grid-template-columns: 52px minmax(180px, 1fr) auto 28px;
  align-items: center;
  gap: 12px;
  width: min(520px, calc(100vw - 32px));
  padding: 13px;
  border: 1px solid rgba(102, 187, 106, .42);
  border-radius: 16px;
  background: linear-gradient(135deg, #152a1c, #0d1711);
  box-shadow: 0 18px 55px rgba(0, 0, 0, .5);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .22s ease, transform .22s ease;
}
.pwa-install-banner.show { opacity: 1; transform: translateY(0); }
.pwa-install-banner > img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; }
.pwa-install-copy { min-width: 0; }
.pwa-install-copy strong { display: block; color: #fff; font-size: .95rem; }
.pwa-install-copy span { display: block; margin-top: 2px; color: var(--farm-muted); font-size: .78rem; line-height: 1.35; }
.pwa-install-close { align-self: start; padding: 1px 4px; border: 0; background: transparent; color: #9fb2a5; }
.pwa-install-close:hover { color: #fff; }
@media (max-width: 575.98px) {
  .pwa-install-banner { right: 12px; bottom: 12px; grid-template-columns: 44px 1fr 26px; width: calc(100vw - 24px); }
  .pwa-install-banner > img { width: 44px; height: 44px; }
  .pwa-install-banner .btn { grid-column: 1 / -1; width: 100%; }
}

body,
.app-wrapper,
.app-main {
  background: var(--farm-bg) !important;
  font-family: Roboto, Arial, sans-serif !important;
  color: var(--farm-text) !important;
}

.app-header {
  background: linear-gradient(90deg, var(--farm-dark), #1b5e20) !important;
  border-bottom: 1px solid rgba(255,255,255,.12) !important;
  color: #fff !important;
  position: sticky !important;
  top: 0;
  z-index: 1040;
  width: 100%;
  box-shadow: 0 3px 12px rgba(0,0,0,.28);
}

.app-header a,
.app-header .btn-link {
  color: #fff !important;
}

.app-header .badge {
  background: #a5d6a7 !important;
  color: #123524 !important;
}

.farm-notifications { position: relative; }
.notification-toggle { position: relative; width: 38px; height: 38px; padding: 0 !important; border-radius: 50% !important; font-size: 1.05rem; }
.notification-toggle:hover { background: rgba(255,255,255,.12) !important; }
.notification-count { position: absolute; top: 0; right: -2px; min-width: 18px; height: 18px; padding: 0 4px; border: 2px solid #1b5e20; border-radius: 10px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; line-height: 14px; text-align: center; }
.farm-notification-menu { position: absolute; z-index: 1080; top: calc(100% + 9px); right: 0; width: min(390px, calc(100vw - 24px)); overflow: hidden; border: 1px solid var(--farm-border); border-radius: 12px; background: #18231d; box-shadow: 0 14px 34px rgba(0,0,0,.45); color: var(--farm-text); }
.notification-menu-header { display: flex; justify-content: space-between; align-items: center; padding: 13px 15px; border-bottom: 1px solid var(--farm-border); }
.notification-menu-header span { color: var(--farm-muted); font-size: .75rem; }
.notification-list { max-height: 390px; overflow-y: auto; }
.notification-item { display: grid; grid-template-columns: 34px 1fr; gap: 10px; padding: 12px 15px; border-bottom: 1px solid var(--farm-border); color: var(--farm-text) !important; text-decoration: none; }
.notification-item:hover { background: #223229; }
.notification-item-icon { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: #fff; }
.notification-item-icon.danger { background: #b91c1c; }.notification-item-icon.warning { background: #b45309; }.notification-item-icon.info { background: #2563eb; }
.notification-item strong { display: block; margin-bottom: 2px; font-size: .85rem; }
.notification-item small { display: block; color: var(--farm-muted); line-height: 1.35; }
.notification-empty { padding: 28px 15px; color: var(--farm-muted); text-align: center; }
.notification-menu-footer { display: block; padding: 11px 15px; background: #142019; color: #a5d6a7 !important; text-align: center; text-decoration: none; font-size: .82rem; font-weight: 600; }
.sync-status { min-width: 92px; white-space: nowrap; }
.sync-status.is-offline { border-color: #f59e0b !important; color: #fbbf24 !important; }
.sync-status.has-pending { border-color: #60a5fa !important; color: #93c5fd !important; }
.sync-status.has-failed { border-color: #f87171 !important; color: #fca5a5 !important; }
.offline-toast { position: fixed; z-index: 2000; right: 18px; bottom: 18px; max-width: min(390px,calc(100vw - 30px)); padding: 12px 15px; border: 1px solid #3f5b49; border-radius: 12px; background: #182b20; color: #e8f5e9; box-shadow: 0 12px 28px rgba(0,0,0,.42); }

.app-sidebar {
  background: var(--farm-sidebar) !important;
  color: #eef7f0 !important;
}

.sidebar-brand {
  background: var(--farm-dark) !important;
  border-bottom: 1px solid rgba(255,255,255,.1) !important;
}

.brand-link {
  color: #fff !important;
  font-weight: 700 !important;
  letter-spacing: .25px;
}

.farm-brand-logo { width:34px; height:34px; object-fit:contain; border-radius:50%; margin-right:9px; }
.login-logo a::before { content:""; display:block; width:120px; height:120px; margin:0 auto 12px; border-radius:50%; background:url('/logos/20260809_202739822_iOS.png') center/contain no-repeat; }

.sidebar-menu .nav-link {
  border-radius: 9px !important;
  color: #e8f5e9 !important;
  margin: 3px 10px !important;
}

.sidebar-menu .nav-icon {
  width: 1.45rem !important;
  margin-right: .45rem !important;
  text-align: center;
  color: #a5d6a7;
}

.sidebar-menu .nav-link:hover,
.sidebar-menu .nav-link.active {
  background: var(--farm-green-light) !important;
  color: #d8f3dc !important;
}

.sidebar-menu .nav-link.active .nav-icon { color: #fff; }

.app-content-header h3,
.app-content h1,
.app-content h2 {
  color: var(--farm-text);
  font-weight: 700;
}

.card {
  background: var(--farm-surface) !important;
  color: var(--farm-text) !important;
  border: 0 !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 18px rgba(0,0,0,.28) !important;
}

.card-header {
  background: #1c2a22 !important;
  border-bottom: 1px solid var(--farm-border) !important;
  color: var(--farm-text) !important;
  font-weight: 600;
}

.btn-primary,
.btn-success {
  background: var(--farm-green) !important;
  border-color: var(--farm-green) !important;
}

.btn-primary:hover,
.btn-success:hover {
  background: #1b5e20 !important;
  border-color: #1b5e20 !important;
}

.form-control,
.form-select,
.input-group-text {
  background-color: #111b15 !important;
  border-color: #3a5041 !important;
  color: var(--farm-text) !important;
  border-radius: 8px !important;
}

.form-control::placeholder { color: #829488 !important; }
.form-control:disabled,.form-control[readonly] { background-color: #202d25 !important; color: #c5d4c9 !important; }
.form-label,.text-muted { color: var(--farm-muted) !important; }

.form-control:focus,
.form-select:focus {
  border-color: #66a76a !important;
  box-shadow: 0 0 0 .2rem rgba(46,125,50,.16) !important;
}

.table thead th {
  background: #223229 !important;
  color: #dff0e3 !important;
  border-bottom: 0 !important;
}

.table { color: var(--farm-text) !important; --bs-table-bg: transparent !important; --bs-table-color: var(--farm-text) !important; --bs-table-hover-bg: #223229 !important; --bs-table-hover-color: #fff !important; }
.table td { border-color: var(--farm-border) !important; }
.dropdown-menu,.modal-content { background:#1c2a22 !important; color:var(--farm-text) !important; border-color:var(--farm-border) !important; }

.app-footer {
  background: #131e18 !important;
  color: var(--farm-muted) !important;
  border-top: 1px solid var(--farm-border) !important;
}

html, body { max-width: 100%; overflow-x: hidden; }
img, svg, canvas { max-width: 100%; }
.row > * { min-width: 0; }
.app-content > .container-fluid { width: 100%; max-width: 1680px; margin-inline: auto; }
.app-header .container-fluid { gap: .5rem; }
.user-summary { display: inline-flex; align-items: center; min-width: 0; max-width: 220px; overflow: hidden; color: #fff !important; text-overflow: ellipsis; white-space: nowrap; }
.table-responsive { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; scrollbar-color: #476452 #18231d; }
.table-responsive > .table { margin-bottom: 0; }
.table th, .table td { vertical-align: middle; }
.table-search-box { width: min(100%, 320px); }
.form-control, .form-select, textarea, .input-group { max-width: 100%; }
.btn { white-space: normal; }
.sidebar-menu .nav-link { min-height: 42px; display: flex; align-items: center; }
.modal-dialog { width: auto; max-width: min(720px, calc(100vw - 24px)); margin-inline: auto; }
.login-box { width: min(400px, calc(100vw - 24px)) !important; }

@media (pointer: coarse) {
  .btn:not(.btn-sm), .form-control, .form-select { min-height: 44px; }
  .btn-sm { min-height: 38px; }
  .sidebar-menu .nav-link { min-height: 46px; }
}

@media (max-width: 991.98px) {
  .app-content-header, .app-content { padding-left: 1rem; padding-right: 1rem; }
  .card-header.d-flex, .card-body>.d-flex { gap: .75rem; }
  .report-heading img { max-width: 42%; }
}

@media (max-width: 767.98px) {
  .app-content-header { padding-top: .85rem; padding-bottom: .5rem; }
  .app-content { padding-top: .5rem; }
  .card { border-radius: 10px !important; }
  .card-header, .card-body, .card-footer { padding: .85rem; }
  .d-flex.justify-content-between { gap: .75rem; flex-wrap: wrap; }
  .app-content h1.h3 { font-size: 1.35rem; }
  .app-content h2 { font-size: 1.2rem; }
  .w-auto { width: 100% !important; }
  .table-search-box { width: 100%; }
  .report-heading { align-items: flex-start; }
  .report-heading img { width: 170px; max-width: 45%; }
}

@media (max-width: 575.98px) {
  .app-header .container-fluid { padding: .4rem .65rem; }
  .app-header .ms-auto { gap: .25rem !important; min-width: 0; }
  .user-summary { max-width: 105px; font-size: .82rem; }
  .logout-label { display: none; }
  .app-content, .app-content-header { padding-left: .7rem; padding-right: .7rem; }
  .app-content-header h3 { overflow: hidden; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
  .card-header, .card-body, .card-footer { padding: .75rem; }
  .card-header>.row { margin-left: 0; margin-right: 0; }
  .form-control, .form-select { font-size: 16px; }
  .input-group { max-width: 100% !important; }
  .alert { padding: .7rem .8rem; font-size: .88rem; }
  .expense-total-card { width: 100%; min-width: 0 !important; }
  .farm-notification-menu { position: fixed; top: 58px; right: 10px; left: 10px; width: auto; max-height: calc(100dvh - 70px); }
  .notification-list { max-height: calc(100dvh - 170px); }
  .sync-status { min-width: 38px; width: 38px; padding-right: 0; padding-left: 0; }
  .sync-status span { display: none; }
  .app-footer { padding: .75rem; text-align: center; font-size: .78rem; }
  .attendance-grid { font-size: .7rem; }
  .attendance-grid th, .attendance-grid td { min-width: 36px; padding: .3rem; }
  .attendance-grid .employee-name { min-width: 145px; }
  .attendance-grid input { width: 22px !important; height: 22px !important; }

  .mobile-card-table, .mobile-card-table tbody { display: block; width: 100%; }
  .mobile-card-table thead { display: none; }
  .mobile-card-table tbody { padding: .7rem; }
  .mobile-card-table tbody tr { display: block; overflow: hidden; margin-bottom: .75rem; border: 1px solid var(--farm-border); border-radius: 10px; background: #1c2a22; }
  .mobile-card-table tbody tr:last-child { margin-bottom: 0; }
  .mobile-card-table tbody td { position: relative; display: block; width: 100%; min-height: 40px; padding: .58rem .7rem .58rem 42% !important; border-bottom: 1px solid var(--farm-border) !important; text-align: left !important; white-space: normal !important; overflow-wrap: anywhere; }
  .mobile-card-table tbody td::before { content: attr(data-label); position: absolute; top: .58rem; left: .7rem; width: 36%; color: var(--farm-muted); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .025em; }
  .mobile-card-table tbody td:last-child { border-bottom: 0 !important; }
  .mobile-card-table tbody td[colspan] { padding: 1rem !important; text-align: center !important; }
  .mobile-card-table tbody td[colspan]::before, .mobile-card-table tbody td[data-label=""]::before { display: none; }
  .mobile-card-table tbody td .btn { margin: 2px 2px 2px 0; }
  .mobile-card-table tbody td .form-control, .mobile-card-table tbody td .form-select { width: 100%; }
}

@media (max-width: 359.98px) {
  .user-summary { max-width: 72px; }
  .farm-brand-logo { width: 30px; height: 30px; }
  .mobile-card-table tbody td { padding-left: 46% !important; }
  .mobile-card-table tbody td::before { width: 40%; }
}

.print-only { display: none; }

@media print {
  @page { size: A4; margin: 14mm; }
  .app-header, .app-sidebar, .app-footer, .app-content-header, .no-print { display: none !important; }
  .print-only { display: flex !important; }
  body, .app-wrapper, .app-main, .app-content { background: #fff !important; color: #111 !important; }
  .app-main { margin-left: 0 !important; min-height: auto !important; }
  .app-content, .container-fluid { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .card { background: #fff !important; color: #111 !important; border: 1px solid #c9c9c9 !important; box-shadow: none !important; break-inside: avoid; }
  .card-header, .table thead th { background: #edf3ee !important; color: #111 !important; }
  .table, .table td, .table th, .text-muted { color: #111 !important; border-color: #b7b7b7 !important; }
  .mobile-card-table { display: table !important; width: 100% !important; }
  .mobile-card-table thead { display: table-header-group !important; }
  .mobile-card-table tbody { display: table-row-group !important; padding: 0 !important; }
  .mobile-card-table tbody tr { display: table-row !important; border: 0 !important; background: transparent !important; }
  .mobile-card-table tbody td { position: static !important; display: table-cell !important; width: auto !important; min-height: 0 !important; padding: .45rem !important; white-space: normal !important; }
  .mobile-card-table tbody td::before { display: none !important; }
  .report-heading { align-items: center; gap: 18px; margin-bottom: 20px; border-bottom: 2px solid #2e7d32; padding-bottom: 12px; }
  .report-heading img { width: 190px; max-height: 72px; object-fit: contain; object-position: left center; }
  .report-heading h1 { margin: 0 0 4px; font-size: 24px; color: #173c2b; }
  .report-heading p { margin: 0; color: #555; }
}
/* Keep navigation within the visible screen, with its own scroll area. */
@media screen {
  body.layout-fixed .app-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .app-sidebar .sidebar-brand { flex: 0 0 auto; }
  .app-sidebar .sidebar-wrapper {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    scrollbar-width: thin;
    scrollbar-color: #94bda4 #173c2b;
  }
  .app-sidebar .sidebar-wrapper::-webkit-scrollbar-thumb { background: #94bda4; border-radius: 8px; }
  .app-main { min-width: 0; }
}
@media screen and (max-width: 991.98px) {
  body.sidebar-open { overflow-y: hidden; }
}
