:root {
  --navy: #082465;
  --navy-dark: #05183f;
  --navy-soft: #0a2a6b;
  --yellow: #fec913;
  --white: #ffffff;
  --text: #48494a;
  --text-light: #7a7b7d;
  --gray-bg: #f6f8fd;
  --border: #e8ecf5;
  --sidebar-width: 270px;
  --topbar-height: 68px;
  --footer-height: 48px;
}

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Cairo", sans-serif;
  color: var(--text);
  background: var(--gray-bg);
  direction: rtl;
  min-height: 100vh;
}

a {
  text-decoration: none;
}

/* ======= Overlay ======= */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 24, 63, 0.55);
  z-index: 1040;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

body.sidebar-open .overlay {
  opacity: 1;
  pointer-events: auto;
}

/* ======= Sidebar ======= */
.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--navy-dark) 0%, var(--navy) 100%);
  color: var(--white);
  display: flex;
  flex-direction: column;
  z-index: 1050;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  flex-shrink: 0;
}

.sidebar-logo img {
  width: 100%;
}

.sidebar-brand-text h5 {
  font-weight: 800;
  font-size: 1.15rem;
  margin: 0;
}

.sidebar-brand-text span {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.6);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
}

.sidebar-menu-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.45);
  padding: 12px 12px 8px;
}

.sidebar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-menu li {
  margin-bottom: 4px;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.25s ease;
  position: relative;
}

.sidebar-menu a i {
  width: 20px;
  text-align: center;
  font-size: 0.95rem;
}

.sidebar-menu a:hover {
  background: rgba(254, 201, 19, 0.14);
  color: var(--white);
  transform: translateX(4px);
}

.sidebar-menu a.active {
  background: var(--yellow);
  color: var(--navy);
  font-weight: 700;
  box-shadow: 0 10px 22px -12px rgba(254, 201, 19, 0.8);
}

.sidebar-menu a.active::before {
  content: "";
  position: absolute;
  inset-inline-start: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: var(--yellow);
  border-radius: 4px;
}

.soon-badge {
  margin-inline-start: auto;
  background: rgba(254, 201, 19, 0.18);
  color: var(--yellow);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 50px;
  white-space: nowrap;
}

.sidebar-menu a.active .soon-badge {
  background: var(--navy);
  color: var(--white);
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
}

.sidebar-footer i {
  margin-inline-end: 6px;
}

/* ======= Main ======= */
.main {
  margin-inline-start: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: var(--topbar-height);
  padding-bottom: var(--footer-height);
}

/* ======= Topbar ======= */
.topbar {
  position: fixed;
  top: 0;
  inset-inline-start: var(--sidebar-width);
  inset-inline-end: 0;
  height: var(--topbar-height);
  background: var(--white);
  box-shadow: 0 4px 20px -12px rgba(8, 36, 101, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  z-index: 1030;
}

.topbar-start {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-start h4 {
  color: var(--navy);
  font-weight: 800;
  margin: 0;
  font-size: 1.15rem;
}

.topbar-start span {
  display: block;
  color: var(--text-light);
  font-size: 0.75rem;
}

.sidebar-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--gray-bg);
  color: var(--navy);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sidebar-toggle:hover {
  background: var(--navy);
  color: var(--white);
}

.topbar-end {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* Notifications */
.icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--gray-bg);
  color: var(--navy);
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

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

.notif-badge {
  position: absolute;
  top: -6px;
  inset-inline-end: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 50px;
  background: #ef4444;
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid var(--white);
}

.notif-menu {
  width: 320px;
  padding: 0;
  border: none;
  border-radius: 16px;
  box-shadow: 0 20px 45px -18px rgba(8, 36, 101, 0.4);
  overflow: hidden;
}

.notif-head {
  padding: 14px 18px;
  margin: 0;
  background: var(--navy);
  color: var(--white);
  font-weight: 700;
  font-size: 0.95rem;
}

.notif-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  white-space: normal;
}

