/* مُعين v1.2 — التصميم الكامل المتجاوب */

* {
  box-sizing: border-box;
}

:root {
  --bg: #f3f7f6;
  --surface: #ffffff;
  --surface-soft: #edf5f2;
  --text: #14322f;
  --muted: #5f7772;
  --primary: #0f766e;
  --primary-dark: #0a5b55;
  --border: #d7e6e1;
  --green: #168457;
  --blue: #2563a8;
  --orange: #c66b18;
  --purple: #7c3aed;
  --danger: #b42318;
  --shadow: 0 10px 30px rgba(20, 50, 46, 0.07);
  --bottom-nav-height: 78px;
  --radius: 18px;
}

body.dark {
  --bg: #0c1a18;
  --surface: #16302c;
  --surface-soft: #1c3b36;
  --text: #effcf8;
  --muted: #a8c0ba;
  --primary: #3ec4b2;
  --primary-dark: #63d7c7;
  --border: #2b4b46;
  --shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

html {
  min-width: 280px;
  scroll-behavior: smooth;
}

body {
  min-width: 280px;
  min-height: 100vh;
  margin: 0;
  padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 100% 0, rgba(15, 118, 110, 0.08), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: "Noto Kufi Arabic", "Cairo", "Tahoma", "Arial", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  transition: background 180ms ease, color 180ms ease;
}

body.font-large {
  font-size: 17px;
}

body.font-xlarge {
  font-size: 19px;
}

body.menu-open {
  overflow: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.35);
  outline-offset: 2px;
}

::selection {
  background: rgba(15, 118, 110, 0.22);
}

.app-layout {
  display: block;
  min-height: 100vh;
}

.main-content {
  width: 100%;
  min-width: 0;
  margin: 0;
}

.sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  width: min(320px, 88vw);
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-left: 1px solid var(--border);
  background: var(--surface);
  padding: 22px 18px calc(28px + var(--bottom-nav-height));
  box-shadow: -12px 0 35px rgba(0, 0, 0, 0.16);
  visibility: hidden;
  pointer-events: none;
  transform: translateX(110%);
  transition:
    transform 180ms ease-out,
    visibility 180ms ease-out;
}

.sidebar.mobile-open {
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0);
}

.logo-area,
.mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-area {
  margin-bottom: 8px;
}

.logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: 23px;
  font-weight: bold;
}

.logo-area strong,
.mobile-brand strong {
  display: block;
  color: var(--text);
  font-size: 19px;
}

.logo-area span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.sidebar-close {
  margin-right: auto;
}

.sidebar-bottom {
  margin-top: 12px;
}

.secondary-button,
.icon-button,
.header-icon-button {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
}

.secondary-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: var(--muted);
  text-align: right;
}

.version-text {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.top-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  min-height: 76px;
  padding: 16px clamp(16px, 4vw, 60px);
}

.header-spacer {
  flex: 1;
}

.mobile-menu-button,
.mobile-brand,
.header-icon-button,
.user-avatar {
  display: flex;
}

.mobile-menu-button,
.header-icon-button {
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
}

.mobile-menu-button {
  margin-left: 10px;
}

.mobile-brand strong {
  font-size: 18px;
}

.small-logo {
  width: 35px;
  height: 35px;
  flex-basis: 35px;
  border-radius: 10px;
  font-size: 18px;
}

.user-avatar {
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--surface-soft);
  color: var(--primary);
  font-weight: bold;
}

.page-container {
  width: min(100%, 1160px);
  margin: 0 auto;
  padding: 8px clamp(16px, 4vw, 60px) 60px;
}

.page,
.mueen-extra-page {
  display: none;
  animation: pageIn 180ms ease-out;
}

.page.active-page,
.mueen-extra-page.active-page {
  display: block;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

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

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.simple-heading {
  align-items: center;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--primary);
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.3px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 7px;
  font-size: clamp(25px, 4vw, 39px);
  line-height: 1.3;
}

h2 {
  margin-bottom: 9px;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.35;
}

h3 {
  line-height: 1.4;
}

.page-description {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
}

.date-card {
  min-width: 105px;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  text-align: center;
  box-shadow: var(--shadow);
}

.date-card span,
.date-card strong {
  display: block;
}

.date-card span {
  color: var(--muted);
  font-size: 12px;
}

