/*
 * style.css
 * ---------
 * Our own look for the website. Bootstrap does most of the work;
 * this file only adds the ByteHub Tech design on top.
 *
 * TIP: To change a color everywhere, change it once in :root below.
 */

/* ===== 1. COLORS AND FONTS (change these to restyle the whole site) ===== */
:root {
  --sidebar-color: #0d1321;      /* very dark navy sidebar */
  --sidebar-text: #9aa4b5;       /* gray-blue menu text */
  --accent: #0094ff;             /* electric blue: active menu marker, Search buttons */
  --accent-dark: #0072c6;        /* darker blue for hover */
  --accent-light: #5cc8ff;       /* light blue: logo "TECH" and the top strip */
  --table-head: #0d1321;         /* report table header row */
  --page-color: #f3f5f9;         /* light gray page background */
  --white: #ffffff;
  --line: #e3e5e9;               /* borders */
  --text: #1f2328;
  --muted: #6b7078;              /* lighter text */

  --sidebar-width: 260px;
}

body {
  background: var(--page-color);
  color: var(--text);
  font-family: "Inter", "Segoe UI", sans-serif;
}


/* ===== 2. PAGE FRAME: sidebar on the left, everything else on the right ===== */
.app {
  display: flex;          /* puts the sidebar and .main side by side */
  min-height: 100vh;      /* at least as tall as the screen */
}

.main {
  flex: 1;                /* take up all the space the sidebar doesn't use */
  min-width: 0;
  display: flex;
  flex-direction: column; /* top bar, content, footer stacked */
}

.content {
  flex: 1;                /* pushes the footer to the bottom */
  padding: 24px;
}

.footer {
  padding: 16px 24px;
  font-size: 13px;
  color: var(--muted);
  background: var(--white);
  border-top: 1px solid var(--line);
}


/* ===== 3. SIDEBAR ===== */
.sidebar {
  --bs-offcanvas-width: var(--sidebar-width);   /* width when it slides in on phones */
  background: var(--sidebar-color) !important;  /* !important beats Bootstrap's own color */
}

.sidebar .offcanvas-body {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 24px 0 16px;
  overflow-y: auto;       /* scroll if the menu is taller than the screen */
}

/* On computer screens (992px and wider): keep the sidebar fixed in place */
@media (min-width: 992px) {
  .sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
  }
}

/* Company name */
.brand {
  display: block;
  padding: 0 24px 24px;
  color: var(--white);
  font-family: "Orbitron", sans-serif;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
}

.brand i {
  color: var(--accent-light);
}

.brand:hover {
  color: var(--white);
}

.brand small {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 6px;
  color: var(--accent-light);
}

/* Group titles: EMPLOYEES, PAYROLL, ... */
.menu-group-title {
  padding: 18px 24px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #6c6f76;
}

/* Each menu link */
.menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 24px;
  color: var(--sidebar-text);
  font-size: 15px;
  text-decoration: none;
  border-left: 3px solid transparent;
}

.menu-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.05);
}

/* The page you are on right now */
.menu-link.active {
  color: var(--white);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border-left-color: var(--accent);
}

/* Logout: pushed to the very bottom, with a line above it */
.logout-link {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}


/* ===== 4. TOP BAR ===== */
.topbar {
  position: sticky;       /* stays at the top when you scroll */
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: var(--white);
  border-top: 4px solid var(--accent);
  border-bottom: 1px solid var(--line);
}

.menu-button {
  font-size: 26px;
  line-height: 1;
  padding: 0 6px;
  border: 0;
}

.page-title {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}

.user-badge {
  margin-left: auto;      /* pushes it to the right side */
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}

.user-circle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--sidebar-color);
  color: var(--white);
  font-weight: 600;
}


/* ===== 5. HOME PAGE ===== */
.welcome h2 {
  font-family: "Orbitron", sans-serif;
  font-size: 30px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.welcome p {
  color: var(--muted);
}

.section-title {
  margin: 28px 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}

/* The clickable boxes on the Home page */
.shortcut {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  padding: 16px 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}

.shortcut:hover {
  color: var(--text);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
}

.shortcut i {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--sidebar-color);
  color: var(--accent-light);
  font-size: 18px;
}

.shortcut:hover i {
  background: var(--accent);
  color: var(--white);
}


/* ===== 6. PIECES FOR THE NEXT PAGES (forms, reports, POS) ===== */

/* Big techy title for form pages, like "BYTEHUB TECH PAYROLL" */
.fancy-title {
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  text-transform: uppercase;
  font-size: 34px;
  text-align: center;
  margin-bottom: 24px;
}

/* White box that holds a form or a table */
.box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
}

/* Gray group of fields, like "Contact Info" and "Address" in the sample */
.field-group {
  background: #f1f2f4;
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

/* Labels above form fields: small and a little bold */
.box .form-label {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 4px;
}

/* Square box that shows the employee's photo */
.photo-box {
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  color: #c3c7ce;
  font-size: 64px;
}

.photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;      /* fill the square without stretching the picture */
  grid-area: 1 / 1;       /* sit on top of the icon */
}

