* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f3f6fb;
  color: #182235;
  font: 14px/1.5 Inter, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
}

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

/* Sidebar & Brand Management */
.side {
  width: 250px;
  background: #10243d;
  color: #dbe8f7;
  padding: 20px 14px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 14px;
  text-decoration: none;
}

.brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.brand-subtitle,
.brand small {
  display: block;
  color: #8fa9c5;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  margin-top: 2px;
  text-transform: uppercase;
}

.nav a {
  display: block;
  padding: 11px 13px;
  color: #c8d7e8;
  text-decoration: none;
  border-radius: 9px;
  margin: 4px 0;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.nav a:hover,
.nav a.active {
  background: #1c3d60;
  color: #ffffff;
}

/* Main Area & Topbar */
.main {
  flex: 1;
  min-width: 0;
}

.top {
  height: 68px;
  background: #ffffff;
  border-bottom: 1px solid #e5eaf1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.top-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}

.top-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.15));
}

.content {
  padding: 26px;
  max-width: 1400px;
  margin: auto;
}

.muted {
  color: #718096;
}

.title {
  font-size: 24px;
  font-weight: 800;
  margin: 0 0 5px;
}

.sub {
  color: #718096;
  margin: 0 0 22px;
}

/* Summary Cards */
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
  margin: 18px 0 22px;
}

.card,
.panel {
  background: #ffffff;
  border: 1px solid #e7ecf2;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 3px 12px rgba(23, 43, 77, 0.03);
}

.card .label {
  color: #718096;
  font-size: 12px;
}

.card .value {
  font-size: 24px;
  font-weight: 800;
  margin-top: 8px;
}

.card .hint {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

.panel {
  margin-bottom: 18px;
}

.panel h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  padding: 10px 14px;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
  background: #0b8f67;
  color: #ffffff;
  transition: background 0.15s;
}

.btn:hover {
  background: #097554;
}

.btn.secondary {
  background: #eaf0f6;
  color: #24364b;
}

.btn.secondary:hover {
  background: #dce5ef;
}

.btn.danger {
  background: #fee2e2;
  color: #b91c1c;
}

.btn.danger:hover {
  background: #fecaca;
}

.btn.small {
  padding: 6px 9px;
  font-size: 12px;
}

/* Forms & Inputs */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 13px;
  min-width: 0;
}

.field label {
  font-weight: 700;
  color: #526174;
  font-size: 12px;
}

.field input,
.field select,
.field textarea,
.search {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d8e0e9;
  border-radius: 9px;
  background: #ffffff;
  font: inherit;
  color: #182235;
  transition: border-color 0.15s;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search:focus {
  outline: 2px solid #b9e6d7;
  border-color: #0b8f67;
}

.formgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}

/* Tables */
.tablewrap {
  overflow: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 620px;
}

th,
td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid #edf1f5;
  vertical-align: middle;
}

th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #718096;
  background: #f8fafc;
}

td {
  font-size: 13px;
}

.right {
  text-align: right;
}

.alert {
  padding: 12px 14px;
  border-radius: 9px;
  margin-bottom: 15px;
  background: #e8f7f0;
  color: #08764f;
}

.alert.error {
  background: #fff0f0;
  color: #b42318;
}

.actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.inline {
  display: inline;
}

.empty {
  text-align: center;
  color: #94a3b8;
  padding: 26px;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filters .field {
  min-width: 155px;
  margin: 0;
}

/* Login Page Styling */
.loginbody {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #10243d 0%, #0c3e4a 50%, #0b8f67 100%);
  padding: 20px;
}

.loginbox {
  width: min(420px, 92vw);
  background: #ffffff;
  padding: 36px 32px 30px;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(6, 23, 42, 0.4);
}

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

.login-logo {
  width: 110px;
  height: 110px;
  object-fit: contain;
  margin: 0 auto 14px;
  display: block;
  filter: drop-shadow(0 6px 16px rgba(11, 143, 103, 0.2));
  transition: transform 0.2s ease;
}

.login-logo:hover {
  transform: scale(1.04);
}

.loginbox h1 {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 800;
  color: #10243d;
  letter-spacing: 0.5px;
}

.loginbox p {
  color: #718096;
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
}

.foot {
  padding: 20px;
  color: #94a3b8;
  text-align: center;
  font-size: 11px;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 20px;
  background: #e8f7f0;
  color: #08764f;
  font-size: 11px;
  font-weight: 700;
}

.totalrow {
  font-weight: 800;
  background: #f8fafc;
}

/* Report Tabs & Navigation */
.report-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 0;
  flex-wrap: wrap;
}