.date-card strong {
  color: var(--primary);
  font-size: 20px;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 11px;
  background: var(--primary);
  color: white;
  padding: 12px 17px;
  font-size: 14px;
  font-weight: bold;
  transition: transform 160ms ease, background 160ms ease;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.primary-button:active,
.quick-action:active,
.tool-card:active,
.mobile-nav-link:active,
.menu-button:active {
  transform: scale(0.98);
}

.add-button {
  white-space: nowrap;
}

.danger-button {
  border-radius: 10px;
  background: var(--danger);
  color: white;
  padding: 10px 14px;
}

.hero-card {
  position: relative;
  display: flex;
  min-height: 250px;
  align-items: center;
  justify-content: space-between;
  overflow: hidden;
  margin-bottom: 38px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 20%, rgba(255, 255, 255, 0.16), transparent 28%),
    linear-gradient(125deg, #0f766e, #155e75);
  color: white;
  padding: clamp(26px, 5vw, 52px);
  box-shadow: 0 14px 32px rgba(15, 118, 110, 0.2);
}

.hero-content {
  position: relative;
  z-index: 1;
}

.status-label {
  display: inline-block;
  margin-bottom: 14px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.17);
  padding: 5px 11px;
  font-size: 12px;
}

.hero-card h2 {
  max-width: 520px;
  font-size: clamp(27px, 5vw, 44px);
}

.hero-card p {
  color: rgba(255, 255, 255, 0.82);
}

.hero-card .primary-button {
  margin-top: 12px;
  background: white;
  color: var(--primary-dark);
}

.hero-card .primary-button:hover {
  background: #e8fffa;
}

.hero-decoration {
  position: absolute;
  left: 9%;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.14);
  font-family: monospace;
  font-size: clamp(90px, 16vw, 190px);
  direction: ltr;
  user-select: none;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 15px;
}

.stats-grid,
.quick-actions,
.tools-grid {
  display: grid;
  gap: 14px;
}

.stats-grid {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 38px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
}

.stat-card span,
.stat-card strong {
  display: block;
}

.stat-card span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-card strong {
  margin-top: 3px;
  font-size: 25px;
}

.stat-icon,
.quick-icon,
.tool-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 13px;
  font-weight: bold;
}

.stat-icon {
  width: 45px;
  height: 45px;
  font-size: 19px;
}

.green {
  background: rgba(22, 132, 87, 0.12);
  color: var(--green);
}

.blue {
  background: rgba(37, 99, 168, 0.12);
  color: var(--blue);
}

.orange {
  background: rgba(198, 107, 24, 0.13);
  color: var(--orange);
}

.purple {
  background: rgba(124, 58, 237, 0.13);
  color: var(--purple);
}

.quick-actions {
  grid-template-columns: repeat(3, 1fr);
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 16px;
  text-align: right;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, border-color 160ms ease;
}

.quick-action:hover,
.tool-card:hover,
.stat-card:hover {
  border-color: var(--primary);
}

.quick-icon {
  width: 40px;
  height: 40px;
}

.quick-action strong,
.quick-action small {
  display: block;
}

.quick-action strong {
  font-size: 13px;
}

.quick-action small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arrow {
  margin-right: auto;
  color: var(--primary);
}

.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding-bottom: 3px;
}

.filter-button {
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--surface);
  color: var(--muted);
  padding: 8px 17px;
  white-space: nowrap;
}

.filter-button.active {
  background: var(--primary);
  color: white;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 550px;
  margin-bottom: 22px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  padding: 12px 15px;
}

.search-box span {
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-box input::placeholder {
  color: var(--muted);
}

.empty-state {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: 20px;
  background: var(--surface);
  padding: 30px 20px;
  text-align: center;
}

.empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  border-radius: 20px;
  background: rgba(22, 132, 87, 0.12);
  color: var(--green);
  font-size: 27px;
  font-weight: bold;
}

.code-empty {
  background: rgba(37, 99, 168, 0.12);
  color: var(--blue);
}

.note-empty {
  background: rgba(198, 107, 24, 0.13);
  color: var(--orange);
}

.empty-state h2 {
  margin-bottom: 7px;
  font-size: 20px;
}

.empty-state p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

.tools-grid {
  grid-template-columns: repeat(2, 1fr);
}

.tool-card {
  position: relative;
  min-height: 185px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 22px;
  text-align: right;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, border-color 160ms ease;
}

.tool-icon {
  width: 45px;
  height: 45px;
  margin-bottom: 18px;
  font-family: monospace;
  font-size: 17px;
}

.tool-card strong,
.tool-card p {
  display: block;
}

.tool-card strong {
  margin-bottom: 5px;
  font-size: 17px;
}

