:root {
  /* Default: Dark Mode (Gece) as it is the current state */
  --bg: #0a0c0f;
  --bg2: #11141a;
  --bg3: #181c24;
  --border: #232836;
  --accent: #e02424;
  --accent-glow: rgba(224, 36, 36, 0.4);
  --accent2: #ff4d4d;
  --blue: #e02424;
  --green: #10b981;
  --red: #ef4444;
  --text: #ffffff;
  --text2: #a0aec0;
  --text3: #718096;
  --glass: rgba(17, 20, 26, 0.8);
  --header-height: 80px;
  --sidebar-width: 280px;
}


[data-theme='light'] .sidebar {
    background: #ffffff !important;
}

[data-theme='light'] .sidebar-logo h1 {
    color: #0f172a !important;
}

[data-theme='light'] .news-strip {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

[data-theme='light'] .news-label {
    background: #f1f5f9 !important;
    color: var(--accent) !important;
    border: 1px solid #e2e8f0 !important;
}

[data-theme='light'] .search-box input {
    background: #ffffff !important;
    color: #0f172a !important;
}

[data-theme='light'] .icon-btn {
    background: #ffffff !important;
}

[data-theme='light'] .stat-card {
    background: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05) !important;
}

[data-theme='light'] .user-card {
    background: #f8fafc !important;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'DM Sans', sans-serif;
}

h1, h2, h3, h4, .syne {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
}

body {
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  display: flex;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-circle {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--accent-glow);
}

.truncate {
  max-width: 250px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: help;
}


.logo-circle span {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  color: #000;
  font-size: 1.2rem;
}

.sidebar-logo h1 {
  font-size: 1.2rem;
  letter-spacing: -0.5px;
}

.sidebar-nav {
  padding: 10px 20px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 14px 20px;
  border-radius: 12px;
  color: var(--text2);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 5px;
  cursor: pointer;
}

.nav-item i {
    font-size: 1.2rem;
}

.nav-item:hover, .nav-item.active {
  background: rgba(232, 160, 32, 0.1);
  color: var(--accent);
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(232, 160, 32, 0.15) 0%, rgba(232, 160, 32, 0) 100%);
    border-left: 3px solid var(--accent);
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg3);
  border-radius: 15px;
  border: 1px solid var(--border);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.user-info h4 {
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.user-info p {
  font-size: 0.75rem;
  color: var(--text3);
}

/* Main Content Wrapper */
.main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header Styling */
header {
  height: var(--header-height);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 90;
}

.search-box {
  width: 400px;
  position: relative;
}

.search-box input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 12px 20px 12px 45px;
  border-radius: 12px;
  color: var(--text);
  outline: none;
  transition: all 0.3s;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(232, 160, 32, 0.1);
}

.search-box i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.icon-btn {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 18px;
  height: 18px;
  background: var(--red);
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* Dashboard Content */
.content {
  padding: 40px;
}

/* Hero Slider Section */
.hero-slider {
  height: 400px;
  border-radius: 30px;
  overflow: hidden;
  position: relative;
  margin-bottom: 30px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.slide {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: absolute;
  transition: opacity 0.8s ease;
}

.slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 60%);
}

.slide-content {
  position: relative;
  z-index: 10;
  max-width: 600px;
}

.slide-content h2 {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 20px;
  transform: translateY(30px);
  opacity: 0;
  animation: slideIn 0.8s forwards 0.3s;
  color: #fff; /* Always white */
}

.slide-content p {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.8); /* Always white-ish */
  margin-bottom: 30px;
  transform: translateY(30px);
  opacity: 0;
  animation: slideIn 0.8s forwards 0.5s;
}

.btn-primary {
  background: var(--accent);
  color: #000;
  padding: 15px 35px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  display: inline-block;
  transition: all 0.3s;
  transform: translateY(30px);
  opacity: 0;
  animation: slideIn 0.8s forwards 0.7s;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  transform: scale(1.05) translateY(-5px);
  box-shadow: 0 10px 20px var(--accent-glow);
}

@keyframes slideIn {
  to { transform: translateY(0); opacity: 1; }
}

/* Banners Grid */
.banners-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.banner-card {
  height: 200px;
  border-radius: 20px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  cursor: pointer;
  transition: all 0.4s;
}

.banner-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.banner-card:hover {
  transform: translateY(-10px);
}

.banner-content {
  position: relative;
  z-index: 5;
  color: #fff; /* Always white */
}

.banner-content h4, .banner-content p {
    color: #fff !important;
}

.banner-tag {
  background: var(--accent);
  color: #000;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: inline-block;
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 25px;
  border-radius: 20px;
  transition: all 0.3s;
  cursor: pointer;
}

.stat-card:hover {
  background: var(--bg3);
  border-color: var(--accent);
  transform: translateY(-5px);
}

.stat-icon {
  width: 50px;
  height: 50px;
  background: rgba(232, 160, 32, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-size: 1.5rem;
  margin-bottom: 15px;
  transition: all 0.3s;
}

.stat-card:hover .stat-icon {
  background: var(--accent);
  color: #000;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 5px;
}

.stat-label {
  color: var(--text3);
  font-size: 0.85rem;
  font-weight: 500;
}

/* Announcements Strip */
.news-strip {
  background: var(--accent);
  color: #000;
  padding: 12px 40px;
  display: flex;
  align-items: center;
  gap: 20px;
  overflow: hidden;
  margin-bottom: 40px;
  border-radius: 15px;
}

.news-label {
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.8rem;
  background: #000;
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 5px;
  white-space: nowrap;
}

.news-ticker {
  white-space: nowrap;
  animation: ticker 30s linear infinite;
  font-weight: 600;
}

@keyframes ticker {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-size: 1rem;
}

/* Brands Chip List */
/* Brands Chip List (Grid Version) */
.brands-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); /* Auto fit but roughly 20 per row on wide screens */
  gap: 8px;
  max-height: 350px;
  overflow-y: auto;
  padding: 15px;
  background: var(--bg3);
  border-radius: 15px;
  border: 1px solid var(--border);
}

