﻿* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
}

body {
  color: #172033;
}

/* =========================
   LOGIN
   ========================= */

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  background: linear-gradient(135deg, #eef5fc 0%, #f8fafc 55%, #eaf2fa 100%);
}

.login-card {
  width: 100%;
  max-width: 460px;
  padding: 42px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 18px 55px rgba(15, 45, 75, .12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 38px;
}

.logo {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #0b4a8b;
  color: #fff;
  font-size: 25px;
  font-weight: 800;
}

.brand h1 {
  margin: 0;
  color: #0b2f55;
  font-size: 25px;
  letter-spacing: 1px;
}

.brand p {
  margin: 5px 0 0;
  color: #718096;
  font-size: 13px;
}

.login-title {
  margin-bottom: 28px;
}

.login-title h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.login-title p {
  margin: 0;
  color: #718096;
  font-size: 14px;
}

.form-group {
  margin-bottom: 19px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #334155;
  font-size: 13px;
  font-weight: 600;
}

.form-group input[type="email"],
.form-group input[type="password"] {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #d5dde8;
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: #172033;
  font-family: inherit;
  font-size: 14px;
}

.form-group input:focus {
  border-color: #0b67b2;
  box-shadow: 0 0 0 3px rgba(11, 103, 178, .10);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 4px 0 22px;
  font-size: 13px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #64748b;
}

.remember input {
  accent-color: #0b4a8b;
}

.login-options a {
  color: #0b67b2;
  font-weight: 600;
  text-decoration: none;
}

#loginButton {
  width: 100%;
  height: 47px;
  border: 0;
  border-radius: 9px;
  background: #0b4a8b;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

#loginButton:hover {
  background: #083b70;
}

#loginButton:disabled {
  opacity: .65;
  cursor: not-allowed;
}

#loginMessage {
  min-height: 20px;
  margin-top: 13px;
  font-size: 13px;
}

.login-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid #edf1f5;
  color: #94a3b8;
  font-size: 11px;
}


/* =========================
   ERP DASHBOARD
   ========================= */

.erp-layout {
  min-height: 100vh;
  display: flex;
  background: #f4f7fb;
}

.sidebar {
  width: 250px;
  min-height: 100vh;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: #0b2f55;
  color: #fff;
}

.sidebar-brand {
  height: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #fff;
  color: #0b4a8b;
  font-size: 21px;
  font-weight: 800;
}

.sidebar-brand h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: .7px;
}

.sidebar-brand span {
  display: block;
  margin-top: 3px;
  color: #a9c3dc;
  font-size: 10px;
}

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

.nav-section {
  margin: 19px 9px 7px;
  color: #82a7c9;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.nav-section:first-child {
  margin-top: 2px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  margin: 2px 0;
  border-radius: 7px;
  color: #dbe8f5;
  text-decoration: none;
  font-size: 13px;
  transition: .15s ease;
}

.nav-item:hover {
  background: rgba(255,255,255,.08);
  color: #fff;
}

.nav-item.active {
  background: #1767a9;
  color: #fff;
  font-weight: 600;
}

.nav-item span:first-child {
  width: 20px;
  text-align: center;
  font-size: 14px;
}

.sidebar-bottom {
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,.1);
}

.main-content {
  width: calc(100% - 250px);
  min-height: 100vh;
  margin-left: 250px;
}

.topbar {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  background: #fff;
  border-bottom: 1px solid #e5eaf0;
}

.topbar h1 {
  margin: 0;
  color: #172033;
  font-size: 20px;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #64748b;
  font-size: 13px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #e8f1fa;
  color: #0b4a8b;
  font-weight: 700;
}

.dashboard-content {
  width: 100%;
  box-sizing: border-box;
  padding: 30px;
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 25px;
}

.page-heading h2 {
  margin: 0 0 6px;
  color: #172033;
  font-size: 24px;
}

.page-heading p {
  margin: 0;
  color: #718096;
  font-size: 13px;
}

.primary-button {
  border: 0;
  border-radius: 7px;
  padding: 11px 17px;
  background: #0b4a8b;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.primary-button:hover {
  background: #083b70;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.stat-card {
  padding: 20px;
  background: #fff;
  border: 1px solid #e3e9f0;
  border-radius: 11px;
  box-shadow: 0 3px 12px rgba(15,45,75,.04);
}

.stat-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  border-radius: 9px;
  background: #edf5fc;
  color: #0b4a8b;
  font-size: 16px;
  font-weight: 700;
}

.stat-card h3 {
  margin: 0 0 5px;
  color: #718096;
  font-size: 12px;
  font-weight: 600;
}

.stat-value {
  margin: 0;
  color: #172033;
  font-size: 24px;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 20px;
}

.dashboard-card {
  background: #fff;
  border: 1px solid #e3e9f0;
  border-radius: 11px;
  box-shadow: 0 3px 12px rgba(15,45,75,.04);
  overflow: hidden;
}

.card-header {
  padding: 17px 20px;
  border-bottom: 1px solid #edf1f5;
}