.tool-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.tool-arrow {
  position: absolute;
  left: 20px;
  bottom: 22px;
  color: var(--primary);
  font-size: 19px;
}

.mobile-bottom-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 80;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  min-height: var(--bottom-nav-height);
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  padding: 9px max(10px, env(safe-area-inset-left)) calc(9px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right));
  box-shadow: 0 -8px 25px rgba(22, 54, 50, 0.06);
  backdrop-filter: blur(12px);
}

.mobile-nav-link {
  display: flex;
  min-width: 82px;
  max-width: 170px;
  flex: 1 1 120px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  padding: 5px 10px;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.mobile-nav-link span {
  font-size: 18px;
  line-height: 1.2;
}

.mobile-nav-link small {
  font-size: 11px;
  white-space: nowrap;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background: var(--surface-soft);
  color: var(--primary);
}

.mueen-extra-page.active-page {
  display: block;
}

.extra-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feature-card,
.project-card,
.template-card,
.extra-tool-card,
.achievement-card,
.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.mueen-list {
  display: grid;
  gap: 12px;
  width: 100%;
  min-width: 0;
}

.mueen-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  padding: 16px;
  box-shadow: var(--shadow);
}

.item-main {
  min-width: 0;
  flex: 1;
}

.item-main h3 {
  margin: 0 0 4px;
}

.item-main p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.item-actions button,
.small-action {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 6px 9px;
  font-size: 12px;
}

.item-actions button:hover,
.small-action:hover {
  color: var(--primary);
}

.check-button {
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border: 2px solid var(--primary);
  border-radius: 7px;
  background: transparent;
  color: var(--primary);
  font-weight: bold;
}

.is-done .item-main h3 {
  color: var(--muted);
  text-decoration: line-through;
}

.priority,
.language-badge,
.project-status {
  border-radius: 20px;
  padding: 4px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.priority.high {
  background: #fee4e2;
  color: #b42318;
}

.priority.medium {
  background: #fff1d6;
  color: #9a5b00;
}

.priority.low {
  background: #dcfae6;
  color: #16794a;
}

body.dark .priority.high {
  background: rgba(180, 35, 24, 0.22);
  color: #fecaca;
}

body.dark .priority.medium {
  background: rgba(154, 91, 0, 0.28);
  color: #ffe8b3;
}

body.dark .priority.low {
  background: rgba(22, 121, 74, 0.24);
  color: #bbf7d0;
}

.language-badge,
.project-status {
  background: var(--surface-soft);
  color: var(--primary);
}

.snippet-item,
.note-item,
.project-item {
  display: block;
}

.item-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mueen-item pre {
  overflow: auto;
  margin: 12px 0 0;
  border-radius: 10px;
  background: #10201e;
  color: #d1fae5;
  padding: 13px;
  font-size: 12px;
  text-align: left;
}

.note-preview {
  margin-top: 10px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.template-grid,
.extra-tools-grid,
.project-grid,
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.template-card,
.extra-tool-card,
.project-card,
.achievement-card {
  padding: 18px;
}

.template-card h3,
.extra-tool-card h3,
.project-card h3 {
  margin: 0 0 5px;
}

.template-card p,
.extra-tool-card p,
.project-card p,
.achievement-card p {
  color: var(--muted);
  font-size: 13px;
}

.template-card button {
  margin-top: 10px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--surface-soft);
}

.progress-value {
  height: 100%;
  border-radius: 8px;
  background: var(--primary);
}

.stat-large {
  color: var(--primary);
  font-size: 32px;
  font-weight: bold;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.setting-row select {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  padding: 8px;
}

.extra-menu {
  display: grid;
  gap: 6px;
  margin: 26px 0 16px;
}

.menu-title {
  margin: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: bold;
}

.menu-button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  padding: 9px 8px;
  text-align: right;
}

.menu-button:hover {
  background: var(--surface-soft);
}

.menu-button strong,
.menu-button small {
  display: block;
}

.menu-button strong {
  font-size: 12px;
}

.menu-button small {
  color: var(--muted);
  font-size: 10px;
}

.menu-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--primary);
  font-weight: bold;
}

.timer-card {
  max-width: 560px;
  margin: auto;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  padding: 30px;
  text-align: center;
  box-shadow: var(--shadow);
}

.timer-mode {
  color: var(--primary);
  font-weight: bold;
}

.timer-display {
  direction: ltr;
  margin: 25px 0;
  font: 700 clamp(50px, 13vw, 90px)/1 monospace;
}

