:root {
  --bg-main: #f5f5f5; /* Light grey/off-white background */
  --bg-panel: #eef0f2;
  --bg-white: #ffffff;
  --text-main: #000000;
  --text-muted: #666666;
  --accent-lime: #c5ff00; /* Lime green from screenshot */
  --accent-red: #ff3333;
  --border-color: #000000;
  
  --font-display: 'Bebas Neue', sans-serif;
  --font-mono: 'Space Mono', monospace;
  --font-sans: 'Space Grotesk', sans-serif;
  
  --shadow-solid: 4px 4px 0px 0px #000000;
  --shadow-solid-hover: 2px 2px 0px 0px #000000;
  
  --transition-fast: 0.15s ease-in-out;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  letter-spacing: 1px;
  text-transform: uppercase;
}

a {
  color: var(--text-main);
  text-decoration: none;
}

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

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
#sidebar {
  width: 260px;
  background-color: var(--bg-panel);
  border-right: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  transition: width 0.3s ease;
}

.sidebar-header {
  height: 80px;
  padding: 0 20px;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: bold;
  background: var(--text-main);
  color: var(--bg-white);
  padding: 4px 8px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1;
  letter-spacing: 1px;
}

.brand-subtitle {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 20px 0;
}

/* Hide scrollbar for nav */
.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--text-muted);
}

.nav-group {
  margin-bottom: 24px;
}

.nav-group-label {
  display: block;
  padding: 0 24px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 10px 24px;
  color: var(--text-main);
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 1px;
  transition: background-color var(--transition-fast);
  position: relative;
}

.nav-item i {
  width: 20px;
  height: 20px;
  margin-right: 12px;
  stroke-width: 2px;
}

.nav-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.nav-item.active {
  background-color: rgba(0, 0, 0, 0.05);
  border-left: 4px solid var(--text-main);
  padding-left: 20px;
}

.nav-badge {
  background-color: var(--accent-red);
  color: var(--bg-white);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: auto;
}

.sidebar-footer {
  padding: 20px;
  border-top: 2px solid var(--border-color);
  background-color: #e5e5e5;
}

.admin-mini {
  display: none; /* Hidden by default, useful for collapsed state later */
}

.sidebar-version {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
}

/* ==========================================================================
   MAIN AREA & TOPBAR
   ========================================================================== */
#main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background-color: var(--bg-panel);
}

#topbar {
  height: 80px;
  border-bottom: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 30px;
  background-color: var(--bg-panel);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.icon-btn {
  background: none;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  border-color: var(--border-color);
  background-color: var(--bg-white);
}

#page-title {
  font-size: 28px;
  margin: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-white);
  border: 2px solid var(--border-color);
  padding: 4px 8px;
  width: 300px;
  position: relative;
}

.search-box i {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.search-box input {
  border: none;
  background: none;
  outline: none;
  padding: 0 10px;
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
}

/* Global Search Results */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: -2px;
  width: 400px;
  background: var(--bg-white);
  border: 2px solid var(--border-color);
  box-shadow: 8px 8px 0px 0px #000;
  z-index: 1000;
  max-height: 450px;
  overflow-y: auto;
}

.search-results-dropdown.hidden {
  display: none;
}

.search-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--bg-panel);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

.search-item:hover {
  background: var(--accent-lime);
  color: black;
}

.search-item i {
  width: 18px;
  height: 18px;
  opacity: 0.6;
}

.search-item-info {
  flex: 1;
}

.search-item-title {
  font-weight: bold;
  font-size: 13px;
  text-transform: uppercase;
}

.search-item-meta {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.search-results-footer {
  padding: 8px 16px;
  background: var(--bg-panel);
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border-color);
}

.search-go-btn {
  background: var(--text-main);
  color: white;
  border: none;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: var(--transition-fast);
}

.search-go-btn:hover {
  background: var(--accent-lime);
  color: black;
}


.notif-btn {
  position: relative;
  border: 2px solid var(--border-color);
  background: var(--bg-white);
}

.notif-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 10px;
  height: 10px;
  background-color: var(--accent-red);
  border-radius: 50%;
  border: 2px solid var(--bg-panel);
}

.topbar-divider {
  width: 2px;
  height: 40px;
  background-color: var(--border-color);
}

.admin-info {
  text-align: right;
}

.admin-label {
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1;
}

.admin-role {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--text-main);
  color: var(--bg-white);
  border: 2px solid var(--border-color);
  font-family: var(--font-display);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.avatar-btn.sm {
  width: 32px;
  height: 32px;
  font-size: 16px;
}

/* User Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  background: var(--bg-white);
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-solid);
  z-index: 200;
  display: none;
  flex-direction: column;
}

.user-dropdown.show {
  display: flex;
}

.dropdown-header {
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.dd-name {
  font-family: var(--font-display);
  font-size: 18px;
}

.dd-email {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.dropdown-divider {
  height: 2px;
  background-color: var(--border-color);
}

.dd-item {
  padding: 12px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.dd-item i {
  width: 16px;
  height: 16px;
}

.dd-item:hover {
  background: var(--bg-panel);
}

.dd-item.danger {
  color: var(--accent-red);
}

/* ==========================================================================
   PAGE CONTENT
   ========================================================================== */
#page-content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  position: relative;
}

/* Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 2px;
}

.loader {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   COMMON COMPONENTS (Cards, Tables, Forms)
   ========================================================================== */
   
/* Brulatist Box */
.b-box {
  background: var(--bg-white);
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-solid);
  padding: 24px;
  margin-bottom: 30px;
}

.b-box.lime {
  background-color: var(--accent-lime);
}