.card-header h3 {
  margin: 0;
  color: #172033;
  font-size: 14px;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 18px;
}

.quick-actions button {
  min-height: 52px;
  border: 1px solid #dce5ee;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  padding: 10px 12px;
}

.quick-actions button:hover {
  border-color: #9bbbd8;
  background: #f7fbff;
}

.empty-state {
  padding: 35px 20px;
  color: #94a3b8;
  text-align: center;
  font-size: 13px;
}


/* =========================
   RESPONSIVE
   ========================= */

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

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

@media (max-width: 700px) {
  .sidebar {
    width: 220px;
  }

  .main-content {
    width: calc(100% - 220px);
    margin-left: 220px;
  }

  .dashboard-content {
  width: 100%;
  box-sizing: border-box;
    padding: 20px;
  }

  .topbar {
    padding: 0 20px;
  }
}

@media (max-width: 600px) {
  .login-page {
    padding: 15px;
  }

  .login-card {
    padding: 28px 22px;
  }

  .login-footer {
    flex-direction: column;
  }

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

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

.page-back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 13px;
  margin-right: 14px;
  border: 1px solid #d9e2ec;
  border-radius: 7px;
  background: #fff;
  color: #52606d;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  vertical-align: middle;
  transition: all .15s ease;
}

.page-back-button:hover {
  border-color: #9bbbd8;
  background: #f7fbff;
  color: #0b4a8b;
}

.page-heading > .page-back-button {
  flex-shrink: 0;
}

.page-heading {
  width: 100%;
  box-sizing: border-box;
}
/* Purchase Product Search */
.product-search-wrap {
  position: relative;
  width: 100%;
}

.item-product-search {
  width: 100%;
  box-sizing: border-box;
}

.product-search-results {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 7px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10);
  z-index: 1000;
}

.product-search-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid #edf2f7;
  background: #fff;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.product-search-result:last-child {
  border-bottom: 0;
}

.product-search-result:hover {
  background: #f7fbff;
}

.product-search-name {
  width: 100%;
  color: #243b53;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

.product-search-code {
  margin-top: 2px;
  color: #7b8794;
  font-size: 11px;
}

.product-search-empty {
  padding: 12px;
  color: #7b8794;
  font-size: 12px;
  text-align: center;
}
.credit-note-page {
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    box-sizing: border-box;
}

.credit-note-page .page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.credit-note-page .page-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

.credit-note-page .page-header p {
    margin: 5px 0 0;
    color: #64748b;
}

.credit-note-page .back-btn {
    padding: 8px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

.credit-note-page .form-card {
    background: #fff;
    border: 1px solid #dbe3ec;
    border-radius: 10px;
    padding: 22px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
}

.credit-note-page .form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 16px;
    align-items: end;
}

.credit-note-page .form-group {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.credit-note-page .form-group-wide {
    grid-column: span 2;
}

.credit-note-page label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.credit-note-page input,
.credit-note-page select,
.credit-note-page textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    color: #0f172a;
    font-size: 14px;
    outline: none;
}

.credit-note-page input:focus,
.credit-note-page select:focus,
.credit-note-page textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .10);
}

.credit-note-page input[readonly] {
    background: #f8fafc;
}

.credit-note-page hr {
    border: 0;
    border-top: 1px solid #e2e8f0;
    margin: 22px 0;
}

.credit-note-page h3 {
    margin: 0 0 16px;
    font-size: 16px;
    color: #1e293b;
}

.credit-note-page .typeahead-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-top: 0;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 6px 14px rgba(15, 23, 42, .12);
    overflow: hidden;
}

.credit-note-page .typeahead-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    border-top: 1px solid #f1f5f9;
}

.credit-note-page .typeahead-item:hover,
.credit-note-page .typeahead-item.active {
    background: #eff6ff;
}

.credit-note-page .typeahead-item span {
    color: #64748b;
    font-size: 12px;
}

.credit-note-page .amount-summary {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin: 20px 0;
}

.credit-note-page .amount-summary > div {
    min-width: 180px;
    padding: 13px 16px;
    border: 1px solid #dbe3ec;
    border-radius: 7px;
    background: #f8fafc;
}

.credit-note-page .amount-summary span {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 5px;
}

.credit-note-page .amount-summary strong {
    font-size: 18px;
}

.credit-note-page .amount-summary .grand-total {
    background: #eef6ff;
    border-color: #bfdbfe;
}

.credit-note-page .amount-summary .grand-total strong {
    font-size: 21px;
}

.credit-note-page .narration-group {
    margin-top: 8px;
}

.credit-note-page .narration-group textarea {
    min-height: 80px;
    resize: vertical;
}

.credit-note-page .form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #e2e8f0;
}

.credit-note-page .form-actions button {
    min-width: 125px;
    min-height: 40px;
    padding: 9px 16px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    font-weight: 600;
}

.credit-note-page .form-actions .btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.credit-note-page .form-actions .btn-secondary {
    background: #fff;
    color: #334155;
}