.timer-actions,
.timer-settings {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.timer-settings {
  margin-top: 20px;
}

.timer-settings button {
  border: 1px solid var(--border);
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  padding: 8px 12px;
}

.mueen-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 25, 22, 0.52);
  padding: 16px;
}

.mueen-modal {
  width: min(100%, 620px);
  max-height: 90vh;
  overflow: auto;
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.mueen-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
}

.mueen-modal-header h2 {
  margin: 0;
  font-size: 20px;
}

.mueen-close {
  background: transparent;
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
}

.mueen-modal-body {
  padding: 20px 22px;
}

.mueen-modal form {
  display: grid;
  gap: 14px;
}

.mueen-modal label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: bold;
}

.mueen-modal input,
.mueen-modal textarea,
.mueen-modal select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: 0;
  background: var(--bg);
  color: var(--text);
  padding: 11px;
}

.mueen-modal textarea {
  resize: vertical;
}

.mueen-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.color-result {
  display: grid;
  gap: 8px;
}

.color-result p {
  margin: 0;
  font-family: monospace;
  direction: ltr;
}

.snippet-item {
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.snippet-item .item-main {
  width: 100%;
  min-width: 0;
}

.snippet-item .item-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.snippet-item .item-title-row h3 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.snippet-item pre {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
  white-space: pre;
  word-break: normal;
}

.snippet-item .item-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  width: 100%;
  margin-top: 13px;
  padding: 0;
}

.snippet-item .item-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 7px 12px;
  font-size: 12px;
  white-space: nowrap;
}

.snippet-item .item-actions button:first-child {
  background: var(--primary);
  color: white;
}

.snippet-item .item-actions button:hover {
  border-color: var(--primary);
}

.mueen-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  background: rgba(0, 0, 0, 0.28);
}

.mueen-menu-overlay.active {
  display: block;
}

@media (min-width: 681px) and (max-width: 1000px) {
  .page-container {
    padding-right: 28px;
    padding-left: 28px;
  }

  .stats-grid,
  .quick-actions {
    grid-template-columns: repeat(3, 1fr);
  }

  .mobile-nav-link {
    max-width: 150px;
  }
}

@media (max-width: 680px) {
  :root {
    --bottom-nav-height: 76px;
  }

  .top-header {
    min-height: 65px;
    padding: 12px 16px;
  }

  .page-container {
    padding: 10px 16px 36px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 22px;
  }

  .simple-heading {
    flex-direction: row;
    align-items: center;
  }

  .simple-heading .add-button {
    padding: 10px 12px;
    font-size: 12px;
  }

  .date-card {
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .hero-card {
    min-height: 270px;
    padding: 25px 21px;
  }

  .hero-decoration {
    left: -4%;
    bottom: 4%;
    font-size: 100px;
  }

  .stats-grid,
  .quick-actions,
  .tools-grid {
    grid-template-columns: 1fr;
  }

  .stat-card,
  .quick-action {
    padding: 14px;
  }

  .tool-card {
    min-height: 155px;
  }

  .mobile-bottom-nav {
    gap: 2px;
    padding-right: 4px;
    padding-left: 4px;
  }

  .mobile-nav-link {
    min-width: 48px;
    flex-basis: 70px;
    padding-right: 4px;
    padding-left: 4px;
  }

  .mobile-nav-link span {
    font-size: 17px;
  }

  .mobile-nav-link small {
    font-size: 10px;
  }

  .mueen-item {
    flex-wrap: wrap;
  }

  .item-main {
    flex-basis: calc(100% - 42px);
  }

  .item-actions {
    width: 100%;
    padding-right: 37px;
  }

  .template-grid,
  .extra-tools-grid,
  .project-grid,
  .achievement-grid {
    grid-template-columns: 1fr;
  }

  .setting-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .setting-row button,
  .setting-row select {
    align-self: stretch;
  }

  .snippet-item {
    padding: 14px;
  }

  .snippet-item .item-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .snippet-item .language-badge {
    align-self: flex-start;
  }

  .snippet-item .item-actions {
    flex-wrap: wrap;
    padding: 0;
  }

  .snippet-item .item-actions button {
    flex: 1 1 auto;
  }
}

@media (max-width: 380px) {
  .simple-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .simple-heading .add-button {
    width: 100%;
  }

  .hero-card {
    min-height: 300px;
  }

  .mobile-nav-link small {
    font-size: 9px;
  }

  .mobile-nav-link {
    min-width: 43px;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  :root {
    --bottom-nav-height: 62px;
  }

  body {
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom));
  }

  .top-header {
    min-height: 58px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .page-container {
    padding-bottom: 24px;
  }

  .hero-card {
    min-height: 220px;
  }

  .mobile-bottom-nav {
    min-height: var(--bottom-nav-height);
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .mobile-nav-link {
    flex-direction: row;
    gap: 5px;
  }

  .mobile-nav-link span {
    font-size: 15px;
  }
}

@media (min-width: 681px) {
  .sidebar {
    width: min(350px, 90vw);
  }
}

@media (min-width: 1300px) {
  .page-container {
    padding-right: 80px;
    padding-left: 80px;
  }

  .mobile-bottom-nav {
    padding-right: 15%;
    padding-left: 15%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== إضافات v1.3 ===== */

.stats-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.cover-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, .8fr);
  gap: 0;
  overflow: hidden;
  margin-bottom: 28px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.cover-card img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: cover;
  background: #eef7f4;
}

.cover-caption {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 28px;
}

.cover-caption strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.cover-caption p {
  margin: 0;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.today-board {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 14px;
  margin-bottom: 36px;
}

.today-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow);
}

.today-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.today-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.today-item:last-child {
  border-bottom: 0;
}

.today-item button {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  padding: 6px 9px;
  font-size: 12px;
}

.command-palette {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  background: rgba(5, 25, 22, 0.45);
}

.command-palette:not([hidden]) {
  display: flex;
}

.command-box {
  width: min(100%, 640px);
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.command-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  padding: 18px 18px 12px;
}

.command-results {
  max-height: 360px;
  overflow: auto;
  border-top: 1px solid var(--border);
}

.command-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  background: transparent;
  color: var(--text);
  padding: 12px 16px;
  text-align: right;
}

