@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700&family=Assistant:wght@400;500;600;700&display=swap');

:root {
  --ink: #211f1c;
  --ink-soft: #55504a;
  --muted: #8c857c;
  --line: #e6e0d6;
  --card: #ffffff;
  --gold: #b6884a;
  --gold-dark: #8f6a38;
  --gold-tint: #f6ecda;
  --green: #2f6e4c;
  --green-tint: #e5f2ea;
  --amber: #92650f;
  --amber-tint: #fbf0dc;
  --red: #a4342a;
  --red-tint: #fbeae8;
  --shadow-sm: 0 1px 2px rgba(33, 31, 28, 0.06);
  --shadow-md: 0 12px 32px -12px rgba(33, 31, 28, 0.18);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Assistant", "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(1100px 480px at 12% -10%, #f3e6cd44, transparent 60%),
    radial-gradient(900px 420px at 110% 10%, #e9ddc844, transparent 55%),
    #fbf8f3;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  color: var(--ink);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 20px 40px;
}

/* brand header */

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  justify-content: center;
  margin-bottom: 36px;
}

.brand-logo {
  height: 58px;
  width: auto;
  flex-shrink: 0;
}

.brand-text {
  text-align: center;
  line-height: 1.25;
}

.brand-name {
  font-family: "Rubik", sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
}

.brand-tagline {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* card */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--gold) 0%, #e3c98c 50%, var(--gold) 100%);
}

h1 {
  font-family: "Rubik", sans-serif;
  font-size: 23px;
  font-weight: 700;
  margin: 0 0 8px;
  color: var(--ink);
}

.subtitle {
  color: var(--ink-soft);
  margin: 0 0 30px;
  font-size: 14.5px;
  line-height: 1.6;
}

label {
  display: block;
  font-size: 13.5px;
  margin-bottom: 7px;
  font-weight: 600;
  color: var(--ink-soft);
}

input[type="email"],
input[type="text"],
input[type="url"],
input[type="date"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  margin-bottom: 20px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}

textarea {
  resize: vertical;
  min-height: 70px;
}

select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2355504a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  padding-left: 36px;
}

input[type="email"]:focus,
input[type="text"]:focus,
input[type="url"]:focus,
input[type="date"]:focus,
select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-tint);
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--gold-tint);
  border: 1px solid #ecdcb8;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 22px;
}

.checkbox-row input[type="checkbox"] {
  width: 19px;
  height: 19px;
  margin-top: 2px;
  accent-color: var(--gold-dark);
  flex-shrink: 0;
  cursor: pointer;
}

.checkbox-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  font-size: 14px;
}

.checkbox-helper {
  font-weight: 400;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* confirmation card */

.confirm-details {
  background: #faf6ee;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 16px;
  margin-bottom: 24px;
}

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

.confirm-row:last-child {
  border-bottom: none;
}

.confirm-label {
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 600;
}

.confirm-value {
  color: var(--ink);
  font-weight: 700;
  font-size: 14.5px;
}

.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pay-btn,
.portal-btn {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.15s ease;
}

.pay-btn {
  background: var(--gold-dark);
  color: #fff;
}

.pay-btn:hover {
  background: var(--gold);
}

.portal-btn {
  background: var(--ink);
  color: #fff;
}

.portal-btn:hover {
  background: #3a3630;
}

button {
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 13px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.05s ease;
  letter-spacing: 0.01em;
}

button:hover {
  background: #3a3630;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  opacity: 0.65;
  cursor: default;
}

.error {
  background: var(--red-tint);
  color: var(--red);
  border: 1px solid #f0d3cf;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13.5px;
  margin-bottom: 18px;
  display: none;
}

.error.show {
  display: block;
}

.footer-note {
  margin-top: 26px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}

.footer-note a {
  color: var(--gold-dark);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.footer-note a:hover {
  border-color: var(--gold-dark);
}

.page-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

/* dashboard */

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.logout-btn {
  width: auto;
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--line);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.logout-btn:hover {
  background: #f5f1e9;
  color: var(--ink);
}

/* table (desktop) */

.table-scroll {
  overflow-x: auto;
  margin: 0 -8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 620px;
}

th, td {
  text-align: right;
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.02em;
}

tbody tr {
  transition: background 0.12s ease;
}

tbody tr:hover {
  background: #faf6ee;
}

tbody tr:last-child td {
  border-bottom: none;
}

td:first-child, th:first-child {
  font-weight: 600;
  color: var(--ink);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-paid {
  background: var(--green-tint);
  color: var(--green);
}

.badge-partial {
  background: var(--amber-tint);
  color: var(--amber);
}

.badge-unpaid {
  background: var(--red-tint);
  color: var(--red);
}

.pay-link {
  display: inline-block;
  color: #fff;
  background: var(--gold-dark);
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  transition: background 0.15s ease;
}

.pay-link:hover {
  background: var(--gold);
}

.deliverable-link {
  display: inline-block;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--green);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.deliverable-link:hover {
  border-color: var(--green);
}

.muted-note {
  display: inline-block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

.bank-details {
  background: #faf6ee;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 16px;
  margin-bottom: 18px;
}

.bank-details-title {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink);
  padding: 13px 0 4px;
}

.bank-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  gap: 12px;
  font-size: 13.5px;
}

.bank-row:last-child {
  border-bottom: none;
  padding-bottom: 13px;
}

.bank-label {
  color: var(--ink-soft);
  font-weight: 600;
}

.bank-value {
  color: var(--ink);
  font-weight: 700;
  direction: ltr;
}

.warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: var(--red-tint);
  color: var(--red);
  border: 1px solid #f0d3cf;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 18px;
  line-height: 1.6;
}

.proof-upload-inline {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 6px;
}

.file-input-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--gold-tint);
  color: var(--gold-dark);
  border: 1px solid #ecdcb8;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.file-input-label:hover {
  background: #f0e2c1;
}