.b-box-header {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 1px;
  margin-bottom: 20px;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Stat Cards */
.stat-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: var(--bg-white);
  border: 2px solid var(--border-color);
  padding: 20px;
  position: relative;
}

.stat-card.highlight {
  background: var(--accent-lime);
}

.stat-title {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.stat-card.highlight .stat-title {
  color: var(--text-main);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 42px;
  line-height: 1;
  margin-bottom: 15px;
}

.stat-trend {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #00aa00; /* Green for positive */
}

.stat-icon {
  position: absolute;
  top: 20px;
  right: 20px;
  opacity: 0.2;
}

.stat-icon i {
  width: 48px;
  height: 48px;
}

/* Dashboard Layout */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

/* Tables */
.b-table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.b-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 12px;
}

.b-table th {
  text-align: left;
  padding: 12px;
  border-bottom: 2px solid var(--border-color);
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: normal;
}

.b-table td {
  padding: 16px 12px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  vertical-align: middle;
}

.b-table tr:last-child td {
  border-bottom: none;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
}

.badge.processing {
  background: var(--bg-white);
}

.badge.completed, .badge.delivered {
  background: #e0ffd4;
  color: #006600;
  border-color: #006600;
}

.badge.cancelled {
  background: #ffebeb;
  color: var(--accent-red);
  border-color: var(--accent-red);
}

/* Buttons */
.b-btn {
  background: var(--bg-white);
  border: 2px solid var(--border-color);
  box-shadow: var(--shadow-solid);
  font-family: var(--font-display);
  font-size: 16px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.1s ease;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.b-btn:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-solid-hover);
}

.b-btn.primary {
  background: var(--text-main);
  color: var(--bg-white);
}

.b-btn.primary:active {
  box-shadow: 2px 2px 0px 0px var(--accent-lime);
}

/* Forms */
.b-form-group {
  margin-bottom: 20px;
}

.b-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.b-input, .b-select, .b-textarea {
  width: 100%;
  border: 2px solid var(--border-color);
  background: var(--bg-white);
  padding: 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
}

.b-input:focus, .b-select:focus, .b-textarea:focus {
  border-color: var(--text-main);
  box-shadow: 2px 2px 0 0 var(--border-color);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(238, 240, 242, 0.8);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay.hidden {
  display: none;
}

.modal-box {
  background: var(--bg-white);
  border: 2px solid var(--border-color);
  box-shadow: 8px 8px 0px 0px var(--border-color);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: 2px solid var(--border-color);
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--bg-panel);
}

/* Toast */
#toast-container {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-white);
  border: 2px solid var(--border-color);
  box-shadow: 4px 4px 0px 0px var(--border-color);
  padding: 16px 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease-out forwards;
}

.toast.success { border-color: #006600; box-shadow: 4px 4px 0px 0px #006600; }
.toast.error { border-color: var(--accent-red); box-shadow: 4px 4px 0px 0px var(--accent-red); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Page Header Actions */
.page-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Media Upload Styles */
.media-upload-container {
  border: 2px dashed var(--border-color);
  padding: 30px;
  text-align: center;
  background: var(--bg-panel);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 20px;
}

.media-upload-container:hover {
  background: var(--bg-white);
  border-style: solid;
}

.media-upload-container i {
  width: 40px;
  height: 40px;
  margin-bottom: 10px;
  color: var(--text-muted);
}

.media-upload-container p {
  font-family: var(--font-display);
  font-size: 18px;
  margin-bottom: 5px;
}

.media-upload-container span {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.media-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.media-preview-item {
  position: relative;
  border: 2px solid var(--border-color);
  aspect-ratio: 1;
  background: #eee;
  overflow: hidden;
}

.media-preview-item img, .media-preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-preview-item.pending {
  border-color: var(--accent-lime);
}

.remove-media {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  background: var(--accent-red);
  color: white;
  border: 1px solid black;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.remove-media i {
  width: 14px;
  height: 14px;
}

.pending-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--accent-lime);
  color: black;
  font-family: var(--font-mono);
  font-size: 8px;
  text-align: center;
  padding: 2px 0;
  font-weight: bold;
}

/* Table Media Styles */
.table-thumb {
  width: 50px;
  height: 50px;
  border: 1px solid var(--border-color);
  background: #eee;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.table-thumb img, .table-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.no-thumb {
  font-size: 8px;
  text-align: center;
  color: var(--text-muted);
}



/* Notification Dropdown */
.notif-dropdown {
  position: absolute;
  top: 60px;
  right: 120px;
  width: 320px;
  background: var(--bg-white);
  border: 2px solid var(--border-color);
  box-shadow: 8px 8px 0 0 var(--border-color);
  z-index: 1000;
  transition: all 0.2s;
}

.notif-dropdown.hidden {
  display: none;
}

.notif-header {
  padding: 12px 16px;
  border-bottom: 2px solid var(--border-color);
  font-family: var(--font-display);
  font-size: 16px;
  background: var(--accent-lime);
  color: var(--text-main);
}

.notif-items-mini {
  max-height: 350px;
  overflow-y: auto;
}

.notif-item-mini {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  cursor: pointer;
}

.notif-item-mini:hover {
  background: rgba(197,255,0,0.1);
}

.notif-mini-title {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--text-main);
}

.notif-mini-meta {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

.notif-footer {
  padding: 12px;
  border-top: 2px solid var(--border-color);
  text-align: center;
  background: var(--bg-panel);
}

.notif-footer a {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: 1px;
}

.notif-footer a:hover {
  background: var(--text-main);
  color: var(--bg-white);
}
