/* Root Colors and Reset */
:root {
  --primary: #e86830;
  --accent: #ff4500;
  --bg-dark: #0a0a0a;
  --text-light: #ffffff;
  --text-muted: #aaa;
  --glass: rgba(255, 255, 255, 0.05);
  --border-faint: rgba(255, 255, 255, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background-color: var(--bg-dark);
  font-family: 'Segoe UI', sans-serif;
  color: var(--text-light);
  overflow: hidden;
}

/* Splash Screen */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  animation: fadeSplash 2.5s ease forwards;
}

.splash-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.splash-messages span {
  color: var(--text-light);
  font-size: 14px;
  opacity: 0.7;
}

@keyframes fadeSplash {
  0% { opacity: 1; transform: scale(1); }
  90% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.98); pointer-events: none; }
}

.splash-screen .splash-messages {
  margin-top: 16px;
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Admin Layout */
.admin-wrapper {
  display: flex;
  height: 100vh;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.admin-wrapper.show {
  opacity: 1;
}

/* Sidebar */
.sidebar {
  width: 72px;
  background: #111;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: width 0.3s ease;
  overflow: hidden;
}

.sidebar:hover {
  width: 220px;
}

.sidebar-logo {
  text-align: center;
  margin-bottom: 20px;
}
.sidebar-logo img {
  width: 60px;
}
#logo-text {
  display: none;
}
.sidebar:hover #logo-text {
  display: inline-block;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-light);
  padding: 12px;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
}
.nav-item:hover {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: translateX(4px);
}
.nav-item.active {
  background: linear-gradient(90deg, var(--primary), var(--accent));
  font-weight: bold;
}
.nav-text {
  display: none;
}
.sidebar:hover .nav-text {
  display: inline-block;
}
.sidebar-logout {
  padding-top: 12px;
  border-top: 1px solid var(--border-faint);
  margin-top: auto;
  margin-bottom: 80px;
}
.logout {
  background: linear-gradient(to right, #ff4b2b, #ff416c);
  color: white;
  padding: 10px 14px;
  border-radius: 8px;
}

.admin-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  font-size: 12px;
  text-align: center;
  background-color: var(--bg-dark);
  border-top: 1px solid var(--border-faint);
  padding: 6px 12px 10px;
  color: var(--text-muted);
  z-index: 100;
}
.admin-footer img.dz-footer-logo {
  height: 18px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Main Content */
.main-content {
  flex: 1;
  background: #121212;
  overflow-y: auto;
}
.main-content iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: black;
}

/* Bottom Navbar */
.bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #0a0a0a;
    border-top: 1px solid var(--border-faint);
    justify-content: space-around;
    padding: 8px 0;
    z-index: 999;
  }
  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-light);
    text-decoration: none;
    font-size: 12px;
    position: relative;
  }
  .bottom-nav lord-icon {
    width: 24px;
    height: 24px;
  }
  .bottom-nav a.active {
    font-weight: 600;
    color: var(--text-light);
  }

  .bottom-nav a.active::before {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 48px;
    height: 36px;
    background: radial-gradient(circle at center, var(--accent), var(--primary));
    border-radius: 20px;
    z-index: -1;
    box-shadow: 0 0 12px var(--accent), 0 0 6px rgba(255, 100, 0, 0.25);
    transition: all 0.3s ease;
  }

  .bottom-nav a span {
    z-index: 1;
    position: relative;
  }
}

/* Page Section */
.page-section {
  padding: 20px;
  animation: fadeIn 0.6s ease-out forwards;
}
.page-section h2 {
  font-size: 22px;
  margin-bottom: 8px;
  color: var(--primary);
}

/* Dashboard Widgets */
.widget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding-bottom: 3rem;
}

.widget-content {
  background: rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(12px);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s ease;
}

.widget-content:hover {
  transform: translateY(-4px);
}

.meter-block {
  margin: 12px 0;
}

.meter {
  height: 8px;
  background: #1a1a1a;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
  position: relative;
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #ffbf00);
  transition: width 0.4s ease-in-out;
  width: 0%;
}

.meter-count {
  font-size: 12px;
  margin-top: 4px;
  display: inline-block;
  color: var(--text-light);
}

.widget-tile {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 0 20px rgba(255, 102, 0, 0.07);
  transition: transform 0.3s ease;
}
.widget-tile:hover {
  transform: scale(1.02);
}
.widget-tile h3 {
  margin-bottom: 6px;
  color: #fff;
}
.widget-tile p {
  color: #ccc;
  font-size: 14px;
}
.widget-tile a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  font-size: 13px;
}

.widget-tile.injected {
  animation: fadeInUp 0.8s ease;
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Glass tile utility class */
.glass-tile {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 20px;
  backdrop-filter: blur(10px);
  box-shadow: 0 0 24px rgba(255,255,255,0.05);
}
.glass-tile:hover {
  transform: scale(1.03);
  box-shadow: 0 0 24px rgba(255, 115, 0, 0.3);
}

/* Icon animation */
.icon {
  animation: bounceIcon 1.2s ease;
}
@keyframes bounceIcon {
  0% { transform: translateY(-20px); opacity: 0; }
  50% { transform: translateY(10px); opacity: 1; }
  100% { transform: translateY(0); }
}

.login-screen {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-dark);
  flex-direction: column;
  padding: 20px;
}

