/* ============ SpotComm Global ERP — Official Brand Theme ============ */
:root {
  --primary: #1e3a6d;
  /* SpotComm purple */
  --primary-2: #fff;
  --primary-dark: #3d1d63;
  --accent: #1e3a6d;
  /* lighter purple accent */
  --accent-2: #1e3a6d;
  --bg: #f7f5fb;
  --card: #ffffff;
  --text: #fff;
  --muted: #7a6b90;
  --border: #e8e2f0;
  --success: #16a34a;
  --warn: #f59e0b;
  --danger: #dc2626;
  --shadow: 0 2px 12px rgba(90, 45, 140, 0.10);
  --shadow-lg: 0 8px 30px rgba(90, 45, 140, 0.18);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif
}

html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-size: 14px
}

.hidden {
  display: none !important
}

button {
  cursor: pointer;
  border: none;
  font-family: inherit
}

a {
  cursor: pointer;
  text-decoration: none;
  color: inherit
}

input,
select,
textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  background: #fff;
  width: 100%
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent)
}

table {
  width: 100%;
  border-collapse: collapse
}

th,
td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: #000
}
.b{
  color: #000
}
th {
  background: #f8fafc;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .4px;
  font-weight: 600;
   color: #000
}

tr:hover td {
  background: #fafbfd;
   color:#000
}

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


  .main{
  display: flex;
  flex-direction: column;
}

.page-container{
  flex: 1;
}

.dashboard-footer{
  position: static;
  width: 100%;
  text-align: center;
  padding: 14px 20px;
  margin-top: 20px;
  font-size: 12px;
  color: #777;
  background: transparent;
}

.dashboard-footer strong{
  color: #734b93;
  font-weight: 700;
}
.topbar{
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.search{
  flex: 1;
}

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

.top-logo{
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-left: 15px;
}

.top-logo .logo{
  width: 130px;
  height: auto;
  object-fit: contain;
  display: block;
}

.login-screen {
  position: fixed;
  inset: 0;
  background-image: url("../assets/hmr.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: center;
  z-index: 9999;
}

.login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .08) 0%, transparent 40%), radial-gradient(circle at 80% 80%, rgba(255, 255, 255, .06) 0%, transparent 40%);
  pointer-events: none
}

.login-card {
  background: #1e3a6d;
  border-radius: 14px;
  padding: 42px 40px;
  width: 420px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1
}

.login-brand {
  text-align: center;
  margin-bottom: 26px
}

.brand-logo {
  max-width: 140px;
  height: auto;
  margin: 0 auto 14px;
  display: block
}

.sidebar-logo {
  max-width: 100px;
  height: auto;
  display: block;
  filter: brightness(0) invert(1)
}

.login-brand .tagline {
  color: var(--text);
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600
}

.login-brand .sub {
  color: #fff;
  font-weight: 600;
  margin-top: 4px;
  font-size: 12px
}

.login-form label {
  display: block;
  font-size: 12px;
  color: #fff;
  margin: 12px 0 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px
}

.login-form button {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #fff, #1e3a6d);
  color: #000000;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 20px;
  letter-spacing: .3px
}
.dashboard-footers {
  margin:auto;
  text-align: center;
  margin-top: 20px;
}
.login-form button:hover {
  opacity: .92
}

.login-form .hint {
  text-align: center;
  color: #fff;
  font-size: 11px;
  margin-top: 14px
}

/* ============ APP LAYOUT ============ */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden
}

.sidebar {
  width: 240px;
  background: #1e3a6d;
  color: #fff;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0
}

.sidebar .brand {
  padding: 20px 18px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: rgba(0, 0, 0, .15)
}

.sidebar .brand h2 {
  font-size: 17px;
  line-height: 1
}

.sidebar .brand span {
  font-size: 11px;
  color: #d4b5e8
}

.sidebar nav {
  flex: 1;
  padding: 8px 0
}

.nav-group {
  padding: 14px 18px 6px;
  font-size: 10px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .6px;
  font-weight: 600
}

.nav-item {
  display: block;
  padding: 10px 18px;
  color: #e2d4f0;
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: all .15s
}

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

.nav-item.active {
 background: #fff;
    color: #000;
    border-left-color: #1e3a6d;
    font-weight: 600;
}

.sidebar-footer {
  padding: 12px 18px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: #c4a3dd;
  font-size: 11px;
  text-align: center
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden
}

.topbar {
  height: 62px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 20px;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .03)
}

.search {
  flex: 1;
  position: relative;
  max-width: 520px
}

.search input {
  padding: 9px 14px;
  border-radius: 8px;
  background: #f4f7fb;
  border: 1px solid transparent
}

.search input:focus {
  background: #fff;
  border-color: var(--accent)
}

.search-results {
  position: absolute;
  top: 46px;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  max-height: 340px;
  overflow-y: auto;
  z-index: 50
}

.search-results .sr-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px
}

.search-results .sr-item:hover {
  background: #f4f7fb
}

.search-results .sr-item small {
  color: var(--muted);
  display: block;
  margin-top: 2px
}

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

.btn-icon {
  background: #f4f7fb;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 16px;
  position: relative
}

.btn-icon:hover {
  background: #e2e8f0
}

.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 5px;
  background: #f4f7fb;
  border-radius: 24px
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3d1d63, #1e3a6d);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px
}

.user-chip div div {
  font-size: 13px;
  font-weight: 600
}

.user-chip small {
  color: var(--muted);
  font-size: 11px
}

.logout {
  background: transparent;
  color: var(--danger);
  font-size: 16px;
  margin-left: 6px
}

.notif-panel {
  position: absolute;
  top: 62px;
  right: 20px;
  width: 360px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 14px;
  z-index: 100;
  max-height: 480px;
  overflow-y: auto
}

