/* 
  Recycling Platform - Premium Design System
  RTL Support, Modern Gradients, Micro-animations
*/

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800;900&display=swap');

:root {
  --primary: #f97316; /* Vibrant Orange restored */
  --primary-dark: #ea580c;
  --primary-light: #fff7ed;
  --secondary: #fb923c;
  --bg-main: #f8fafc;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --white: #ffffff;
  --card-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
  --glass: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.25);
  --border-color: #e2e8f0;
  --hero-gradient: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  --hero-text: #ffffff;
}

[data-theme='dark'] {
  --bg-main: #0c0a09;
  --text-main: #f8fafc;
  --text-muted: #a8a29e;
  --white: #1c1917;
  --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  --glass: rgba(28, 25, 23, 0.9);
  --border-color: #292524;
  --primary: #fb923c;
  --hero-gradient: linear-gradient(160deg, #7c2d12 0%, #9a3412 50%, #c2410c 100%);
  --hero-text: #ffffff;
}

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

body {
  font-family: 'Tajawal', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Animations */
@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0); }
}

@keyframes pulse-soft {
  0% { transform: scale(1); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
  50% { transform: scale(1.02); box-shadow: 0 20px 50px rgba(249, 115, 22, 0.3); }
  100% { transform: scale(1); box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
}

.animate-slide-up { animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-fade-in { animation: fadeIn 0.4s ease forwards; }

/* Layout Containers */
.page-container {
  display: none !important; /* Force hide unless active */
  width: 100%;
}

.page-container.active {
  display: block !important;
}

#landing-page.active {
  display: flex !important;
  flex-direction: column;
}

#landing-page {
  max-width: none;
  min-height: 100vh;
  background: var(--hero-gradient);
  padding: 0;
  position: relative;
  overflow-x: hidden;
}

.landing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
}

@media (max-width: 480px) {
  .landing-nav {
    padding: 0.8rem 1rem;
  }
  .nav-links {
    gap: 0.3rem !important;
  }
}