.file-input-label.has-file {
  background: var(--green-tint);
  color: var(--green);
  border-color: #c7e3d3;
}

.note-cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 180px;
}

.note-textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--ink);
  resize: vertical;
  background: #fff;
}

.note-textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-tint);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
  font-size: 14.5px;
}

.empty-state-icon {
  font-size: 30px;
  margin-bottom: 10px;
  opacity: 0.7;
}

/* מצב טעינה - ספינר עדין במקום טקסט "טוען..." יבש */

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 52px 0;
  color: var(--muted);
  font-size: 13.5px;
}

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--gold);
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* פוקוס נגיש - טבעת עדינה בזהב במקום מתאר ברירת המחדל של הדפדפן */

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.notif-bell-btn:focus-visible,
.client-list-item:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* פאנל מקובץ - עוטף כמה שדות קשורים יחד עם רקע עדין, כדי שיהיה ברור מה שייך למה
   (למשל "עדכון ללקוח" או "ניהול" בפאנל הצוות) בלי להוסיף עוד מסגרות כרטיס */

.field-panel {
  background: #faf8f3;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 12px;
}

.field-panel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: none;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}

.field-panel.field-panel-admin {
  background: var(--gold-tint);
  border-color: #ecdcb8;
}

.proof-upload {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  background: var(--gold-tint);
  color: var(--gold-dark);
  border: 1px solid #ecdcb8;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  margin: 0;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.upload-btn:hover {
  background: #f0e2c1;
}

/* hero: near-deadline banner at top of client dashboard */

.hero-deadline {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--gold-tint), #fff);
  border: 1px solid #ecdcb8;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 22px;
}

.hero-deadline-icon {
  font-size: 26px;
  flex-shrink: 0;
}

.hero-deadline-text {
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.55;
}

.hero-deadline-text b {
  font-weight: 700;
}

.hero-deadline-days {
  font-weight: 700;
}

/* order cards: replaces the wide table so nothing ever needs horizontal scrolling */

.order-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.order-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.order-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.order-card.is-urgent {
  border-color: #e7b98a;
  box-shadow: 0 0 0 2px var(--gold-tint) inset;
}

.order-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.order-card-title-wrap {
  min-width: 0;
}

.order-card-title {
  font-family: "Rubik", sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  line-height: 1.35;
}

.order-card-package {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-pill.pill-wait { background: var(--amber-tint); color: var(--amber); }
.status-pill.pill-progress { background: var(--gold-tint); color: var(--gold-dark); }
.status-pill.pill-done { background: var(--green-tint); color: var(--green); }

.order-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  gap: 12px;
  flex-wrap: wrap;
}

