/* ============================================================
   STARPOSLANKA — Global UI Design System
   All pages EXCEPT inventory.php use this stylesheet.
   inventory.php keeps its own app.css (inventory.css).
   ============================================================ */

:root {
  --bg: #EEF4FF;
  --top1: #2E5BCE;
  --top2: #4F86D9;
  --side: #3381F7;
  --text: #10224a;
  --muted: #6b7a99;
  --white: #fff;
  --border: #dce8ff;
  --shadow: 0 12px 30px rgba(31,71,130,.09);
  --radius: 18px;
  --card-size: 170px;
  --icon-size: 54px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', Arial, sans-serif; background: var(--bg); color: var(--text); }

/* ── TOP BAR ── */
.topbar {
  height: 64px;
  background: linear-gradient(90deg, var(--top1), var(--top2));
  display: flex; align-items: center; gap: 16px;
  padding: 0 22px; color: #fff;
  box-shadow: 0 6px 22px rgba(46,91,206,.28);
  position: sticky; top: 0; z-index: 100;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.brand-icon { font-size: 28px; }
.brand strong { font-size: 22px; letter-spacing: .4px; }
.brand small {
  background: #fff; color: #2E5BCE;
  padding: 4px 8px; border-radius: 7px;
  margin-left: 6px; font-weight: 900; font-size: 11px;
}
.menu-toggle {
  border: 0; background: rgba(255,255,255,.15);
  color: #fff; border-radius: 10px;
  padding: 10px 13px; font-size: 17px; cursor: pointer;
}
.topbar-clock {
  margin: 0 auto;
  background: rgba(0,35,130,.22);
  padding: 8px 18px; border-radius: 14px;
  font-weight: 800; font-size: 16px;
}
.top-actions { display: flex; align-items: center; gap: 12px; }
.top-pill {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px; padding: 9px 15px;
  color: #fff; text-decoration: none; font-weight: 700;
  display: flex; align-items: center; gap: 7px;
}
.top-pill:hover, .top-pill.active { background: rgba(255,255,255,.24); }
.user-pill {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px; padding: 8px 14px;
  color: #fff; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.user-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #1162e8;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 900;
}
.logout-btn {
  background: rgba(255,60,60,.18);
  border: 1px solid rgba(255,100,100,.25);
  border-radius: 14px; padding: 9px 15px;
  color: #fff; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
}
.logout-btn:hover { background: rgba(255,60,60,.32); }

/* ── LAYOUT ── */
.app-layout { display: flex; }

/* ── SIDEBAR ── */
.sidebar {
  width: 240px; min-height: calc(100vh - 64px);
  background: linear-gradient(180deg, #2E5BCE, #1267ec);
  padding: 16px 10px;
  position: sticky; top: 64px;
  transition: width .22s;
  flex-shrink: 0;
}
.sidebar.collapsed { width: 70px; }
.sidebar.collapsed .side-label { display: none; }
.sidebar.collapsed .side-link { justify-content: center; }
.sidebar.collapsed .side-section { display: none; }
.sidebar.collapsed .side-group-label { display: none; }

.side-section {
  font-size: 10px; font-weight: 800; letter-spacing: 1px;
  color: rgba(255,255,255,.5); padding: 12px 8px 4px;
  text-transform: uppercase;
}
.side-link {
  display: flex; align-items: center; gap: 12px;
  color: #fff; text-decoration: none;
  font-weight: 700; font-size: 13.5px;
  padding: 12px 14px; border-radius: 12px;
  margin-bottom: 4px; transition: .18s;
}
.side-link:hover, .side-link.active { background: rgba(255,255,255,.18); }
.side-link i { width: 20px; text-align: center; font-size: 16px; flex-shrink: 0; }
.side-group { margin-bottom: 4px; }
.side-group-label {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,.75); font-weight: 700; font-size: 13px;
  padding: 10px 14px 6px;
}
.side-group-label i { width: 20px; text-align: center; }
.side-sublink {
  display: block; color: rgba(255,255,255,.82);
  text-decoration: none; font-size: 13px; font-weight: 600;
  padding: 9px 14px 9px 46px; border-radius: 10px; margin-bottom: 2px;
}
.side-sublink:hover, .side-sublink.active {
  background: rgba(255,255,255,.15); color: #fff;
}

/* ── MAIN CONTENT ── */
.main-content { flex: 1; padding: 26px 28px; min-width: 0; }

/* ── PAGE HEADING ── */
.page-heading {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 22px; flex-wrap: wrap; gap: 12px;
}
.page-heading h1 {
  margin: 0; font-size: 26px; font-weight: 900;
  display: flex; align-items: center; gap: 10px;
}
.page-heading p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.heading-stat {
  background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 18px;
  font-weight: 700; font-size: 14px; color: var(--muted);
  box-shadow: var(--shadow);
}
.heading-stat strong { color: var(--top1); }

/* ── CARDS ── */
.panel-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow); margin-bottom: 22px;
}