.notif-panel h3 {
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--primary)
}

.notif-item {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12px
}

.notif-item.danger {
  border-left: 3px solid var(--danger);
  background: #fef2f2
}

.notif-item.warn {
  border-left: 3px solid var(--warn);
  background: #fffbeb
}

.notif-item.info {
  border-left: 3px solid var(--accent);
  background: #eff6ff
}

.page-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px
}

/* ============ COMPONENTS ============ */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px
}

.page-header h1 {
  font-size: 22px;
  color: var(--primary)
}

.page-header p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px
}

.breadcrumb {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px
}

.btn {
  padding: 9px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px
}

.btn-primary {
  background: var(--accent);
  color: #fff
}

.btn-primary:hover {
  background: var(--accent-2)
}

.btn-dark {
  background: var(--primary);
  color: #fff
}

.btn-dark:hover {
  background: var(--primary-2)
}

.btn-success {
  background: var(--success);
  color: #fff
}

.btn-warn {
  background: var(--warn);
  color: #fff
}

.btn-danger {
  background: var(--danger);
  color: #fff
}

.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--border)
}

.btn-outline:hover {
  background: #f4f7fb
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 5px
}

.card {
  background: var(--card);
  border-radius: 10px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px
}

.card-title {
  font-size: 15px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center
}

.grid {
  display: grid;
  gap: 16px
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr)
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr)
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr)
}

.grid-5 {
  grid-template-columns: repeat(5, 1fr)
}

@media (max-width:1100px) {

  .grid-4,
  .grid-5 {
    grid-template-columns: repeat(2, 1fr)
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr)
  }
}

@media (max-width:700px) {

  .grid-2,
  .grid-3,
  .grid-4,
  .grid-5 {
    grid-template-columns: 1fr
  }

  .sidebar {
    width: 64px
  }

  .sidebar .brand h2,
  .sidebar .brand span,
  .nav-item {
    font-size: 11px;
    padding: 8px
  }
}

.stat-card {
  background: #fff;
  border-radius: 10px;
  padding: 18px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden
}

.stat-card .icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 10px
}

.stat-card h3 {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 4px
}

.stat-card .val {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary)
}

.stat-card .delta {
  font-size: 11px;
  margin-top: 6px;
  color: var(--success)
}

.stat-card .delta.down {
  color: var(--danger)
}

.pill {
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  display: inline-block
}

.pill-success {
  background: #dcfce7;
  color: #166534
}

.pill-warn {
  background: #fef3c7;
  color: #92400e
}

.pill-danger {
  background: #fee2e2;
  color: #991b1b
}

.pill-info {
  background: #dbeafe;
  color: #1e40af
}

.pill-default {
  background: #e2e8f0;
  color: #475569
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px
}

.row>* {
  flex: 1;
  min-width: 140px
}

.row>.auto {
  flex: none
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap
}

.toolbar .left,
.toolbar .right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap
}

.table-wrap {
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden
}

.table-wrap table {
  margin: 0
}

.empty {
  text-align: center;
  padding: 40px;
  color: var(--muted)
}

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

.form-grid .full {
  grid-column: span 2
}

.form-grid label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px
}

/* ============ MODAL ============ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 37, 64, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  overflow-y: auto
}

.modal {
  background: #fff;
  border-radius: 12px;
  width: 680px;
  max-width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg)
}

.modal.lg {
  width: 900px
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center
}

.modal-header h3 {
  color: var(--primary);
  font-size: 16px
}

.modal-header button {
  background: transparent;
  font-size: 18px;
  color: var(--muted)
}

.modal-body {
  padding: 22px;
  overflow-y: auto
}

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  opacity: 0;
  transform: translateY(10px);
  transition: .25s;
  font-size: 13px
}

.toast.show {
  opacity: 1;
  transform: translateY(0)
}

.toast.success {
  background: var(--success)
}

.toast.error {
  background: var(--danger)
}

.toast.warn {
  background: var(--warn)
}

/* ============ MISC ============ */
.tag {
  display: inline-block;
  background: #eff6ff;
  color: #1e40af;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  margin: 2px;
  font-weight: 600
}

.kbd {
  font-family: monospace;
  background: #f4f7fb;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
  font-size: 11px
}

.barcode-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  background: #fff;
  border: 1px dashed var(--border);
  border-radius: 8px
}

.barcode-box svg {
  max-width: 200px
}

.chart-box {
  position: relative;
  height: 280px
}

.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 18px
}

.tab {
  padding: 10px 18px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px
}

.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent)
}

.ai-chat {
  height: 520px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden
}

.ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background: #f8fafc
}

.ai-msg {
  margin-bottom: 12px;
  display: flex;
  gap: 10px
}

.ai-msg.user {
  flex-direction: row-reverse
}

.ai-msg .bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 13px;
  white-space: pre-wrap;
    color: #000;

}
li{
   color: #000;
}
.ai-msg.user .bubble {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent)
}

.ai-msg .avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  font-size: 14px
}

.ai-input {
  display: flex;
  gap: 8px;
  padding: 14px;
  border-top: 1px solid var(--border);
  background: #fff
}

.ai-input input {
  flex: 1
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 8px
}

.quick-actions button {
  padding: 8px;
  background: #f4f7fb;
  border-radius: 6px;
  font-size: 12px;
  color: var(--primary);
  text-align: left;
  line-height: 1.3
}

.quick-actions button:hover {
  background: #e2e8f0
}

@media (max-width:700px) {
  .quick-actions {
    grid-template-columns: 1fr 1fr
  }
}

.scanner-box {
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff
}

.scanner-box video {
  width: 100%;
  max-height: 400px
}

.scan-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none
}

.scan-frame {
  width: 60%;
  height: 40%;
  border: 3px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .4)
}