.login-box {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 30px 20px;
  box-shadow: 0 0 20px rgba(255, 102, 0, 0.08);
  text-align: center;
  max-width: 360px;
  width: 100%;
  transition: all 0.3s ease;
  animation: fadeInUp 0.8s ease;
}

.login-box h2 {
  margin: 20px 0;
  font-size: 20px;
  color: var(--text-light);
}

.login-box input {
  padding: 10px;
  margin-bottom: 12px;
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
}

.login-btn {
  background: linear-gradient(to right, #FF512F, #DD2476);
  color: #fff;
  padding: 10px;
  width: 100%;
  border: none;
  border-radius: 8px;
  margin-top: 10px;
  cursor: pointer;
  font-weight: bold;
  font-size: 15px;
}

.login-logo {
  width: 60px;
  margin-bottom: 0px;
}

.toggle-password {
  position: absolute;
  top: 9px;
  right: 12px;
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.password-wrapper {
  position: relative;
}

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(30px); }
  100% { opacity: 1; transform: translateY(0); }
}

.input-error {
  border: 1px solid #ff4444 !important;
  background-color: rgba(255, 68, 68, 0.1) !important;
}

.error-message {
  margin-top: 12px;
  font-size: 14px;
  color: #ff4444;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-4px); }
  100% { transform: translateX(0); }
}

.upload-stats p {
  font-size: 14px;
  margin: 6px 0;
  color: var(--text-light);
}

.progress-bar {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  overflow: hidden;
  margin: 10px 0;
  height: 8px;
}

.progress-fill {
  height: 8px;
  background: linear-gradient(to right, var(--primary), var(--accent));
  transition: width 0.3s ease;
}

.status-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(to right, #00c853, #009688);
  box-shadow: 0 0 6px rgba(0, 200, 83, 0.4);
  margin-left: 6px;
}
.status-pill.warning {
  background: linear-gradient(to right, #ffab00, #ff6f00);
  box-shadow: 0 0 6px rgba(255, 171, 0, 0.4);
}
.status-pill.error {
  background: linear-gradient(to right, #ff3d00, #d50000);
  box-shadow: 0 0 6px rgba(255, 61, 0, 0.4);
}

.chart-box {
  background: rgba(255,255,255,0.02);
  padding: 20px;
  border-radius: 12px;
  box-shadow: inset 0 0 12px rgba(255,255,255,0.02), 0 0 12px rgba(255,255,255,0.03);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chart-heading {
  font-size: 16px;
  font-weight: bold;
  color: var(--primary);
}
.chart-value {
  font-size: 32px;
  font-weight: 900;
  color: var(--text-light);
}
.chart-subtext {
  font-size: 12px;
  color: var(--text-muted);
}

.widget-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-size: 14px;
  color: var(--text-muted);
  opacity: 0.6;
}

.empty-state {
  padding: 20px;
  text-align: center;
  font-size: 14px;
  color: #888;
}
.empty-state:before {
  content: "📭";
  font-size: 36px;
  display: block;
  margin-bottom: 10px;
}

.grid-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 20px;
}
.tile-card {
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 0 10px rgba(255,255,255,0.05);
  transition: all 0.3s ease;
}
.tile-card:hover {
  transform: translateY(-2px);
}
.tile-card h4 {
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 4px;
}
.tile-card p {
  font-size: 12px;
  color: var(--text-muted);
}
.card-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
}
.card-actions button {
  padding: 6px 10px;
  font-size: 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: var(--accent);
  color: white;
}
.card-actions .danger {
  background: #d50000;
}

.file-tile {
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  box-shadow: 0 0 10px rgba(255,255,255,0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}
.file-tile .file-name {
  color: var(--text-light);
  font-weight: 600;
}
.file-tile .file-actions {
  display: flex;
  gap: 8px;
}
.file-actions button {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  border: none;
  cursor: pointer;
  background: var(--primary);
  color: white;
}

.widget-header {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.widget-icon {
  font-size: 18px;
  margin-right: 6px;
}

.widget-separator {
  border: none;
  height: 1px;
  background: var(--border-faint);
  margin: 6px 0 14px;
}

.widget-row {
  margin-bottom: 16px;
}

.widget-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.widget-metric {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 4px;
}

.meta-info {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 12px;
}

.widget-footer {
  margin-top: 16px;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-top: 30px;
}

.preview-frame {
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 12px;
  background: var(--bg-dark);
  box-shadow: 0 0 10px rgba(255, 140, 0, 0.2);
  transition: transform 0.3s ease;
}
.preview-frame:hover {
  transform: scale(1.02);
}

.preview-device {
  display: block;
  width: 100%;
  border-radius: 12px;
  object-fit: contain;
}

.outlined-tile {
  border: 2px dashed var(--accent);
  background: var(--bg-dark);
  color: var(--text-light);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 0 14px rgba(255, 120, 0, 0.3);
  transition: transform 0.3s ease;
}
.outlined-tile:hover {
  transform: translateY(-4px);
}

.btn-outline-gold {
  background: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-outline-gold:hover {
  background: var(--accent);
  color: #000;
}