.tab-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  color: #4a5568;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s ease;
  border-radius: 8px 8px 0 0;
  background: transparent;
}

.tab-item:hover {
  color: #0b8f67;
  background: #f0fdf4;
}

.tab-item.active {
  color: #0b8f67;
  border-bottom-color: #0b8f67;
  background: #ffffff;
}

.tab-badge {
  background: #e2e8f0;
  color: #4a5568;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 12px;
  font-weight: 700;
}

.tab-item.active .tab-badge {
  background: #0b8f67;
  color: #ffffff;
}

/* Quick Filter Presets */
.quick-filters {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
}

.quick-label {
  font-size: 12px;
  font-weight: 700;
  color: #718096;
  margin-right: 4px;
}

.quick-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  background: #edf2f7;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.quick-btn:hover {
  background: #cbd5e1;
  color: #0f172a;
}

.quick-btn.active {
  background: #0b8f67;
  color: #ffffff;
}

/* Print Signature Block */
.print-signature {
  display: none;
}

/* Report Header (Screen & Print) */
.report-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #edf1f5;
}

.report-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .side {
    width: 210px;
  }
  .content {
    padding: 18px;
  }
}

@media (max-width: 650px) {
  .layout {
    display: block;
  }
  .side {
    width: 100%;
    padding: 12px 14px;
  }
  .brand {
    padding: 4px 4px 10px;
    margin-bottom: 0;
    border-bottom: none;
  }
  .brand-logo {
    width: 38px;
    height: 38px;
  }
  .brand-title {
    font-size: 15px;
  }
  .nav {
    display: flex;
    overflow-x: auto;
    gap: 6px;
    padding-top: 6px;
  }
  .nav a {
    white-space: nowrap;
    margin: 0;
    padding: 8px 12px;
    font-size: 12px;
  }
  .top {
    height: 56px;
    padding: 0 16px;
  }
  .content {
    padding: 16px;
  }
  .cards {
    gap: 10px;
  }
  .card {
    padding: 14px;
  }
  .card .value {
    font-size: 20px;
  }
  .title {
    font-size: 21px;
  }
  .formgrid {
    grid-template-columns: 1fr;
  }
  .toolbar {
    align-items: stretch;
  }
  .toolbar .search {
    max-width: none;
  }
  .panel {
    padding: 15px;
  }
}

/* Print Stylesheet */
@media print {
  body {
    background: #ffffff;
  }
  .side,
  .top,
  .no-print,
  .foot {
    display: none !important;
  }
  .content {
    padding: 0;
    max-width: none;
  }
  .panel,
  .card {
    box-shadow: none;
    border: 0;
    padding: 0;
  }
  .tablewrap {
    overflow: visible;
  }
  table {
    min-width: 0;
  }
  th,
  td {
    padding: 7px;
    border: 1px solid #ddd;
  }
  .title {
    font-size: 20px;
  }
  .sub {
    margin-bottom: 10px;
  }
  .report-header {
    border-bottom: 2px solid #10243d;
    padding-bottom: 12px;
    margin-bottom: 16px;
  }
  .report-logo {
    width: 60px;
    height: 60px;
  }
  .print-signature {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding: 0 40px;
    page-break-inside: avoid;
  }
  .signature-box {
    text-align: center;
    width: 220px;
    font-size: 13px;
  }
  .signature-line {
    margin-top: 75px;
    border-bottom: 1px solid #111;
    font-weight: 700;
  }
}