@media (max-width: 900px) {
    .credit-note-page .form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .credit-note-page .form-group-wide {
        grid-column: span 2;
    }

    .credit-note-page .amount-summary {
        flex-wrap: wrap;
        justify-content: stretch;
    }

    .credit-note-page .amount-summary > div {
        flex: 1;
    }
}

@media (max-width: 600px) {
    .credit-note-page {
        padding: 12px;
    }

    .credit-note-page .form-grid {
        grid-template-columns: 1fr;
    }

    .credit-note-page .form-group-wide {
        grid-column: span 1;
    }

    .credit-note-page .amount-summary {
        flex-direction: column;
    }

    .credit-note-page .amount-summary > div {
        width: 100%;
        box-sizing: border-box;
    }

    .credit-note-page .form-actions {
        flex-wrap: wrap;
    }
}
.nav-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.nav-section::after {
  content: "⌃";
  font-size: 12px;
  color: #82a7c9;
  transition: transform .2s ease;
}

.nav-section.collapsed::after {
  transform: rotate(180deg);
}

/* Sales product search dropdown */
.sales-items-table .search-field {
  position: relative;
}

.sales-items-table .product-results {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 1000;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #d9dee7;
  border-radius: 6px;
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}

.sales-items-table .product-results .search-result {
  padding: 9px 12px;
  cursor: pointer;
  background: #fff;
}

.sales-items-table .product-results .search-result:hover {
  background: #f3f6fa;
}

.sales-items-table .item-description {
  display: block;
  width: 100%;
  margin-top: 6px;
  min-height: 42px;
  resize: vertical;
  box-sizing: border-box;
}

/* Dashboard UI - Stat Cards */
.dashboard-content .stat-card {
  min-height: 112px;
  box-sizing: border-box;
  padding: 22px 22px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 45, 75, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dashboard-content .stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 20px rgba(15, 45, 75, 0.09);
  border-color: #d5dee9;
}

.dashboard-content .stat-card h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.dashboard-content .stat-card .stat-icon {
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  .dashboard-content .stat-card {
    min-height: 100px;
    padding: 18px;
  }
}

/* Sidebar section expand / collapse indicator */
.sidebar .nav-section[role="button"]::after {
  content: "−";
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}

.sidebar .nav-section[role="button"].collapsed::after {
  content: "+";
  transform: none;
  font-size: 16px;
  font-weight: 700;
}

/* Dashboard compact financial cards - UI ONLY */
.dashboard-content .stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-content .stat-card {
  min-height: 88px;
  height: 88px;
  padding: 13px 17px;
  border-radius: 10px;
  box-sizing: border-box;
  justify-content: center;
  box-shadow: none;
}

.dashboard-content .stat-card .stat-icon {
  width: 28px;
  height: 28px;
  min-height: 28px;
  margin-bottom: 5px;
  border-radius: 7px;
  font-size: 0;
}

.dashboard-content .stat-card .stat-icon::before {
  font-size: 14px;
}

.dashboard-content .stat-card h3 {
  margin: 0 0 3px;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 500;
}

.dashboard-content .stat-card .stat-value {
  margin: 0;
  font-size: 21px;
  line-height: 1.15;
  font-weight: 700;
}

.dashboard-content .stat-card:nth-child(1) {
  background: #f0fff4;
  border-color: #c9efd5;
}

.dashboard-content .stat-card:nth-child(1) .stat-icon {
  background: #dcfce7;
}

.dashboard-content .stat-card:nth-child(1) h3 {
  color: #159447;
}

.dashboard-content .stat-card:nth-child(2) {
  background: #fff5f5;
  border-color: #f3d0d0;
}

.dashboard-content .stat-card:nth-child(2) .stat-icon {
  background: #fee2e2;
}

.dashboard-content .stat-card:nth-child(2) h3 {
  color: #e53935;
}

.dashboard-content .stat-card:nth-child(3) {
  background: #f5f9ff;
  border-color: #d5e2f3;
}

.dashboard-content .stat-card:nth-child(3) .stat-icon {
  background: #e6effc;
}

.dashboard-content .stat-card:nth-child(3) h3 {
  color: #42617f;
}

.dashboard-content .stat-card:nth-child(4),
.dashboard-content .stat-card:nth-child(5),
.dashboard-content .stat-card:nth-child(6) {
  background: #ffffff;
}

@media (max-width: 900px) {
  .dashboard-content .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .dashboard-content .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Dashboard - 4 compact cards per row */
.dashboard-content .stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-content .stat-card {
  min-height: 82px;
  height: 82px;
  padding: 11px 14px;
}

.dashboard-content .stat-card .stat-icon {
  width: 25px;
  height: 25px;
  min-height: 25px;
  margin-bottom: 4px;
}

.dashboard-content .stat-card h3 {
  font-size: 11px;
  margin-bottom: 2px;
}

.dashboard-content .stat-card .stat-value {
  font-size: 19px;
}

@media (max-width: 1050px) {
  .dashboard-content .stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 750px) {
  .dashboard-content .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 500px) {
  .dashboard-content .stats-grid {
    grid-template-columns: 1fr;
  }
}