.command-item:hover,
.command-item.active {
  background: var(--surface-soft);
}

.command-item small {
  color: var(--muted);
}

.status-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #12312e;
  color: #fff;
  padding: 10px 16px;
  font-size: 13px;
}

.status-banner:not([hidden]) {
  display: flex;
}

.status-banner button {
  background: transparent;
  color: #fff;
}

body.zen-mode .mobile-bottom-nav,
body.zen-mode .top-header,
body.zen-mode .sidebar {
  display: none !important;
}

body.zen-mode {
  padding-bottom: 16px;
}

.diff-view {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  text-align: right;
}

.diff-line {
  border-radius: 8px;
  padding: 6px 8px;
  font-family: monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.diff-same { background: var(--surface-soft); color: var(--muted); }
.diff-add { background: #dcfae6; color: #16794a; }
.diff-del { background: #fee4e2; color: #b42318; }

body.dark .diff-add { background: rgba(22, 121, 74, 0.22); color: #bbf7d0; }
body.dark .diff-del { background: rgba(180, 35, 24, 0.22); color: #fecaca; }

.fav-on { color: #b7791f !important; }

.project-detail {
  display: grid;
  gap: 12px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shortcut-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 900px) {
  .cover-card,
  .today-board,
  .stats-grid-4 {
    grid-template-columns: 1fr;
  }

  .cover-card img {
    max-height: 220px;
  }
}

.account-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 12px;
  margin: 6px 8px 10px;
}

.account-card strong { display: block; margin-bottom: 4px; }
.account-card p { margin: 0 0 6px; color: var(--muted); font-size: 12px; }
.account-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.account-photo { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.client-id-label { display: grid; gap: 6px; margin: 8px 0; color: var(--muted); font-size: 12px; font-weight: bold; }
.client-id-label input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 10px;
}

.convert-studio { display: grid; gap: 14px; }
.convert-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.convert-studio textarea {
  width: 100%;
  min-height: 280px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #10201e;
  color: #d1fae5;
  padding: 12px;
  font: 13px/1.6 monospace;
}
@media (max-width: 800px) {
  .convert-grid { grid-template-columns: 1fr; }
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  text-align: right;
  cursor: pointer;
}
.guide-card h3 { margin: 6px 0 4px; font-size: 16px; }
.guide-card p { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.guide-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--primary);
  font-weight: 700;
}
.guide-tour {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 84px;
  z-index: 850;
  pointer-events: none;
}
.guide-tour-card {
  pointer-events: auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0,0,0,.18);
  padding: 14px;
}
.guide-welcome {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 84px;
  z-index: 840;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0,0,0,.14);
  padding: 12px;
}
.guide-welcome p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
@media (max-width: 680px) {
  .guide-grid { grid-template-columns: 1fr; }
  .guide-welcome { flex-direction: column; align-items: stretch; }
}
