/* ============================================================
   BARBY PLATFORM CORE — platform.css
   ============================================================ */

:root {
  --topbar-h:       56px;
  --sidebar-w:      260px;
  --floor-bar-w:    56px;
  --bg:             #0b0f1a;
  --bg2:            #111827;
  --bg3:            #1a2236;
  --border:         rgba(255,255,255,0.07);
  --text:           #e2e8f0;
  --text-muted:     #64748b;
  --accent:         #3b82f6;
  --accent-dark:    #1d4ed8;
  --success:        #10b981;
  --warning:        #f59e0b;
  --danger:         #ef4444;
  --card-bg:        #1a2236;
  --card-border:    rgba(255,255,255,0.06);
  --radius:         10px;
  --radius-sm:      6px;
  --font:           'Inter', 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: #93c5fd; }

/* ============================
   TOPBAR
   ============================ */
.bp-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 1000;
  gap: 16px;
}

.bp-topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  color: var(--text);
  white-space: nowrap;
}

.bp-topbar-brand .bp-logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: #fff;
}

.bp-topbar-spacer { flex: 1; }

.bp-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bp-user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg3);
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 13px;
  cursor: pointer;
}

.bp-user-chip .avatar {
  width: 24px; height: 24px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}

.bp-btn-icon {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: var(--bg3);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 15px;
  text-decoration: none;
}
.bp-btn-icon:hover { border-color: var(--accent); color: var(--accent); }

/* ============================
   LAYOUT WRAPPER
   ============================ */
.bp-layout {
  display: flex;
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
}

/* ============================
   FLOOR BAR (vertical left strip)
   ============================ */
.bp-floorbar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--floor-bar-w);
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  scrollbar-width: none;
}
.bp-floorbar::-webkit-scrollbar { display: none; }

.bp-floor-btn {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  margin: 2px 0;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  position: relative;
  border: 1px solid transparent;
}
.bp-floor-btn:hover {
  background: var(--bg3);
  color: var(--text);
  border-color: var(--border);
}
.bp-floor-btn.active {
  background: rgba(59,130,246,0.2);
  color: var(--accent);
  border-color: var(--accent);
}
.bp-floor-btn .floor-num {
  font-size: 10px;
  font-weight: 800;
}
.bp-floor-btn .floor-dot {
  position: absolute;
  bottom: 4px; right: 4px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--success);
}
.bp-floor-divider {
  width: 30px;
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* ============================
   DEPT SIDEBAR
   ============================ */
.bp-deptsidebar {
  position: fixed;
  top: var(--topbar-h);
  left: var(--floor-bar-w);
  bottom: 0;
  width: var(--sidebar-w);
  background: var(--bg3);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  z-index: 800;
  transition: transform 0.25s ease;
  scrollbar-width: thin;
  scrollbar-color: var(--bg) transparent;
}

.bp-deptsidebar-inner {
  padding: 16px 0 40px;
}

.bp-floor-header {
  padding: 12px 16px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.bp-floor-header .floor-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.bp-floor-header .floor-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}

.bp-dept-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--text-muted);
  font-size: 13px;
  border-left: 3px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
  cursor: pointer;
}
.bp-dept-link:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text);
}
.bp-dept-link.active {
  background: rgba(59,130,246,0.12);
  color: var(--accent);
  border-left-color: var(--accent);
}
.bp-dept-link.empty {
  opacity: 0.35;
  font-style: italic;
}
.bp-dept-link i {
  font-size: 14px;
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}
.bp-dept-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ============================
   MAIN CONTENT
   ============================ */
.bp-main {
  margin-left: calc(var(--floor-bar-w) + var(--sidebar-w));
  flex: 1;
  padding: 28px;
  min-width: 0;
}

/* ============================
   PAGE HEADER
   ============================ */
.bp-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}
.bp-page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 4px;
}
.bp-page-header .bp-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ============================
   CARDS
   ============================ */
.bp-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 24px;
}
.bp-card-sm { padding: 16px; }

.bp-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.bp-card-header h2 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================
   STAT CARDS
   ============================ */