/* Payroll page: bold section headings like "BASIC INCOME:" */
.pay-heading {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 22px 0 10px;
}

/* Lines up the right column's first box with the photo on the left (big screens) */
.pay-top-spacer {
  height: 46px;
}

/* Smaller photo box (User Account page) */
.photo-box-small {
  width: 120px;
  height: 120px;
  font-size: 56px;
}

.photo-input {
  max-width: 220px;
  margin: 0 auto;
}

/* Fields the user cannot type in (filled in automatically) look gray */
.form-control[readonly] {
  background: #e9ecef;
}

/* Report tables: dark navy header row */
.report-table thead th {
  background: var(--table-head);
  color: var(--white);
  font-size: 14px;
}

/* Report page: title on the left, search box on the right */
.report-header {
  display: flex;
  flex-wrap: wrap;        /* on small screens the search box drops below the title */
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.report-title {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}

.report-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-search input {
  width: 200px;
}

.report-table td {
  font-size: 14px;
}

/* TOTAL row at the bottom of a report */
.report-total td {
  font-weight: 700;
  background: #eef4fb;
  border-top: 2px solid var(--table-head);
}

/* Small round employee photo inside a table row */
.table-photo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
}

.table-photo-empty {
  display: grid;
  place-items: center;
  background: #e9ecef;
  color: #9aa0a8;
}

/* Electric blue button (used for SEARCH) */
.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--white);
}

.btn-accent:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: var(--white);
}

/* Shown on pages we have not built yet */
.coming-soon {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}

.coming-soon i {
  display: block;
  font-size: 40px;
  margin-bottom: 12px;
}

/* User type under the name in the top bar (Admin / Staff / Cashier) */
.user-type {
  display: block;
  font-size: 11px;
  line-height: 1;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ----- POS page ----- */

/* Product pictures: 2 per row on phones ... 6 per row on big screens */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 576px)  { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 992px)  { .product-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1200px) { .product-grid { grid-template-columns: repeat(6, 1fr); } }

.product-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  background: #fff;
  border: 2px solid #e3e7ee;
  border-radius: 10px;
  text-align: center;
  transition: border-color .15s, transform .15s;
}
.product-tile:hover    { border-color: var(--accent-light); transform: translateY(-2px); }
.product-tile.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(0, 148, 255, .2); }

/* The square picture area: a real photo, or a big icon on a colored background */
.product-picture {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
  font-size: 44px;
  color: #fff;
}
.product-picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Icon background color per category (cat- + category name in lowercase) */
.cat-laptops     { background: linear-gradient(135deg, #0094ff, #0050a0); }
.cat-components  { background: linear-gradient(135deg, #7b3fe4, #3d1a8a); }
.cat-storage     { background: linear-gradient(135deg, #00b894, #00695c); }
.cat-monitors    { background: linear-gradient(135deg, #ff7a18, #c2410c); }
.cat-peripherals { background: linear-gradient(135deg, #e84393, #9d174d); }
.cat-networking  { background: linear-gradient(135deg, #0abde3, #0e6c8a); }
.cat-accessories { background: linear-gradient(135deg, #636e72, #2d3436); }
.product-picture:has(img) { background: #fff; }

.product-name  { font-size: 12px; line-height: 1.2; min-height: 2.4em; }
.product-price { font-size: 13px; font-weight: 700; color: var(--accent-dark); }

/* CALCULATE CHANGE / NEW / SAVE / UPDATE */
.pos-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.pos-buttons .btn { font-size: 13px; font-weight: 600; }

/* Number keypad: 3 columns of keys + a tall ENTER on the right */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 1.3fr;
  gap: 8px;
}
.keypad-key   { font-size: 20px; padding: 10px 0; }
.keypad-enter { grid-column: 4; grid-row: 1 / span 4; font-size: 18px; font-weight: 700; }


/* ===== 7. LOGIN PAGE ===== */

/* Dark background with a soft blue glow, card in the middle of the screen */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 148, 255, 0.25), transparent 45%),
    radial-gradient(circle at 80% 85%, rgba(92, 200, 255, 0.15), transparent 40%),
    var(--sidebar-color);
}

/* The white login box */
.login-card {
  width: 100%;
  max-width: 360px;
  padding: 32px 28px 0;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  overflow: hidden;       /* keeps the gray bottom strip inside the rounded corners */
}

.login-top {
  text-align: center;
  margin-bottom: 20px;
}

/* Round logo with the chip icon */
.login-logo {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  border-radius: 50%;
  background: var(--sidebar-color);
  color: var(--accent-light);
  font-size: 30px;
}

.login-title {
  font-family: "Orbitron", sans-serif;
  font-size: 24px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

.login-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.login-button {
  padding: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 28px;
}

/* Gray strip at the bottom with "Forgot Password?" (like the sample) */
.login-bottom {
  margin: 0 -28px;
  padding: 14px;
  text-align: center;
  font-size: 13px;
  background: #f4f5f7;
  border-top: 1px solid var(--line);
}

.login-bottom a {
  color: var(--accent);
  text-decoration: none;
}

.login-bottom a:hover {
  text-decoration: underline;
}