/* ── COMPANY CARD (dashboard) ── */
.company-card {
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 14px;
}
.company-card-left { display: flex; align-items: center; gap: 18px; }
.company-logo {
  width: 60px; height: 60px; border-radius: 16px;
  background: linear-gradient(135deg, var(--top1), var(--top2));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.company-name { font-size: 20px; font-weight: 900; }
.company-tagline { color: var(--muted); font-size: 13px; margin: 2px 0 6px; }
.company-contact { display: flex; gap: 16px; font-size: 13px; font-weight: 600; }

/* ── MODULE GRID (dashboard) ── */
.modules-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 12px;
}
.modules-title { font-size: 20px; font-weight: 900; }
.modules-subtitle { color: var(--muted); font-size: 13px; }
.modules-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.module-search-box {
  height: 44px; min-width: 260px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 14px; display: flex; align-items: center;
  gap: 9px; padding: 0 14px; box-shadow: var(--shadow);
}
.module-search-box i { color: var(--side); }
.module-search-box input {
  border: 0; outline: 0; width: 100%;
  font-size: 14px; color: var(--text); font-weight: 650;
  background: transparent;
}

.size-toggle {
  background: #fff; border: 1px solid var(--border);
  padding: 5px; border-radius: 12px; box-shadow: var(--shadow);
  display: flex; gap: 4px;
}
.size-btn {
  border: 0; background: transparent;
  padding: 8px 13px; border-radius: 9px;
  font-weight: 800; font-size: 13px; color: #4b5a78; cursor: pointer;
}
.size-btn.active { background: var(--side); color: #fff; }

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-size), 1fr));
  gap: 20px;
}
.module-grid.small  { --card-size: 130px; --icon-size: 40px; }
.module-grid.large  { --card-size: 210px; --icon-size: 68px; }

.module-card {
  height: var(--card-size);
  border-radius: 24px; text-decoration: none; color: #fff;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; font-weight: 900; font-size: 15px;
  position: relative;
  box-shadow: 0 14px 32px rgba(22,64,130,.18);
  transition: .22s;
}
.module-card:hover { transform: translateY(-5px) scale(1.02); box-shadow: 0 20px 42px rgba(22,64,130,.26); }
.module-card i { font-size: var(--icon-size); filter: drop-shadow(0 4px 6px rgba(0,0,0,.18)); }
.module-card .card-badge {
  position: absolute; right: 13px; top: 12px;
  background: rgba(255,255,255,.22);
  padding: 5px 10px; border-radius: 12px; font-size: 11px;
}
.card-name { text-align: center; padding: 0 10px; }
.card-desc { font-size: 11px; font-weight: 600; opacity: .85; text-align: center; padding: 0 10px; }

