/* ZAHROVA Atelier Design System — Verified Tokens & Direction 3 Grounding */
:root {
  /* Brand Palette */
  --zh-forest: #1A382B;
  --zh-forest-dark: #12271E;
  --zh-forest-light: #244C3B;
  --zh-forest-surface: #2E5644;
  --zh-cream: #FAF7F2;
  --zh-cream-muted: #F4EFE6;
  --zh-cream-border: #E8E2D5;
  --zh-card-bg: #FFFFFF;
  --zh-blush: #FCEEEB;
  --zh-blush-dark: #F7D6D0;
  --zh-blush-text: #C45E50;
  --zh-gold: #C5A059;
  --zh-chartreuse: #D8E949;

  /* Neutrals & Text */
  --zh-text-main: #182820;
  --zh-text-secondary: #5A6961;
  --zh-text-muted: #87968E;
  --zh-text-inverse: #FFFFFF;

  /* Semantic Status Tokens */
  --zh-badge-success-bg: #EAF6EE;
  --zh-badge-success-text: #1B6A3B;
  --zh-badge-success-border: #C6E7D0;

  --zh-badge-warning-bg: #FEF4E8;
  --zh-badge-warning-text: #B56108;
  --zh-badge-warning-border: #FED7AA;

  --zh-badge-danger-bg: #FDECEB;
  --zh-badge-danger-text: #C9352B;
  --zh-badge-danger-border: #FBC4C0;

  --zh-badge-info-bg: #F0EEFA;
  --zh-badge-info-text: #53389E;
  --zh-badge-info-border: #DDD8F7;

  /* Elevation */
  --zh-shadow-sm: 0 1px 2px rgba(24, 40, 32, 0.05);
  --zh-shadow-md: 0 4px 12px rgba(24, 40, 32, 0.07);
  --zh-shadow-lg: 0 10px 25px rgba(24, 40, 32, 0.1);
  --zh-shadow-drawer: -4px 0 24px rgba(24, 40, 32, 0.12);

  /* Radii */
  --zh-radius-sm: 6px;
  --zh-radius-md: 10px;
  --zh-radius-lg: 14px;
  --zh-radius-xl: 20px;
  --zh-radius-full: 9999px;

  /* Layout */
  --zh-sidebar-w: 260px;
  --zh-header-h: 70px;
}

@font-face {
  font-family: 'Noto Sans';
  src: url('/fonts/NotoSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Sans';
  src: url('/fonts/NotoSans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Sans Arabic';
  src: url('/fonts/NotoSansArabic-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Sans Arabic';
  src: url('/fonts/NotoSansArabic-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

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

body {
  font-family: 'Noto Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--zh-cream);
  color: var(--zh-text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

[dir="rtl"] body {
  font-family: 'Noto Sans Arabic', 'Noto Sans', system-ui, sans-serif;
}

/* Serif headings */
.font-serif {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

[dir="rtl"] .font-serif {
  font-family: 'Noto Sans Arabic', serif;
}

/* Logical layout utilities */
.app-container {
  display: flex;
  min-height: 100vh;
  background-color: var(--zh-cream);
}

.app-sidebar {
  width: var(--zh-sidebar-w);
  background-color: var(--zh-forest);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: width 0.2s ease;
  z-index: 40;
}

.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-x: hidden;
}

.app-header {
  height: var(--zh-header-h);
  background-color: #FFFFFF;
  border-bottom: 1px solid var(--zh-cream-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: 28px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.app-content {
  padding: 28px;
  flex: 1;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .app-sidebar {
    width: 72px;
  }
  .sidebar-text {
    display: none;
  }
  .app-header {
    padding-inline: 16px;
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
    min-width: 0;
    width: 100%;
  }
  .app-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  .sidebar-text {
    display: inline;
  }
  #nav-container {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    padding: 8px 12px !important;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .nav-item {
    margin: 0 !important;
    padding: 8px 12px !important;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .app-header {
    height: auto;
    min-height: var(--zh-header-h);
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .app-header > div:first-child {
    flex: 1 1 100%;
  }
  .app-header > div:nth-child(2) {
    flex: 1 1 100%;
    width: 100% !important;
    max-width: 100% !important;
  }
  .app-header > div:last-child {
    flex: 1 1 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .app-content {
    padding: 16px 12px;
  }
}

@media (max-width: 480px) {
  #user-profile-badge {
    padding: 2px 6px;
    gap: 6px;
  }
  #user-role-display {
    display: none;
  }
  #btn-logout {
    padding: 3px 6px;
    font-size: 10px;
  }
}