.nav-logo {
  color: var(--primary); /* Use primary orange for branding in the light nav */
  font-weight: 900;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-admin-nav {
  background: var(--white);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.6rem 1.2rem;
  border-radius: 14px;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Glassmorphism Components */
.glass-card {
  background: var(--glass);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--glass-border);
  border-radius: 32px;
  padding: 2.5rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
  color: var(--text-main); /* FIX: Dark text on Light Glass */
}

.glass-btn {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 0.8rem 1.5rem;
  border-radius: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.glass-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.landing-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  gap: 3rem;
}

.hero-content { text-align: center; }
.hero-logo { font-size: 5rem; animation: float 4s ease-in-out infinite; margin-bottom: 1.5rem; }
.hero-title { 
  color: #ffffff; /* Contrast fix: White on Orange */
  font-size: clamp(2.5rem, 8vw, 4.5rem); 
  font-weight: 900; 
  margin-bottom: 1.5rem; 
  line-height: 1.1;
  text-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
[data-theme='dark'] .hero-title {
  text-shadow: 0 4px 15px rgba(0,0,0,0.4);
}
.hero-subtitle { 
  color: rgba(255, 255, 255, 0.9); 
  font-size: clamp(1.1rem, 3.5vw, 1.4rem); 
  max-width: 750px; 
  margin: 0 auto; 
  line-height: 1.8; 
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.login-section {
  width: 100%;
  max-width: 900px;
}

.section-tag {
  color: rgba(255,255,255,0.5);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.section-tag::before, .section-tag::after {
  content: '';
  height: 1px;
  flex: 1;
  background: rgba(255,255,255,0.1);
  max-width: 60px;
}

.role-cards-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .role-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.role-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border-radius: 28px;
  padding: 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.role-card:hover {
  transform: translateY(-8px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 30px 60px rgba(0,0,0,0.4);
}

.card-arrow {
  position: absolute;
  left: 2rem;
  font-size: 1.5rem;
  color: var(--primary);
  opacity: 0;
  transition: all 0.3s;
  transform: translateX(-10px);
}

.role-card:hover .card-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Hero section subtitle refined above */

/* Role Icons & Details reached by consolidated styles above */

.role-icon {
  width: 64px;
  height: 64px;
  background: rgba(16, 185, 129, 0.2);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

.role-info h3 {
  color: var(--white);
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.role-info p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

.admin-link {
  margin-top: 2rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.8rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  transition: all 0.2s;
}

.admin-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.05);
}

/* Auth Page Specific */
#auth-page {
  background-color: #f0fdf4;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-card {
  background: var(--white);
  border-radius: 32px;
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.08);
}

.btn-back {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  margin-bottom: 2rem;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header .emoji {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  display: block;
}

.auth-header h2 {
  font-size: 1.75rem;
  font-weight: 900;
}

.auth-toggle {
  display: flex;
  background: #f1f5f9;
  padding: 0.3rem;
  border-radius: 16px;
  margin-bottom: 2rem;
}

.auth-toggle button {
  flex: 1;
  padding: 0.8rem;
  border: none;
  background: transparent;
  font-family: inherit;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.2s;
}

.auth-toggle button.active {
  background: var(--white);
  color: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: #475569;
}

.form-input {
  width: 100%;
  padding: 1rem 1.2rem;
  border: 2px solid var(--border-color);
  border-radius: 16px;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s;
  background: var(--bg-main);
  color: var(--text-main);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.btn-submit {
  width: 100%;
  padding: 1.1rem;
  background: var(--primary-dark);
  color: var(--white);
  border: none;
  border-radius: 18px;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 10px 20px -5px rgba(5, 150, 105, 0.4);
  margin-top: 1rem;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 25px -5px rgba(5, 150, 105, 0.5);
}

.error-msg {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444; /* Darker red for visibility in light mode */
  padding: 1rem;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  text-align: center;
  backdrop-filter: blur(10px);
  display: none; /* Hidden by default */
  font-weight: bold;
}

.error-msg-luxury {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 1rem;
  border-radius: 16px;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  text-align: center;
  backdrop-filter: blur(10px);
}

/* Elegant Auth Container & Card */
.elegant-auth-container {
    width: 100%;
    max-width: 480px;
    margin-top: 3rem;
    position: relative;
    padding: 20px;
}

.elegant-card-glow {
    position: absolute;
    top: -10%; left: -10%; right: -10%; bottom: -10%;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.2) 0%, transparent 70%);
    filter: blur(40px);
    z-index: 0;
    pointer-events: none;
}

/* Luxury V4 - Radiant Glass Auth */
.luxury-v4-card {
    background: rgba(255, 255, 255, 0.12); /* Increased opacity for clarity */
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 40px;
    padding: 3rem 2rem; /* Adjusted for mobile default, desktop override below */
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.15);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

@media (min-width: 768px) {
    .luxury-v4-card {
        padding: 4rem 3rem;
    }
}

.luxury-v4-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.v4-badge {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.v4-title {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.v4-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2.5rem;
}

.google-v4-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.08); /* Transparent glassy bg */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 1.5rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.google-v4-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.google-icon-circle {
    width: 40px;
    height: 40px;
    background: white; /* Clean white circle for the logo */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.google-icon-circle img {
    width: 24px !important;
    height: 24px !important;
}

.v4-btn-text {
    color: white; /* White text matching the theme */
    font-size: 1.1rem;
    font-weight: 800;
}

.v4-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.v4-footer span {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    font-weight: 600;
}

.auth-brand {
    text-align: center;
    margin-bottom: 2.5rem;
}

.brand-ring {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: pulse-gold 3s infinite;
}

.lock-icon { font-size: 2.5rem; }

@keyframes pulse-gold {
    0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(249, 115, 22, 0); }
    100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); }
}

.auth-luxury-title {
    color: white;
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 1rem;
    letter-spacing: -0.5px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0;
    opacity: 0.5;
}

.auth-divider::before, .auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: white;
}