/* card colours */
.c-green   { background: linear-gradient(135deg,#00a852,#00d878); }
.c-blue    { background: linear-gradient(135deg,#087be8,#22a8f6); }
.c-purple  { background: linear-gradient(135deg,#6828e8,#9448ff); }
.c-cyan    { background: linear-gradient(135deg,#0090a8,#09bfd5); }
.c-red     { background: linear-gradient(135deg,#d70d45,#ff2c62); }
.c-indigo  { background: linear-gradient(135deg,#3255d9,#5577ff); }
.c-orange  { background: linear-gradient(135deg,#e96700,#ff9a00); }
.c-green2  { background: linear-gradient(135deg,#00875b,#00b873); }
.c-orange2 { background: linear-gradient(135deg,#e34b00,#ff7a00); }
.c-blue2   { background: linear-gradient(135deg,#1465df,#51a9ff); }
.c-violet  { background: linear-gradient(135deg,#7952e8,#bc5cff); }
.c-dark    { background: linear-gradient(135deg,#1d3557,#34577f); }
.c-teal    { background: linear-gradient(135deg,#008080,#00b3b3); }
.c-navy    { background: linear-gradient(135deg,#1a237e,#3949ab); }

.no-modules-msg {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  color: var(--muted); font-weight: 700; text-align: center;
}

/* ── BUTTONS ── */
.btn-primary {
  background: linear-gradient(135deg, var(--top1), var(--top2));
  color: #fff; border: 0; border-radius: 12px;
  padding: 11px 22px; font-weight: 800; font-size: 14px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  text-decoration: none; transition: .18s;
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); }
.btn-secondary {
  background: #fff; color: var(--top1);
  border: 1.5px solid var(--border);
  border-radius: 12px; padding: 10px 20px;
  font-weight: 800; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: .18s;
}
.btn-secondary:hover { border-color: var(--top2); background: #f0f6ff; }
.btn-danger {
  background: linear-gradient(135deg,#d70d45,#ff2c62);
  color: #fff; border: 0; border-radius: 12px;
  padding: 11px 22px; font-weight: 800; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: .18s;
}
.btn-danger:hover { opacity: .9; }
.btn-small { padding: 8px 15px; font-size: 13px; }

/* ── FORM ELEMENTS ── */
.panel-card .inp, .panel-card .sel {
  width: 100%; border: 1.5px solid var(--border);
  border-radius: 10px; padding: 10px 13px;
  font-size: 14px; font-family: inherit; color: var(--text);
  background: #fff; outline: none; transition: .18s;
}
.panel-card .inp:focus, .panel-card .sel:focus { border-color: var(--side); box-shadow: 0 0 0 3px rgba(51,129,247,.12); }
.panel-card .form-row { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.panel-card .form-row label { font-size: 13px; font-weight: 700; color: var(--muted); }
.form-section-title {
  font-size: 15px; font-weight: 900;
  color: var(--top1); margin-bottom: 16px;
  padding-bottom: 10px; border-bottom: 2px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}

/* ── TABLE ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th {
  background: linear-gradient(135deg, var(--top1), var(--top2));
  color: #fff; padding: 12px 14px;
  text-align: left; font-weight: 800; font-size: 13px;
}
.data-table th:first-child { border-radius: 10px 0 0 0; }
.data-table th:last-child  { border-radius: 0 10px 0 0; }
.data-table td { padding: 11px 14px; border-bottom: 1px solid #edf2ff; vertical-align: middle; }
.data-table tr:hover td { background: #f5f9ff; }
.data-table tr.selected td { background: #e8f0ff; }
.table-avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 8px; }

/* ── BADGES / TAGS ── */
.badge-active   { background: #e6f9f0; color: #00875b; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 800; }
.badge-inactive { background: #fff0f3; color: #d70d45; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 800; }

/* ── SEARCH BAR ── */
.panel-card .search-bar, .page-search-bar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; margin-bottom: 16px;
}
.panel-card .search-input, .page-search-input {
  height: 42px; min-width: 220px; flex: 1;
  border: 1.5px solid var(--border); border-radius: 12px;
  padding: 0 14px; font-size: 14px; font-family: inherit;
  outline: none; background: #fff;
}
.panel-card .search-input:focus, .page-search-input:focus { border-color: var(--side); }
.panel-card .search-select, .page-search-select {
  height: 42px; border: 1.5px solid var(--border);
  border-radius: 12px; padding: 0 12px;
  font-size: 14px; font-family: inherit; background: #fff;
  outline: none; cursor: pointer;
}

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 28px; right: 28px;
  background: #1a3a6b; color: #fff;
  padding: 14px 22px; border-radius: 14px;
  font-weight: 700; font-size: 14px;
  opacity: 0; pointer-events: none;
  transition: opacity .3s; z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; pointer-events: auto; }
.toast.success { background: linear-gradient(135deg,#00875b,#00b873); }
.toast.error   { background: linear-gradient(135deg,#d70d45,#ff2c62); }

/* ── PLACEHOLDER ── */
.placeholder-wrap {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 80px 20px;
}
.placeholder-icon { font-size: 58px; margin-bottom: 16px; }
.placeholder-title { font-size: 24px; font-weight: 900; margin-bottom: 8px; }
.placeholder-text { color: var(--muted); font-size: 14px; max-width: 420px; margin-bottom: 24px; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .top-actions { display: none; }
  .brand { min-width: auto; }
  .sidebar {
    position: fixed; left: -260px; z-index: 200;
    transition: left .25s; top: 64px;
    height: calc(100vh - 64px);
  }
  .sidebar.show { left: 0; }
  .main-content { padding: 16px; }
  .modules-header { flex-direction: column; align-items: flex-start; gap: 12px; }
  .module-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