@media (min-width: 1600px) {
    .brands-list {
        grid-template-columns: repeat(20, 1fr);
    }
}

.brand-chip {
  padding: 8px 4px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-chip:hover, .brand-chip.active {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  box-shadow: 0 5px 15px rgba(232, 160, 32, 0.2);
}

/* Table Card */
.table-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 25px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  background: var(--bg3);
  padding: 20px;
  text-align: left;
  font-size: 0.85rem;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

td {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}

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

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

.product-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.product-img {
  width: 50px;
  height: 50px;
  background: var(--bg3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
}

.product-meta h5 {
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.product-meta p {
  font-size: 0.8rem;
  color: var(--text3);
}

.price-tag {
  font-weight: 700;
  color: var(--accent);
}

.stock-status {
  padding: 6px 15px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
}

.status-in { background: rgba(16, 185, 129, 0.1); color: var(--green); }
.status-low { background: rgba(232, 160, 32, 0.1); color: var(--accent); }
.status-out { background: rgba(239, 68, 68, 0.1); color: var(--red); }

/* Buttons & Utils */
.btn-mini {
  padding: 8px 15px;
  border-radius: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-mini:hover {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.hidden { display: none !important; }

/* Existing Modals Compatibility */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: var(--bg2);
  border: 1px solid var(--border);
  padding: 40px;
  border-radius: 25px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text2);
  font-size: 0.9rem;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 12px 15px;
  border-radius: 12px;
  color: var(--text);
  outline: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 30px;
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--text3);
  cursor: pointer;
  font-weight: 600;
}

/* Toast styling */
#toast-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 2000;
}

.toast {
    background: var(--bg2);
    border: 1px solid var(--accent);
    color: var(--text);
    padding: 15px 25px;
    border-radius: 12px;
    margin-top: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: toastIn 0.3s forwards;
}

@keyframes toastIn {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Scroll area for existing tables */
.scroll-area {
  max-height: 600px;
  overflow-y: auto;
}

.table-input {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border);
    padding: 8px 12px;
    border-radius: 8px;
    color: var(--text);
    outline: none;
}

.table-input.changed {
    border-color: var(--green);
}

.occurrence-badge {
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--bg3);
    font-size: 0.75rem;
}
.occurrence-badge.multiple {
    background: var(--red);
    color: white;
}

.balance-badge.low {
    color: var(--red);
    font-weight: bold;
}

.admin-only, .supplier-only {
    /* Marker classes - no global display style as it breaks table cells */
}

/* Pagination container */
.pagination-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}
.page-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--text2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}
.page-btn.active {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}
/* News Ticker Separation */
.ticker-divider {
    margin: 0 20px;
    color: var(--accent);
    font-weight: bold;
    display: inline-block;
    filter: drop-shadow(0 0 5px var(--accent-glow));
}

.ticker-item {
    font-weight: 500;
}

.news-strip {
    margin-bottom: 20px;
    border-radius: 15px;
    background: var(--bg2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 2px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.news-label {
    background: var(--bg3);
    color: var(--accent);
    padding: 8px 15px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 0.7rem;
    letter-spacing: 1px;
    margin-right: 15px;
    border: 1px solid var(--border);
}

.news-ticker {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.content-section {
    width: 100%;
}

[data-theme='light'] {
  --bg: #f8fafc !important;
  --bg2: #ffffff !important;
  --bg3: #f1f5f9 !important;
  --border: #cbd5e1 !important;
  --text: #0f172a !important;
  --text2: #334155 !important;
  --text3: #64748b !important;
  --glass: rgba(255, 255, 255, 0.9) !important;
}

/* --- NEW FEATURES STYLES --- */

/* Footer */
.app-footer {
    margin-top: auto;
    padding: 30px 40px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg2);
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-link-btn {
    background: transparent;
    border: none;
    color: var(--text2);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s;
}

.footer-link-btn:hover {
    color: var(--red);
    text-decoration: underline;
}

.footer-copy {
    font-size: 0.85rem;
    color: var(--text3);
}

/* Modal Content Viewer */
#footer-viewer-content {
    line-height: 1.6;
}

#footer-viewer-content h1, #footer-viewer-content h2 {
    color: var(--red);
    margin-bottom: 15px;
}

/* Sidebar support button highlight */
#btn-support {
    margin-top: 10px;
    background: rgba(224, 36, 36, 0.1);
    color: var(--red);
}

#btn-support:hover {
    background: var(--red);
    color: #fff;
}

/* UI FIX: Header backgrounds spanning full width */
.table-card h3 {
    margin: 0;
    padding-bottom: 0;
}

/* Standardize table-card headers if they have buttons */
.table-card > div:first-child {
    background: rgba(255,255,255,0.01);
    border-bottom: 1px solid var(--border);
}

/* Ensure content wrapper grows to push footer down */
.main-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content {
    flex: 1;
}

/* Audit logs specific */
#audit-logs-table td {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.85rem;
}