.auth-divider span {
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.auth-instruction {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    text-align: center;
}

/* Luxury Google Button */
.google-luxury-btn {
    width: 100%;
    position: relative;
    background: white;
    border: none;
    padding: 1.2rem;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.google-luxury-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    background: #fdfdfd;
}

.google-luxury-btn:hover .btn-glow-layer {
    opacity: 0.2;
}

.google-luxury-btn img {
    width: 28px;
    height: 28px;
    z-index: 2;
}

.google-luxury-btn span {
    color: #1e293b;
    font-size: 1.15rem;
    font-weight: 800;
    z-index: 2;
}

.btn-glow-layer {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(249, 115, 22, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1;
}

.auth-footer-luxury {
    margin-top: 3rem;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
}

.auth-footer-luxury p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-weight: 500;
}

/* --- NEW ADMIN FEATURES STYLES --- */
.status-banned {
    opacity: 0.6 !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0;
}

.btn-ban {
    background: #fee2e2;
    color: #ef4444;
    border: 1px solid #fecaca;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-activate {
    background: #dcfce7;
    color: #10b981;
    border: 1px solid #bbf7d0;
    padding: 0.4rem 0.8rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ban:hover { background: #fecaca; }
.btn-activate:hover { background: #bbf7d0; }

.perm-tag {
    font-size: 0.6rem;
    background: #fff7ed;
    color: #c2410c;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 4px;
    font-weight: 700;
}

.tons-val { margin-bottom: 0.2rem !important; }
#adm-total-value {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    transition: all 0.3s;
}

[data-theme="light"] #adm-total-value {
    background: white;
    color: var(--primary-dark);
}


/* Dashboard Header */
.dash-header {
  padding: 1rem 1.5rem 3rem;
  color: var(--white);
  position: relative;
  overflow: hidden;
  border-radius: 0 0 32px 32px;
}

@media (min-width: 1024px) {
  .dash-header {
    border-radius: 24px;
    margin-top: 1.5rem;
    padding: 2rem 3rem 4rem;
  }
}

.dash-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
}

.bg-restaurant-header { background: linear-gradient(135deg, #f97316, #ea580c); }
.bg-factory-header { background: linear-gradient(135deg, #ea580c, #c2410c); }
.bg-admin-header { background: linear-gradient(135deg, #1c1917, #44403c); }

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.user-info h2 { font-size: 1.5rem; font-weight: 900; }
.user-info p { opacity: 0.8; font-size: 0.85rem; }

.header-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
}

.badge-role {
  background: rgba(255,255,255,0.2);
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
}

.btn-logout {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  padding: 0.5rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-logout:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* --- ADMIN ENHANCEMENTS --- */
.admin-tabs {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--white);
    border-radius: 16px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    scrollbar-width: none;
    justify-content: center;
    width: 100%;
}
.admin-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
    flex: 0 1 auto;
    min-width: 140px;
    padding: 0.8rem 1.2rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 800;
    font-family: inherit;
    white-space: nowrap;
    font-size: 0.9rem;
    text-align: center;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 15px rgba(16, 185, 129, 0.2);
}

.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table th {
    background: var(--bg-main);
    padding: 1rem;
    text-align: right;
    font-weight: 800;
    color: var(--primary-dark);
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.admin-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    border-bottom: 1px solid #f1f5f9;
}

.btn-delete {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fee2e2;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.75rem;
    cursor: pointer;
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-right: 5px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 300px;
}

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

/* --- GLASSMORPHISM --- */
.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.eco-progress {
    height: 8px;
    background: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
}

.eco-progress-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease-in-out;
}

/* Stats Row */
.stats-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

@media (min-width: 768px) {
  .stats-scroll {
    overflow-x: visible;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
}

.stats-scroll::-webkit-scrollbar { display: none; }

.stat-item {
  background: rgba(255,255,255,0.12);
  padding: 1rem 1.5rem;
  border-radius: 20px;
  min-width: 120px;
  border: 1px solid rgba(255,255,255,0.1);
}

.stat-val { font-size: 1.75rem; font-weight: 900; line-height: 1; margin-bottom: 0.3rem;}
.stat-label { font-size: 0.75rem; opacity: 0.7; font-weight: 600; }

/* Main Content Area */
.dash-content {
  margin-top: -1.5rem;
  background: var(--bg-main);
  border-radius: 32px 32px 0 0;
  padding: 2rem 1.5rem;
  min-height: calc(100vh - 180px);
}

@media (min-width: 1024px) {
  .dash-content {
    margin-top: 1rem;
    border-radius: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    background: transparent;
  }
  
  .main-dash-column { grid-column: 1; }
  .side-dash-column { grid-column: 2; }
}

.section-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* Cards & Components */
.card {
  background: var(--white);
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.2rem;
  border: 1px solid var(--border-color);
}

.cta-button {
  width: 100%;
  padding: 1.8rem;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, #059669, #047857);
  color: var(--white);
  font-family: inherit;
  font-size: 1.4rem;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  box-shadow: 0 15px 35px rgba(5, 150, 105, 0.3);
  margin-bottom: 2rem;
  transition: transform 0.2s;
}

.cta-button:active { transform: scale(0.98); }

.shipment-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.2rem;
  background: var(--white);
  border-radius: 20px;
  margin-bottom: 1rem;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
}

.ship-info { display: flex; gap: 1rem; }
.ship-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.ship-details h4 { font-weight: 800; margin-bottom: 0.2rem; }
.ship-details p { font-size: 0.85rem; color: var(--text-muted); }

.status-badge {
  padding: 0.35rem 0.8rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.status-dot { width: 6px; height: 6px; border-radius: 50%; }

/* Alerts */
.weight-alert {
  border: 2px solid var(--secondary);
  background: #f5f3ff;
  border-radius: 24px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 15px 30px -10px rgba(59, 130, 246, 0.15);
}

.alert-header { display: flex; gap: 1rem; margin-bottom: 1.2rem; }
.alert-header h4 { font-weight: 800; }

.info-grid {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 0.9rem;
}

.diff-box {
  background: #fef2f2;
  color: #991b1b;
  padding: 0.8rem;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
  text-align: center;
}

.btn-group { display: flex; gap: 0.8rem; }
.btn-group button { flex: 1; padding: 0.9rem; border: none; border-radius: 14px; font-family: inherit; font-weight: 800; cursor: pointer; }
.btn-confirm { background: var(--primary-dark); color: var(--white); }
.btn-report { background: var(--danger); color: var(--white); }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  width: 100%;
  max-width: 560px;
  background: var(--white);
  color: var(--text-main);
  border-radius: 32px 32px 0 0;
  padding: 2.5rem 1.5rem;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
  border-top: 1px solid var(--primary);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.modal-header h3 { font-size: 1.5rem; font-weight: 900; }
.btn-close {
  background: #f1f5f9;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--text-muted);
}

.material-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.mat-card {
  padding: 2rem 1rem;
  border-radius: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border-width: 2px;
  border-style: solid;
}

.mat-card:hover { transform: scale(1.03); }
.mat-card .emoji { font-size: 3rem; display: block; margin-bottom: 1rem; }
.mat-card span { font-weight: 900; font-size: 1.1rem; }

.weight-input-container {
  display: flex;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.weight-input-container input {
  flex: 1;
  font-size: 2rem;
  font-weight: 900;
  text-align: center;
  padding: 1rem;
}

.unit-toggle {
  display: flex;
  background: #f1f5f9;
  border-radius: 16px;
  overflow: hidden;
}

.unit-toggle button {
  padding: 0 1.5rem;
  border: none;
  background: transparent;
  font-weight: 800;
  cursor: pointer;
}

.unit-toggle button.active {
  background: var(--primary-dark);
  color: var(--white);
}

.photo-upload {
  width: 100%;
  aspect-ratio: 16/9;
  border: 2px dashed #cbd5e1;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #f8fafc;
  color: var(--text-muted);
  margin-bottom: 2rem;
  overflow: hidden;
}

.photo-upload:hover { border-color: var(--primary); background: #f0fdf4; }
.photo-upload img { width: 100%; height: 100%; object-fit: cover; }

/* Admin Hero */
.admin-tons-hero {
  background: var(--hero-gradient);
  padding: 3rem 2rem;
  border-radius: 32px;
  color: var(--hero-text);
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: var(--card-shadow);
}

.admin-tons-hero .eco-bg {
  position: absolute;
  top: -20px;
  left: -20px;
  font-size: 8rem;
  opacity: 0.1;
}

.tons-val { font-size: 4.5rem; font-weight: 900; line-height: 1; margin: 0.5rem 0; }
.tons-label { font-size: 1.1rem; opacity: 0.8; }

/* Progress Bar List */
.mat-progress-item {
  margin-bottom: 1.5rem;
}

.mat-progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-weight: 800;
}

.progress-track {
  height: 10px;
  background: #f1f5f9;
  border-radius: 5px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 5px;
  transition: width 1s ease-in-out;
}

/* Empty States */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-icon { font-size: 4rem; display: block; margin-bottom: 1rem; opacity: 0.5; }

/* Responsive adjustments */
@media (max-width: 480px) {
  .hero-title { font-size: 2rem; }
  .auth-card { padding: 1.5rem; }
  .tons-val { font-size: 3.5rem; }
}

/* About Section Styles */
.about-container {
  max-width: 900px;
  width: 100%;
  margin: 0 auto 4rem;
}

.about-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  border-radius: 32px;
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
  text-align: center;
}

@media (min-width: 768px) {
  .about-card {
    flex-direction: row;
    text-align: right;
  }
}

.about-image {
  width: 180px;
  height: 180px;
  border-radius: 28px;
  overflow: hidden;
  border: 4px solid var(--primary);
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
  flex-shrink: 0;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about-text h3 {
  color: #6ee7b7;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.about-text p {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.programmer-info {
  background: rgba(255, 255, 255, 0.05);
  padding: 1.2rem;
  border-radius: 16px;
  display: inline-block;
  text-align: right;
}

.programmer-info p {
  margin: 0.2rem 0 !important;
  font-size: 0.85rem !important;
  color: #6ee7b7 !important;
  opacity: 1 !important;
}

/* Auth Motto */
.auth-motto {
  font-size: 0.85rem;
  color: var(--primary-dark);
  font-weight: 700;
  margin-bottom: 2rem;
  line-height: 1.6;
  background: var(--primary-light);
  padding: 1rem;
  border-radius: 16px;
  border-right: 5px solid var(--primary);
  text-align: center;
}

/* Secondary Button */
.btn-secondary {
  border: 1px solid #cbd5e1;
  background: white;
  color: var(--text-main);
  padding: 0.6rem 1rem;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

/* Map Picker Container Fix */
#map-picker {
  z-index: 10;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

/* Timeline Styles */
.timeline-container {
  position: relative;
  margin-top: 1rem;
}

#track-timeline {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  padding-right: 1.5rem;
  border-right: 2px dashed #e2e8f0;
  margin-right: 10px;
}

.timeline-item {
  position: relative;
  padding-right: 1rem;
}

.timeline-dot {
  position: absolute;
  right: -31px;
  top: 0;
  width: 22px;
  height: 22px;
  background: #cbd5e1;
  border: 4px solid var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.7rem;
  font-weight: 900;
  transition: all 0.3s;
  z-index: 2;
}

.timeline-item.completed .timeline-dot {
  background: var(--primary);
  border-color: var(--primary-light);
}

.timeline-item.current .timeline-dot {
  background: var(--primary);
  box-shadow: 0 0 0 6px var(--primary-light);
  animation: pulse-soft 2s infinite;
}

.timeline-content h5 {
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 0.2rem;
  color: var(--text-muted);
}

.timeline-item.completed .timeline-content h5 {
  color: var(--text-main);
}

.timeline-content p {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Truck Icon on Map */
.truck-emoji-icon {
  background: transparent;
  border: none;
  z-index: 9999 !important;
}

.truck-wrapper {
  background: white;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.8rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  border: 3px solid var(--primary);
  animation: truck-float 2s infinite ease-in-out;
}

@keyframes truck-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Mini Track Button */
.btn-track-mini {
  background: var(--white);
  border: 1.5px solid var(--primary);
  color: var(--primary-dark);
  padding: 0.4rem 0.8rem;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.75rem;
  cursor: pointer;
  margin-top: 0.8rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.1);
}

.btn-track-mini:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(16, 185, 129, 0.15);
}

/* --- ANNOUNCEMENT BANNER --- */
.announcement-banner {
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px -10px rgba(245, 158, 11, 0.2);
    z-index: 10;
}

@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- MATERIAL STATS BARS --- */
.adm-mat-stat-item {
    margin-bottom: 1.2rem;
}

.adm-mat-label-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.adm-progress-container {
    height: 10px;
    background: #f1f5f9;
    border-radius: 20px;
    overflow: hidden;
}

.adm-progress-fill {
    height: 100%;
    border-radius: 20px;
    transition: width 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- FOUNDER SECTION POLISH --- */
.about-card {
    display: flex;
    gap: 2rem;
    align-items: center;
    background: var(--white);
    border-radius: 32px;
    padding: 2.5rem;
    box-shadow: var(--card-shadow);
    margin-top: 2rem;
    border: 1px solid var(--border-color);
}

.about-image {
    width: 147px;
    height: 147px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary);
    flex-shrink: 0;
}

.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-text h3 {
    color: var(--primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.about-text p {
    color: var(--text-main);
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    text-align: justify;
}

.programmer-info {
    display: flex;
    gap: 2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.programmer-info strong {
    color: var(--primary);
    margin-left: 0.3rem;
}

@media (max-width: 640px) {
    .about-card { flex-direction: column; text-align: center; }
    .about-image { margin: 0 auto 1.5rem; }
    .programmer-info { justify-content: center; flex-wrap: wrap; }
}



/* --- FINAL RESPONSIVE & THEME POLISH --- */
@media (max-width: 768px) {
    .admin-tabs {
        justify-content: flex-start !important;
        padding: 0.5rem;
        gap: 0.3rem;
    }
    .tab-btn {
        min-width: 100px !important;
        padding: 0.6rem 0.8rem !important;
        font-size: 0.8rem !important;
    }
    .stats-scroll {
        flex-direction: column !important;
        gap: 1.2rem !important;
        padding: 1.5rem !important;
    }
    .stat-item {
        width: 100% !important;
        margin: 0 !important;
        padding: 1.5rem !important;
    }
    .top-bar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1.5rem !important;
    }
    .dash-header {
        border-radius: 0 0 24px 24px !important;
    }
    .hero-title {
        font-size: 2.5rem !important;
    }
    .hero-subtitle {
        font-size: 1rem !important;
        line-height: 1.6;
    }
}

/* Ensure Light Mode is truly bright */
[data-theme="light"] body {
    background-color: #f8fafc;
}

[data-theme="light"] .card {
    background-color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

[data-theme="light"] .dash-header {
    background: #ffffff !important;
    color: #1e293b !important;
    border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .stat-val {
    color: #0f172a !important;
}

[data-theme="light"] .stat-label {
    color: #64748b !important;
}


/* --- ADMIN GRID REFINEMENT --- */
.stats-grid-admin {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .stats-grid-admin {
        grid-template-columns: 1fr !important;
    }
}

/* Theme Toggle Visibility Fix */
#theme-toggle {
    background: rgba(16, 185, 129, 0.1);
    border: 1.5px solid var(--border-color);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-main);
    z-index: 1001;
}

[data-theme="light"] #theme-toggle {
    background: #ffffff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    color: #1e293b;
}

[data-theme="dark"] #theme-toggle {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
}

#theme-toggle:hover {
    transform: translateY(-2px);
    background: var(--primary-light);
    color: var(--primary-dark);
}


/* --- APPROVAL SYSTEM UI --- */
.approval-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.approval-card {
    border-left: 5px solid var(--primary);
    transition: all 0.3s ease;
}

.approval-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px -10px rgba(0,0,0,0.1);
}

[data-theme="dark"] .approval-card {
    background: #1c1917;
    border-color: #f97316;
}

.empty-state {
    background: var(--white);
    border: 2px dashed var(--border-color);
    border-radius: 24px;
    grid-column: 1 / -1;
}


/* --- BRAND LOGO STYLING --- */
.brand-logo {
    object-fit: contain;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: transparent; /* Remove the white background that made it messy */
    padding: 2px;
}

.brand-logo.sm {
    width: 32px;
    height: 32px;
}

.brand-logo.lg {
    width: 140px;
    height: 140px;
    margin-bottom: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2);
    animation: float 4s ease-in-out infinite;
}

#landing-page .hero-logo {
    font-size: 0; /* Reset placeholder font size */
}


/* --- EMPLOYEE & PERMISSIONS STYLES --- */
.permissions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background: #f8fafc;
    padding: 1.2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.perm-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.perm-item:hover {
    background: rgba(0,0,0,0.03);
}

.perm-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.admin-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.admin-user-item:hover {
    background: #fdfdfd;
}

.admin-user-item:last-child {
    border-bottom: none;
}

.emp-badge {
    font-size: 0.7rem;
    background: #e0f2fe;
    color: #0369a1;
    padding: 3px 8px;
    border-radius: 6px;
    margin-right: 8px;
    font-weight: 700;
}

.perm-tag {
    display: inline-block;
    font-size: 0.65rem;
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
    margin-top: 4px;
}
/* --- NAVIGATION & SESSION BUTTONS --- */
#global-nav {
    padding: 0.8rem 5%;
}

