:root {
  --bg: #f0fdfa;
  --panel: #ffffff;
  --ink: #134e4a;
  --muted: #4b6260;
  --line: #b8e7df;
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --accent: #ea580c;
  --danger: #dc2626;
  --ring: rgba(13, 148, 136, .28);
  --shadow: 0 12px 32px rgba(19, 78, 74, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  direction: rtl;
  font-family: "Noto Sans Arabic", Tahoma, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}
a { color: var(--primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #e8fff9, #fff8f2);
}
.login-card, .panel, .card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.login-card { width: min(420px, 100%); padding: 28px; }
.layout { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: #12312f; color: #effafa; padding: 22px; }
.brand { font-size: 22px; font-weight: 700; margin-bottom: 24px; }
.nav a { display: flex; align-items: center; min-height: 44px; color: #d8eeee; padding: 11px 12px; border-radius: 6px; margin-bottom: 6px; transition: background .18s ease, color .18s ease; }
.nav a.active, .nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.content { padding: 24px; max-width: 1500px; width: 100%; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel, .card { padding: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.stat strong { display: block; font-size: 30px; margin-top: 6px; }
h1, h2, h3 { margin: 0 0 14px; }
label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; font-weight: 600; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  background: #fff;
  color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease;
}
select[multiple] {
  min-height: 220px;
  padding: 6px;
}
select[multiple] option {
  padding: 8px;
  border-radius: 4px;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible, .seat:focus-visible, .attendee-item:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
  border-color: var(--primary);
}
textarea { min-height: 86px; resize: vertical; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.btn {
  border: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  min-height: 44px;
  padding: 10px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-weight: 700;
  transition: transform .16s ease, background .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; box-shadow: 0 8px 18px rgba(13, 148, 136, .18); }
.btn.secondary { background: #33514e; }
.btn.light { background: #effbf8; color: var(--primary-dark); border: 1px solid #99f6e4; }
.btn.danger { background: var(--danger); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: right; vertical-align: top; }
tr:hover td { background: #f8fffd; }
th { background: #e6fbf6; color: #234f4b; font-size: 13px; }
.flash { padding: 12px 14px; border-radius: 6px; margin-bottom: 16px; background: #ecfdf3; border: 1px solid #abefc6; }
.flash.error { background: #fef3f2; border-color: #fecdca; color: #912018; }
.muted { color: var(--muted); }
.badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 12px; background: #eef4f3; color: var(--primary-dark); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.workspace > * { min-width: 0; }
.board-wrap { direction: ltr; width: 100%; max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 12px; }
.board {
  position: relative;
  direction: ltr;
  width: 1100px;
  height: 620px;
  background-color: #fbfefd;
  background-image: linear-gradient(#dcefeb 1px, transparent 1px), linear-gradient(90deg, #dcefeb 1px, transparent 1px);
  background-size: 25px 25px;
  border: 1px dashed #74cfc4;
  border-radius: 8px;
}
.seat {
  position: absolute;
  direction: rtl;
  width: 90px;
  min-height: 48px;
  border: 2px solid #6b918c;
  background: #fff;
  border-radius: 8px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 5px;
  touch-action: none;
  cursor: move;
  user-select: none;
  font-size: 11px;
  line-height: 1.35;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.seat:hover { box-shadow: 0 10px 22px rgba(19, 78, 74, .14); z-index: 4; }
.seat.selected, .seat.moving { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(234, 88, 12, .18), 0 12px 24px rgba(19, 78, 74, .16); z-index: 6; }
.seat.anchor { border-color: var(--accent); background: #fff7ed; }
.seat.assigned { border-color: var(--primary); background: #ecfdf3; }
.seat.drop-target { background: #ccfbf1; }
.seat small { color: var(--muted); display: block; }
.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  margin-bottom: 10px;
  background: #f8fffd;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}
.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #b8e7df;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.seat-tools {
  display: grid;
  grid-template-columns: 44px 44px 44px;
  grid-template-areas:
    ". up ."
    "right center left"
    ". down .";
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.seat-tools button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #effbf8;
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
}
.seat-tools button:hover { border-color: var(--primary); background: #ccfbf1; }
.seat-tools button:disabled { opacity: .45; cursor: not-allowed; }
.seat-tools .up { grid-area: up; }
.seat-tools .down { grid-area: down; }
.seat-tools .left { grid-area: left; }
.seat-tools .right { grid-area: right; }
.seat-tools .center { grid-area: center; font-size: 11px; color: var(--muted); text-align: center; }
.attendee-list { max-height: 540px; overflow: auto; display: grid; gap: 8px; padding-left: 2px; }
.attendee-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  min-height: 50px;
  padding: 9px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.attendee-item:hover { border-color: var(--primary); box-shadow: 0 8px 18px rgba(19, 78, 74, .08); }
.attendee-item.selected { background: #ccfbf1; border-color: var(--primary); }
.attendee-item.used { opacity: .55; background: #f4f7f6; }
.attendee-item.dragging { opacity: .92; z-index: 20; box-shadow: 0 18px 34px rgba(19, 78, 74, .2); }
.warning { color: var(--danger); font-size: 12px; margin-top: 4px; }
.print-only { display: none; }

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

@media (max-width: 980px) {
  .layout, .workspace, .grid.two, .grid.three, .stats { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .content { padding: 16px; }
}

@media print {
  .sidebar, .topbar, .actions, .attendees-panel { display: none !important; }
  .layout, .workspace { display: block; }
  .content { padding: 0; }
  .board-wrap { border: 0; overflow: visible; }
  .print-only { display: block; }
}