.order-card-row:first-of-type {
  border-top: none;
}

.order-card-label {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 600;
  flex-shrink: 0;
}

.order-card-value {
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
  text-align: left;
}

.countdown-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.countdown-urgent { background: var(--red-tint); color: var(--red); }
.countdown-soon { background: var(--amber-tint); color: var(--amber); }
.countdown-ok { background: #f1efe9; color: var(--ink-soft); }
.countdown-done { background: var(--green-tint); color: var(--green); }

/* client revision-request box - shown per order after highlights / gallery are delivered */

.revision-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0 4px;
  border-top: 1px solid var(--line);
}

.revision-label {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 600;
  margin: 0;
}

.revision-textarea {
  margin-bottom: 0;
  font-size: 13px;
  min-height: 56px;
}

.revision-submit-btn {
  align-self: flex-start;
  background: var(--gold-tint);
  color: var(--gold-dark);
  border: 1px solid #ecdcb8;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s ease;
}

.revision-submit-btn:hover {
  background: #f0e2c1;
}

.revision-status {
  margin: 0;
}

/* toolbar: search box + archive toggle, placed at the top so nothing important requires scrolling to find */

.toolbar-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1 1 220px;
  margin-bottom: 0 !important;
}

.archive-toggle-btn {
  flex-shrink: 0;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0 18px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.archive-toggle-btn:hover {
  background: #faf9f6;
}

.archive-inline-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  margin-right: auto;
}

.archive-inline-btn:hover {
  color: var(--ink-soft);
}

/* archive section - completed orders, tucked away behind a toggle so the active list stays short */

.archive-toggle {
  display: block;
  margin-top: 24px;
  padding: 14px 18px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--ink-soft);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  list-style: none;
}

.archive-toggle::-webkit-details-marker {
  display: none;
}

.archive-toggle:hover {
  background: #faf9f6;
}

.archive-section {
  margin-top: 16px;
}

/* mobile: collapse table into stacked cards */

@media (max-width: 640px) {
  /* ב-top-bar אופקי, קבוצת הכפתורים (flex-shrink:0) לא מוכנה לצמצם את עצמה, אז בטלפון היא
     סוחטת את כותרת השלום לעמודה צרה שמתפצלת למילה בכל שורה - סידור אנכי פותר את זה */
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .wrap {
    padding: 32px 14px 30px;
  }

  .card {
    padding: 24px 18px;
    border-radius: 16px;
  }

  .table-scroll {
    margin: 0;
    overflow: visible;
  }

  table, thead, tbody, th, td, tr {
    display: block;
  }

  thead {
    display: none;
  }

  tbody tr {
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 12px;
    padding: 6px 4px;
  }

  tbody tr:hover {
    background: transparent;
  }

  td {
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    text-align: left;
  }

  td:first-child {
    padding-top: 13px;
  }

  td:last-child {
    padding-bottom: 13px;
  }

  td::before {
    content: attr(data-label);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--muted);
    text-align: right;
  }
}

/* --- פעמון התראות --- */

.notif-bell-wrap {
  position: relative;
}

.notif-bell-btn {
  position: relative;
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 10px;
  width: 40px;
  height: 40px;
  font-size: 17px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.notif-bell-btn:hover {
  background: #faf9f6;
}

.notif-badge {
  position: absolute;
  top: -6px;
  left: -6px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
}

.notif-dropdown {
  position: absolute;
  top: 48px;
  right: 0; /* בממשק RTL הפעמון נוטה לשבת קרוב לקצה שמאל של הכותרת - left:0 גרם לתפריט להימתח מעבר לקצה המסך */
  width: 330px;
  max-width: 88vw;
  max-height: 420px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(30, 25, 15, 0.14);
  z-index: 40;
  padding: 8px;
}

.notif-dropdown-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
  padding: 6px 8px 10px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 8px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
}

.notif-item:hover {
  background: #faf9f6;
}

.notif-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--red);
  margin-top: 5px;
  flex-shrink: 0;
}

.notif-item-dot.is-read {
  background: var(--line);
}

.notif-item-text b {
  display: block;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 2px;
}

.notif-item-text span {
  color: var(--muted);
  font-size: 12px;
}

.notif-empty {
  padding: 18px 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