#back-nav-btn {
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 700;
}

#back-nav-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(-3px);
}

#logout-nav-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    font-weight: 700;
    border-radius: 12px;
}

#logout-nav-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    transform: scale(1.05);
}

.page-container {
    padding-top: 80px; /* Base padding for global nav */
}

@media (max-width: 768px) {
    .page-container {
        padding-top: 70px;
    }
    #global-nav {
        padding: 0.6rem 1rem;
    }
}

.btn-logout {
    display: none; /* Hide localized logouts as we have the global one now */
}

/* --- SEARCH & FILTER BARS --- */
.search-bar {
    position: relative;
    margin-bottom: 1.5rem;
    width: 100%;
}

.search-bar input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    color: var(--text-main);
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-bar input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 0 0 2px var(--primary);
    border-color: var(--primary);
}

/* Light Mode specific search styling */
[data-theme="light"] .search-bar input {
    background: white;
    border-color: #e2e8f0;
    color: #1e293b;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .search-bar input:focus {
    background: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 0 0 2px var(--primary);
}

/* --- ANALYTICS CARDS (PREMIUM) --- */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.loader-content {
    text-align: center;
    color: white;
}

.spinner-v4 {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

.loader-text {
    font-weight: 800;
    letter-spacing: 1px;
    font-size: 1.1rem;
    opacity: 0.9;
}

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

/* --- RESPONSIVE TABLES & DASHBOARD --- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* Ensure table doesn't compress too much */
}

