/* =========================================================
   SIGNAGE ERP - MODERN GLASSMORPHISM & RESPONSIVE CSS
   ========================================================= */

:root {
  --bg-color: #0f172a;
  --panel-bg: rgba(30, 41, 59, 0.7);
  --panel-border: rgba(255, 255, 255, 0.08);
  --accent-color: #3b82f6;
  --accent-hover: #2563eb;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --card-bg: #1e293b;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --info: #3b82f6;
  --sidebar-width: 250px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* App Container */
.app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
}

/* Sidebar (Desktop) */
.sidebar {
  width: var(--sidebar-width);
  background: var(--card-bg);
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem 1rem;
  position: fixed;
  height: 100vh;
  z-index: 100;
  transition: all 0.3s ease;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  padding-left: 0.5rem;
}

.menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.menu li {
  padding: 0.8rem 1rem;
  border-radius: 0.5rem;
  color: var(--text-muted);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.2s ease;
}

.menu li:hover, .menu li.active {
  background: var(--accent-color);
  color: #fff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Main Content Area */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 1.5rem 2rem;
  width: calc(100% - var(--sidebar-width));
  padding-bottom: 5.5rem; /* Space for Mobile Nav */
}

/* Header & Top Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel-bg);
  backdrop-filter: blur(10px);
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  border: 1px solid var(--panel-border);
  margin-bottom: 2rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
}

.user-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.time-badge {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.4rem 0.8rem;
  border-radius: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-logout {
  background: var(--danger);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: opacity 0.2s;
}

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

/* STRICT DYNAMIC PAGE LAYOUT */
.page {
  display: none !important;
}

.page.active-page {
  display: block !important;
  animation: fadeIn 0.25s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Grid & Dashboard Cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--panel-border);
  border-radius: 1rem;
  padding: 1.25rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.card h3 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.card .val {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-color);
}

/* Forms & Input Elements */
.form-card {
  background: var(--card-bg);
  border: 1px solid var(--panel-border);
  padding: 1.5rem;
  border-radius: 1rem;
  margin-bottom: 2rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-group label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

input, select, textarea {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--panel-border);
  color: var(--text-main);
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  outline: none;
  font-size: 0.95rem;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.btn-primary {
  background: var(--accent-color);
  color: #fff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

/* Modern Data Tables */
.table-container {
  background: var(--card-bg);
  border: 1px solid var(--panel-border);
  border-radius: 1rem;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1rem;
  border-bottom: 1px solid var(--panel-border);
  font-size: 0.9rem;
}

th {
  background: rgba(15, 23, 42, 0.4);
  color: var(--text-muted);
  font-weight: 600;
}

tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* =========================================================
   FLOATING TOAST NOTIFICATION SYSTEM
   ========================================================= */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 90vw;
  pointer-events: none;
}

.toast {
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  transform: translateY(-20px) scale(0.95);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  pointer-events: auto;
}

.toast.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-danger, .toast-error { border-left: 4px solid var(--danger); }
.toast-warning { border-left: 4px solid var(--warning); }
.toast-info { border-left: 4px solid var(--info); }

/* =========================================================
   MOBILE RESPONSIVE & BOTTOM NAVIGATION BAR
   ========================================================= */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--panel-border);
  padding: 0.5rem;
  z-index: 999;
}

.mobile-nav ul {
  display: flex;
  justify-content: space-around;
  list-style: none;
}

.mobile-nav li {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
}

.mobile-nav li.active {
  color: var(--accent-color);
  font-weight: bold;
}

.mobile-nav li svg {
  width: 20px;
  height: 20px;
  margin-bottom: 2px;
}

@media (max-width: 768px) {
  .sidebar {
    display: none; /* Hide Desktop Sidebar on Mobile */
  }

  .main-content {
    margin-left: 0;
    width: 100%;
    padding: 1rem;
    padding-bottom: 5.5rem;
  }

  .mobile-nav {
    display: block; /* Show Bottom Bar on Mobile */
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .user-controls {
    width: 100%;
    justify-content: space-between;
  }

  .toast-container {
    top: 15px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 90%;
  }
}