.bp-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.bp-stat {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.bp-stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.bp-stat-val {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}
.bp-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* ============================
   FLOOR GRID (dashboard)
   ============================ */
.bp-floor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.bp-floor-tile {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: block;
}
.bp-floor-tile:hover {
  border-color: var(--accent);
  background: rgba(59,130,246,0.06);
  transform: translateY(-2px);
}
.bp-floor-tile.inactive {
  opacity: 0.45;
}
.bp-floor-tile .tile-num {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}
.bp-floor-tile .tile-icon {
  font-size: 24px;
  margin-bottom: 8px;
  color: var(--accent);
}
.bp-floor-tile .tile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.bp-floor-tile .tile-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ============================
   BUTTONS
   ============================ */
.bp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
  line-height: 1.4;
}
.bp-btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.bp-btn-primary:hover { background: var(--accent-dark); color: #fff; }
.bp-btn-outline { background: transparent; color: var(--text-muted); border-color: var(--border); }
.bp-btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.bp-btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.bp-btn-sm { padding: 5px 10px; font-size: 12px; }

/* ============================
   TABLES
   ============================ */
.bp-table-wrap {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.bp-table { width: 100%; border-collapse: collapse; }
.bp-table th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}
.bp-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  color: var(--text);
  vertical-align: middle;
}
.bp-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.bp-table tbody tr:last-child td { border-bottom: none; }

/* ============================
   FORMS
   ============================ */
.bp-form-group { margin-bottom: 16px; }
.bp-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bp-input, .bp-select, .bp-textarea {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  transition: border-color 0.15s;
  outline: none;
}
.bp-input:focus, .bp-select:focus, .bp-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}
.bp-select option { background: var(--bg2); }
.bp-textarea { resize: vertical; min-height: 80px; }

/* ============================
   BADGES
   ============================ */
.bp-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.bp-badge-success  { background: rgba(16,185,129,0.15); color: #10b981; }
.bp-badge-warning  { background: rgba(245,158,11,0.15); color: #f59e0b; }
.bp-badge-danger   { background: rgba(239,68,68,0.15);  color: #ef4444; }
.bp-badge-info     { background: rgba(59,130,246,0.15); color: #60a5fa; }
.bp-badge-secondary{ background: rgba(100,116,139,0.2); color: #94a3b8; }

/* ============================
   ALERTS
   ============================ */
.bp-alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bp-alert-success { background: rgba(16,185,129,0.12); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.bp-alert-danger  { background: rgba(239,68,68,0.12);  border: 1px solid rgba(239,68,68,0.3);  color: #fca5a5; }
.bp-alert-warning { background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3); color: #fcd34d; }
.bp-alert-info    { background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.3); color: #93c5fd; }
.bp-alert-close { background: none; border: none; color: inherit; cursor: pointer; font-size: 18px; opacity: 0.6; padding: 0; }
.bp-alert-close:hover { opacity: 1; }

/* ============================
   ROWS & GRID
   ============================ */
.bp-row { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 20px; }
.bp-col { flex: 1; min-width: 0; }
.bp-col-auto { flex: 0 0 auto; }

/* ============================
   SECTION SEPARATOR
   ============================ */
.bp-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 20px 0 12px;
}

/* ============================
   EMPTY STATE
   ============================ */
.bp-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.bp-empty i { font-size: 40px; display: block; margin-bottom: 12px; opacity: 0.4; }
.bp-empty p { margin: 0; font-size: 14px; }

/* ============================
   SYSTEM STATUS
   ============================ */
.bp-status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.bp-status-dot.ok      { background: var(--success); box-shadow: 0 0 6px var(--success); }
.bp-status-dot.warning { background: var(--warning); }
.bp-status-dot.error   { background: var(--danger); }

/* ============================
   SCROLLBAR GLOBAL
   ============================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg3); border-radius: 4px; }

/* ============================
   RESPONSIVE
   ============================ */
@media (max-width: 900px) {
  .bp-deptsidebar { transform: translateX(-100%); }
  .bp-deptsidebar.open { transform: translateX(0); }
  .bp-main { margin-left: var(--floor-bar-w); }
}
@media (max-width: 600px) {
  .bp-main { padding: 16px; }
  .bp-stats { grid-template-columns: 1fr 1fr; }
  .bp-floor-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================
   LOGIN PAGE
   ============================ */
.bp-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}
.bp-login-box {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
}
.bp-login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.bp-login-logo .logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; color: #fff;
}
.bp-login-logo .logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
}
.bp-login-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}