.dash-content {
    overflow-x: hidden; /* Prevent horizontal scroll on main dash */
}

.card {
    overflow: hidden; /* Ensure card content stays within bounds */
}

/* Scrollable container for tables on small screens */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    display: block;
}

@media (max-width: 480px) {
    .dash-header {
        padding: 1.5rem 1rem;
    }
    
    .stats-grid-admin {
        grid-template-columns: 1fr;
    }

    .admin-table th, .admin-table td {
        padding: 0.8rem 0.5rem;
        font-size: 0.75rem;
    }

    .v4-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 380px) {
    .role-card {
        padding: 1.2rem;
    }
    
    .role-info h3 {
        font-size: 1rem;
    }

    .landing-hero {
        padding: 3rem 1.5rem;
    }
}
/* --- REGISTER PAGE STYLES --- */
#register-page .glass-card {
    padding: 3rem 2rem;
    border-radius: 40px;
    box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.3);
}

#register-page .form-input {
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 20px;
}

#register-page .form-input::placeholder {
    color: rgba(255,255,255,0.4);
}

#register-page .v4-badge {
    background: rgba(255, 255, 255, 0.1);
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    margin-left: auto;
    margin-right: auto;
}

#reg-pending-content h2 {
    color: white;
    margin: 1.5rem 0 1rem;
}

