﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root {
  --pc-blue: #315fb3;
  --pc-orange: #f26f21;
  --text-dark: #000000;
  --bg-white: #eef0f4;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
*::-webkit-scrollbar { display: none; }

body {
  background-color: #e0e3e8;
  color: #333;
}

a { text-decoration: none; }
button, input { outline: none; border: none; font-family: inherit; }

/* =========================================
   Login Page (Desktop - 7)
   ========================================= */
.page-login {
  background: linear-gradient(105deg, #d88164 30%, #315fb3 85%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-shell {
  width: 100%;
  display: flex;
  justify-content: center;
}

.login-aside {
  display: flex;
  width: 750px;
  height: 420px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.login-panel {
  flex: 1;
  background: rgba(220, 220, 220, 0.65); 
  backdrop-filter: blur(8px);
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.login-panel .eyebrow {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-dark);
  margin-bottom: 25px;
}

.login-form {
  width: 100%;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.login-form input {
  width: 100%;
  padding: 12px 15px;
  border-radius: 20px;
  border: 1px solid #999;
  background-color: transparent;
  font-size: 12px;
  color: #333;
}

.login-form input::placeholder { color: #555; }

.login-form button {
  margin-top: 10px;
  padding: 10px;
  border-radius: 20px;
  background-color: var(--pc-orange);
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.login-form button:hover { opacity: 0.9; }

.login-error {
  margin-top: 12px;
  padding: 10px 14px;
  background: #ffe0e0;
  color: #c0392b;
  border: 1px solid #c0392b;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  display: none;
  max-width: 260px;
}

.login-brand-panel {
  flex: 1;
  background-color: var(--bg-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* =========================================
   Brand Logo Styles
   ========================================= */
.brand-mark-large, .sidebar .brand-mark {
  background-color: var(--pc-blue);
  color: white;
  padding: 10px 20px;
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  clip-path: polygon(0 0, 100% 0, 85% 100%, 15% 100%);
  margin-bottom: 5px;
}

.brand-copy {
  text-align: center;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title { font-size: 22px; font-weight: 800; color: var(--pc-orange); }
.brand-sub { font-size: 18px; font-weight: 800; color: var(--pc-blue); }

/* =========================================
   Dashboard Layout (Desktop - 3)
   ========================================= */
.layout-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 250px;
  display: flex;
  flex-direction: column;
  background-color: var(--pc-orange);
}

.login-brand {
  height: 100px; 
  background-color: var(--bg-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #d8dce3;
  flex-shrink: 0;
}

.sidebar .brand-mark { font-size: 26px; padding: 5px 15px; margin-bottom: 2px; }
.sidebar .brand-title { font-size: 13px; }
.sidebar .brand-sub { font-size: 10px; }

.nav-links {
  display: flex;
  flex-direction: column;
  padding-top: 30px;
  gap: 15px;
}

.nav-links .nav-link {
  color: var(--text-dark);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  padding: 10px 20px;
  text-transform: uppercase;
  transition: transform 0.2s ease;
}

.nav-links .nav-link:hover { transform: scale(1.03); }

.nav-links .nav-link.active span, 
.nav-links .nav-link:hover span {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: transparent;
  overflow-y: auto;
}

.header {
  height: 100px;
  background-color: var(--pc-blue);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-info {
  color: white;
  font-size: 18px;
  font-weight: 600;
  display: block;
}

.header .btn-secondary {
  background-color: transparent;
  color: white;
  border: 1px solid white;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}

.header .btn-secondary:hover { background-color: rgba(255, 255, 255, 0.1); }

.btn-secondary {
  background: var(--bg-white);
  color: #555;
  border: 1px solid #ccc;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-secondary:hover { background-color: #e6e9ef; }

/* =========================================
   Order Cards
   ========================================= */
.orders-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.order-card {
  background: var(--bg-white);
  border: 1px solid #d8dce3;
  border-radius: 10px;
  padding: 18px 22px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.order-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.order-id {
  font-size: 18px;
  font-weight: 700;
  color: var(--pc-blue);
}

.order-time {
  font-size: 12px;
  color: #999;
  display: block;
  margin-top: 2px;
}

.btn-view {
  background: var(--pc-blue);
  color: white;
  border: none;
  padding: 8px 22px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-view:hover { opacity: 0.9; }

.order-customer {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 3px;
}

.order-address {
  font-size: 13px;
  color: #777;
}

/* =========================================
   Modal
   ========================================= */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: var(--bg-white);
  border-radius: 12px;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #d8dce3;
}

.modal-header h3 {
  font-size: 18px;
  color: var(--text-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 26px;
  cursor: pointer;
  color: #999;
  line-height: 1;
  padding: 0 4px;
}

.modal-close:hover { color: #333; }

.modal-body {
  padding: 20px 24px;
}

.modal-info-row {
  display: flex;
  padding: 5px 0;
  font-size: 14px;
}

.modal-label {
  width: 110px;
  flex-shrink: 0;
  color: #888;
  font-weight: 500;
}

.modal-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 13px;
}

.modal-items-table th {
  background: var(--pc-blue);
  color: white;
  padding: 10px 12px;
  text-align: left;
}

.modal-items-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #d8dce3;
}

.modal-items-table tfoot td {
  border-bottom: none;
  padding-top: 12px;
  font-size: 15px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding: 16px 24px 20px;
  border-top: 1px solid #d8dce3;
}

.btn-decline {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-decline:hover { opacity: 0.9; }

/* =========================================
   Dashboard Cards & Tables
   ========================================= */
.page-content { padding: 40px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-heading h2 { font-size: 22px; color: var(--text-dark); }
.card-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; margin-bottom: 35px; }

.card { 
  background: var(--bg-white); 
  border: 1px solid #d8dce3; 
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03); 
  border-radius: 10px; 
  padding: 24px; 
}
.card strong { color: var(--pc-blue); display: block; font-size: 16px; margin-bottom: 8px; }
.card p { font-size: 14px; color: #666; line-height: 1.5; }
.card-meta { display: block; margin-top: 8px; font-size: 12px; color: #888; }
.dashboard-stats .card p { font-size: 28px; font-weight: 700; color: var(--text-dark); }
.dashboard-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 20px; }

/* =========================================
   Dashboard Charts UI
   ========================================= */
.charts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-bottom: 20px;
}

.chart-span-2 { grid-column: span 2; }

.chart-card .chart-title { color: var(--pc-blue); font-size: 16px; margin-bottom: 4px; }
.chart-card .chart-sub { display: block; font-size: 12px; color: #8892a6; margin-bottom: 16px; }
.chart-wrap { position: relative; height: 250px; }

@media (max-width: 1100px) {
  .charts-grid { grid-template-columns: 1fr; }
  .chart-span-2 { grid-column: span 1; }
}

.btn-primary { background-color: var(--pc-orange); color: var(--text-dark); padding: 10px 20px; border-radius: 6px; font-weight: 600; font-size: 14px; cursor: pointer; transition: opacity 0.2s; }
.btn-primary:hover { opacity: 0.9; }

.table-card table { width: 100%; border-collapse: collapse; text-align: left; }
.table-card th { background-color: var(--pc-blue); color: white; padding: 14px 16px; font-size: 14px; }
.table-card td { padding: 14px 16px; border-bottom: 1px solid #d8dce3; font-size: 14px; }

.status-pill { padding: 6px 12px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.status-pill.active { background-color: #d4edda; color: #155724; }
.status-pill.paused { background-color: #fff3cd; color: #856404; }
.status-pill.completed { background-color: #cce5ff; color: #004085; }
.status-pill.pending { background-color: #ffe5d0; color: #8a3b00; }
.status-pill.low { background-color: #f8d7da; color: #842029; }
.status-pill.warn { background-color: #fff3cd; color: #856404; }
.status-pill.danger { background-color: #f8d7da; color: #842029; }
.status-pill.status-connected { background-color: #d4edda; color: #155724; }
.status-pill.status-off { background-color: #e2e3e5; color: #383d41; }
.status-pill.status-warning { background-color: #fff3cd; color: #856404; }
.status-pill.status-unknown { background-color: #e2e3e5; color: #6c757d; }

.sync-cue { display: flex; align-items: center; gap: 10px; background: #e6f4ea; border: 1px solid #34a853; color: #1e7e34; padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-weight: 600; }
.sync-cue-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: #34a853; color: #fff; font-size: 13px; line-height: 1; flex-shrink: 0; }

.price-rule { color: #f26f21; font-weight: 700; }
.price-base { font-size: 11px; color: #999; text-decoration: line-through; margin-top: 2px; }

/* =========================================
   Point of Sale (POS) Specific UI
   ========================================= */
.pos-layout {
  display: flex;
  gap: 20px;
  height: calc(100vh - 140px);
}

.pos-products-section {
  flex: 2;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pos-categories {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.pos-category-btn {
  padding: 8px 16px;
  background: var(--bg-white);
  border: 1px solid #d8dce3;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.pos-category-btn.active {
  background: var(--pc-blue);
  color: white;
  border-color: var(--pc-blue);
}

.pos-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-white);
  border: 1px solid #d8dce3;
  border-radius: 999px;
  padding: 10px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.pos-search-bar input {
  flex: 1;
  background: transparent;
  font-size: 14px;
  color: #333;
}

.pos-search-bar input::placeholder {
  color: #999;
}

.pos-search-icon {
  font-size: 16px;
  color: #777;
}

.pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 15px;
  overflow-y: auto;
  padding-right: 5px;
  min-height: 0;
  flex: 1;
}

.pos-item-card {
  background: var(--bg-white);
  border: 1px solid #d8dce3;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 140px;
}

.pos-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.05);
  border-color: var(--pc-blue);
}

.pos-item-img {
  width: 100%;
  height: 60px;
  background-color: #e6e9ef;
  border-radius: 6px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #ccc;
  overflow: hidden;
}
.pos-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pos-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 5px;
}

.pos-item-price {
  font-size: 14px;
  color: var(--pc-orange);
  font-weight: 700;
}

.pos-item-price.rule {
  color: #c2410c;
}

.pos-item-price.rule::after {
  content: 'auto';
  font-size: 10px;
  font-weight: 600;
  color: #c2410c;
  background: rgba(242, 111, 33, 0.15);
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 5px;
  vertical-align: middle;
}

.pos-cart-section {
  flex: 1;
  min-width: 320px;
  background: var(--bg-white);
  border: 1px solid #d8dce3;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

.pos-cart-header {
  padding: 20px;
  border-bottom: 1px solid #d8dce3;
  background: #e7eaf0;
}

.pos-cart-header h3 {
  font-size: 18px;
  color: var(--text-dark);
}

.pos-cart-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.pos-cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed #d8dce3;
  padding-bottom: 15px;
}

.pos-cart-item-details { display: flex; flex-direction: column; }
.pos-cart-item-name { font-size: 14px; font-weight: 600; }
.pos-cart-item-price { font-size: 12px; color: #666; margin-top: 4px; }

.pos-cart-qty {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pos-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #ccc;
  background: var(--bg-white);
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pos-cart-summary {
  padding: 20px;
  background: #e7eaf0;
  border-top: 1px solid #d8dce3;
}

.pos-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
  color: #555;
}

.pos-summary-total {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 2px solid #d8dce3;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-dark);
}

.btn-checkout {
  width: 100%;
  padding: 16px;
  font-size: 18px;
  border-radius: 8px;
  margin-top: 15px;
}

/* =========================================
   Sub Navigation Bar
   ========================================= */
.sub-nav {
  display: flex;
  background-color: var(--bg-white);
  border-bottom: 1px solid #ccc;
  padding: 0 40px;
  position: sticky;
  top: 100px;
  z-index: 99;
}

.sub-nav-item {
  padding: 12px 28px;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 600;
  color: #777;
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}

.sub-nav-item:hover {
  color: var(--pc-orange);
}

.sub-nav-item.active {
  color: var(--pc-blue);
  border-bottom-color: var(--pc-blue);
}

/* =========================================
   Inventory Form
   ========================================= */
.form-group {
  margin-bottom: 16px;
}

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

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  color: #333;
  background: var(--bg-white);
}

.form-input:focus {
  border-color: var(--pc-blue);
  outline: none;
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.image-preview {
  margin-top: 10px;
  width: 100px;
  height: 100px;
  border: 1px solid #d8dce3;
  border-radius: 8px;
  overflow: hidden;
  display: none;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.toggle-label input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  width: 44px;
  height: 24px;
  background: #ccc;
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #f5f6f8;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle-label input:checked + .toggle-slider {
  background: var(--pc-blue);
}

.toggle-label input:checked + .toggle-slider::after {
  transform: translateX(20px);
}

.toggle-text {
  font-size: 13px;
  color: #555;
  font-weight: 500;
}

.inv-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #d8dce3;
}

.btn-toggle {
  padding: 6px 0;
  width: 76px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s;
  text-align: center;
}

.btn-toggle.active { background: #d4edda; color: #155724; }
.btn-toggle.inactive { background: #f8d7da; color: #842029; }
.btn-toggle:hover { opacity: 0.8; }

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  color: #777;
  transition: color 0.2s;
}

.btn-icon:hover { color: var(--pc-blue); }
.btn-icon.danger:hover { color: #e74c3c; }

/* =========================================
   Excel Preview Table
   ========================================= */
#excelTableContainer table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#excelTableContainer table tr:first-child {
  background: var(--pc-blue);
  color: white;
  font-weight: 600;
}

#excelTableContainer table td,
#excelTableContainer table th {
  padding: 8px 12px;
  border: 1px solid #d8dce3;
}

/* =========================================
   Responsive tweaks
   ========================================= */
@media (max-width: 900px) {
  .login-aside {
    width: 100%;
    height: auto;
    max-width: 440px;
    flex-direction: column;
  }
  .login-brand-panel { padding: 30px 20px; }
}

@media (max-width: 800px) {
  .layout-shell {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  .sidebar { width: 100%; }
  .nav-links {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding-top: 10px;
    gap: 6px;
  }
  .header {
    padding: 12px 16px;
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
  }
  .sub-nav { top: 0; overflow-x: auto; padding: 0 10px; }
  .page-content { padding: 20px 16px; }
  .pos-layout {
    flex-direction: column;
    height: auto;
  }
  .pos-cart-section { min-width: 0; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* Toast notifications */
.toast-notification {
  position: fixed;
  top: 24px;
  right: 24px;
  padding: 14px 24px;
  background: #334155;
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  z-index: 10000;
  opacity: 0;
  transform: translateY(-12px);
  transition: all 0.3s;
  pointer-events: none;
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.toast-notification.show { opacity: 1; transform: translateY(0); }
.toast-success { background: #16a34a; }
.toast-error { background: #dc2626; }

/* Confirm dialog overlay */
#confirmOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
#confirmOverlay .modal-box {
  max-width: 380px;
  width: 90%;
}
#confirmOverlay .modal-body p {
  line-height: 1.6;
  color: #333;
  font-size: 14px;
}