.notif-menu .dropdown-item i {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(254, 201, 19, 0.2);
  color: #e0a800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.notif-menu .dropdown-item strong {
  display: block;
  color: var(--navy);
  font-size: 0.85rem;
}

.notif-menu .dropdown-item span {
  color: var(--text-light);
  font-size: 0.72rem;
}

.notif-menu .dropdown-item:hover {
  background: var(--gray-bg);
}

.notif-menu .notif-all {
  justify-content: center;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.8rem;
  border-bottom: none;
}

/* User */
.user-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--navy), var(--navy-soft));
  color: var(--yellow);
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-info strong {
  display: block;
  color: var(--navy);
  font-size: 0.85rem;
  line-height: 1.2;
}

.user-info span {
  color: var(--text-light);
  font-size: 0.7rem;
}

/* Logout */
.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fee2e2;
  color: #dc2626;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: all 0.25s ease;
}

.btn-logout:hover {
  background: #dc2626;
  color: var(--white);
  transform: translateY(-2px);
}

/* ======= Content ======= */
.content {
  flex: 1;
}

.welcome-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(120deg, var(--navy-dark), var(--navy) 60%, var(--navy-soft));
  color: var(--white);
  border-radius: 20px;
  padding: 28px 30px;
  margin-bottom: 26px;
  overflow: hidden;
  position: relative;
}

.welcome-banner::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254, 201, 19, 0.25), transparent 70%);
  top: -90px;
  inset-inline-end: -40px;
}

.welcome-banner h2 {
  font-weight: 800;
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.welcome-banner p {
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  font-size: 0.9rem;
}

.banner-icon {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: rgba(254, 201, 19, 0.18);
  border: 1px solid rgba(254, 201, 19, 0.5);
  color: var(--yellow);
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.section-label {
  color: var(--navy);
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 14px;
}

.action-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  height: 100%;
  color: var(--text);
  transition: all 0.3s ease;
  position: relative;
}

.action-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px -20px rgba(8, 36, 101, 0.35);
  border-color: transparent;
}

.action-icon {
  --accent: #fec913;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 18%, white);
  color: var(--accent);
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.action-card:hover .action-icon {
  background: var(--accent);
  color: var(--white);
  transform: rotateY(180deg);
}

.action-card h5 {
  color: var(--navy);
  font-weight: 700;
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.action-card p {
  color: var(--text-light);
  font-size: 0.78rem;
  margin: 0;
}

.action-arrow {
  margin-inline-start: auto;
  color: var(--text-light);
  font-size: 0.9rem;
  transition: transform 0.3s ease;
}

.action-card:hover .action-arrow {
  transform: translateX(-4px);
  color: var(--navy);
}

.action-card-soon {
  opacity: 0.75;
}

/* ======= Footer ======= */
.layout-footer {
  position: fixed;
  bottom: 0;
  inset-inline-start: var(--sidebar-width);
  inset-inline-end: 0;
  height: var(--footer-height);
  background: var(--navy-dark);
  color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 22px;
  font-size: 0.78rem;
  z-index: 1020;
}

.layout-footer .footer-version {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.layout-footer i {
  color: var(--yellow);
}

/* ======= Responsive ======= */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(100%);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: inline-flex;
  }

  .main {
    margin-inline-start: 0;
  }

  .topbar {
    inset-inline-start: 0;
  }

  .layout-footer {
    inset-inline-start: 0;
  }
}

@media (max-width: 767.98px) {
  .topbar {
    padding: 0 14px;
  }

  .topbar-start span {
    display: none;
  }

  .user-info {
    display: none;
  }

  .btn-logout span {
    display: none;
  }

  .btn-logout {
    width: 42px;
    height: 42px;
    padding: 0;
    justify-content: center;
  }

  .notif-menu {
    width: 280px;
  }

  .welcome-banner {
    padding: 22px;
  }

  .banner-icon {
    display: none;
  }

  .layout-footer {
    justify-content: center;
  }

  .layout-footer .footer-version {
    display: none;
  }
}