#reg-pending-content p {
    color: rgba(255,255,255,0.7);
    font-size: 1rem;
}

@media (max-width: 480px) {
    #register-page .glass-card {
        padding: 2rem 1.5rem;
    }
}

/* --- FACTORY DASHBOARD ENHANCEMENTS --- */
.pending-alert-banner {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 2px solid #f59e0b;
    border-radius: 20px;
    margin: 1.5rem 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(245, 158, 11, 0.2);
}

.pending-alert-banner .banner-icon {
    font-size: 2.5rem;
    background: #fefce8;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    border: 1px solid #fef08a;
}

.pending-alert-banner h4 {
    color: #92400e;
    margin-bottom: 0.3rem;
    font-weight: 800;
}

.pending-alert-banner p {
    color: #b45309;
    font-size: 0.9rem;
    line-height: 1.6;
}

.factory-tabs {
    display: flex;
    gap: 1rem;
    padding: 0 1rem;
    margin-bottom: 1.5rem;
}

.fac-tab-btn {
    flex: 1;
    background: var(--white);
    border: 1.5px solid var(--border-color);
    padding: 1rem;
    border-radius: 18px;
    font-family: inherit;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.fac-tab-btn.active {
    background: var(--primary-dark);
    color: white;
    border-color: var(--primary-dark);
    box-shadow: 0 10px 20px -5px rgba(234, 88, 12, 0.3);
}

.suppliers-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.supplier-card {
    background: var(--white);
    border-radius: 24px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: all 0.3s;
}

.supplier-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 20px 40px rgba(0,0,0,0.05);
}

.supplier-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.supplier-avatar {
    width: 50px;
    height: 50px;
    background: var(--primary-light);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-dark);
}

.supplier-name {
    font-weight: 800;
    font-size: 1.1rem;
}

.supplier-contact {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
}

.supplier-contact p {
    margin-bottom: 0.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.supplier-card .btn-contact {
    width: 100%;
    padding: 0.8rem;
    background: #f1f5f9;
    color: var(--text-main);
    border-radius: 12px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.supplier-card .btn-contact:hover {
    background: #e2e8f0;
}
