:root {
  --bg-soft: #fdf7f1;
  --bg-card: #ffffff;
  --bg-muted: #f4e9df;
  --bg-highlight: #f8e6d1;
  --primary: #c99759;
  --primary-dark: #a87d3f;
  --text-main: #3e2f23;
  --text-muted: #8a7b6e;
  --success: #4caf50;
  --warning: #f0ad4e;
  --danger: #e57373;
  --border-radius: 28px;
  --shadow-soft: 0 18px 40px rgba(94, 67, 39, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Tajawal', sans-serif;
  background-color: var(--bg-soft);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

p,
span,
label {
  font-size: 0.95rem;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
}

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

.primary-btn,
.secondary-btn,
.ghost-btn {
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.6rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 10px 25px rgba(201, 151, 89, 0.25);
}

.primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(201, 151, 89, 0.35);
}

.secondary-btn {
  background: #fff;
  color: var(--primary-dark);
  border: 1px solid rgba(201, 151, 89, 0.4);
}

.secondary-btn:hover {
  transform: translateY(-1px);
}

.ghost-btn {
  background: transparent;
  color: var(--primary-dark);
  padding: 0.5rem 1rem;
  border-radius: 16px;
}

.ghost-btn.danger {
  color: var(--danger);
}

.text-link {
  color: var(--primary-dark);
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge.neutral {
  background-color: var(--bg-highlight);
  color: var(--primary-dark);
}

.badge.ghost {
  background: rgba(62, 47, 35, 0.08);
  color: var(--text-main);
}

.badge.success {
  background: rgba(76, 175, 80, 0.12);
  color: var(--success);
}

.badge.warning {
  background: rgba(240, 173, 78, 0.18);
  color: var(--warning);
}

.badge.danger {
  background: rgba(229, 115, 115, 0.18);
  color: var(--danger);
}

.muted {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.card {
  background-color: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow-soft);
}

.card-heading {
  margin-bottom: 1.5rem;
}

.card-heading p {
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* Portal */

.portal-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3rem;
}

.portal-hero {
  display: grid;
  gap: 2rem;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: stretch;
}

.hero-copy {
  background: rgba(255, 255, 255, 0.65);
  border-radius: 32px;
  padding: 2.4rem 2.1rem;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 1.2rem;
}

.hero-copy h1 {
  font-size: 2rem;
  margin: 0;
}

.hero-copy p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.8;
}


.hero-forms {
  display: grid;
  gap: 1.6rem;
}

.alert {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.4rem;
  border-radius: 18px;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.05);
}

.alert i {
  font-size: 1.2rem;
}

.alert.success {
  background: rgba(76, 175, 80, 0.1);
  border-color: rgba(76, 175, 80, 0.2);
  color: #2e7d32;
}

.alert.error {
  background: rgba(229, 115, 115, 0.12);
  border-color: rgba(229, 115, 115, 0.25);
  color: #c62828;
}

.mq-highlight {
  margin: 0.35rem 0 0;
  font-weight: 600;
}

.mq-highlight span {
  display: inline-block;
  margin-right: 0.5rem;
  background: var(--bg-highlight);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.8rem;
}

.portal-card {
  background: var(--bg-card);
  border-radius: var(--border-radius);
  padding: 2.25rem;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.portal-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(201, 151, 89, 0.08), transparent);
  pointer-events: none;
}

.portal-card h1,
.portal-card h2 {
  font-size: 1.6rem;
}

.form-grid {
  display: grid;
  gap: 1.1rem;
}

label {
  display: grid;
  gap: 0.45rem;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(62, 47, 35, 0.12);
  background: #fff;
  color: var(--text-main);
  transition: border 0.2s ease;
}

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

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(201, 151, 89, 0.18);
}

.card-footer {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(62, 47, 35, 0.1);
  color: var(--text-muted);
}

.login-card {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}


.form-login {
  display: grid;
  gap: 1rem;
}

.legend-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.legend-list .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  margin-left: 0.5rem;
}

.legend-list .dot.citizen {
  background: rgba(76, 175, 80, 0.6);
}

.legend-list .dot.notary {
  background: rgba(201, 151, 89, 0.8);
}

.legend-list .dot.admin {
  background: rgba(229, 115, 115, 0.7);
}

.features {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.features article {
  background: rgba(255, 255, 255, 0.65);
  border-radius: 22px;
  padding: 1.6rem;
  box-shadow: var(--shadow-soft);
}

.features h3 {
  margin-bottom: 0.7rem;
}

/* Dashboards */

.dashboard-shell {
  max-width: 1250px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 3.5rem;
  display: grid;
  gap: 1.6rem;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
}

.header-caption {
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dashboard-tabs {
  display: flex;
  gap: 0.8rem;
  background: rgba(255, 255, 255, 0.6);
  padding: 0.5rem;
  border-radius: 999px;
  align-self: flex-start;
}

.dashboard-tabs .tab {
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 600;
}

.dashboard-tabs .tab.active {
  background: var(--bg-highlight);
  color: var(--text-main);
  box-shadow: 0 10px 20px rgba(201, 151, 89, 0.2);
}

.booking-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.85fr);
}

.date-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.8rem;
}

.date-chip {
  background: var(--bg-muted);
  border-radius: 20px;
  padding: 0.9rem 1.1rem;
  text-align: center;
  display: grid;
  gap: 0.3rem;
  transition: transform 0.2s ease, background 0.2s ease;
  cursor: pointer;
  border: none;
  color: inherit;
}

.date-chip strong {
  font-size: 1rem;
}

.date-chip.active {
  background: var(--bg-highlight);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}

.date-chip.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.times-wrapper {
  margin-top: 2rem;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 0.8rem;
}

.time-chip {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(62, 47, 35, 0.1);
  border-radius: 16px;
  padding: 0.7rem 0.9rem;
  text-align: center;
  font-weight: 600;
  cursor: pointer;
  color: inherit;
}

.time-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.time-chip.disabled,
.time-chip:disabled,
.date-chip:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.date-chip:focus,
.time-chip:focus {
  outline: none;
}

.details-form {
  display: grid;
  gap: 1.1rem;
}

.helper-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.6rem;
  color: var(--text-muted);
}

.helper-list li::before {
  content: '\2022';
  margin-left: 0.6rem;
  color: var(--primary);
}

.documents-panel {
  margin-top: 1.8rem;
  display: grid;
  gap: 1rem;
}

.documents-panel h3 {
  font-size: 1.1rem;
  margin: 0;
}

.documents-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}

.documents-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(62, 47, 35, 0.08);
}

.documents-list li span i {
  margin-left: 0.5rem;
  color: var(--primary-dark);
}

.document-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.upload-input {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border: 1px dashed rgba(62, 47, 35, 0.2);
  border-radius: 18px;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  cursor: pointer;
}

.upload-input input[type='file'] {
  display: none;
}

.timeline-card {
  padding: 2.2rem;
}

.timeline-grid {
  display: grid;
  gap: 1.1rem;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.timeline-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 20px;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(62, 47, 35, 0.08);
}

.timeline-icon {
  width: 48px;
  height: 48px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: var(--bg-muted);
  color: var(--primary-dark);
  font-size: 1.1rem;
}

.timeline-icon.calendar {
  background: rgba(201, 151, 89, 0.18);
}

.timeline-icon.file {
  background: rgba(62, 47, 35, 0.08);
}

.timeline-icon.check {
  background: rgba(76, 175, 80, 0.18);
  color: var(--success);
}

.timeline-body h3 {
  margin-bottom: 0.25rem;
  font-size: 1.05rem;
}

/* Notary */

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.report-card .upload-input {
  background: rgba(255, 255, 255, 0.85);
}

.report-status-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.9rem;
  margin-top: 1.4rem;
}

.report-status-item {
  background: rgba(255, 255, 255, 0.78);
  border-radius: 18px;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(201, 151, 89, 0.18);
  display: grid;
  gap: 0.3rem;
  text-align: center;
}

.report-status-item strong {
  font-size: 1.4rem;
  color: var(--primary-dark);
}

.report-history-card {
  display: grid;
  gap: 1.1rem;
}

.report-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.report-history-list li {
  background: rgba(255, 255, 255, 0.75);
  border-radius: 20px;
  padding: 1.1rem 1.3rem;
  border: 1px solid rgba(62, 47, 35, 0.08);
  display: grid;
  gap: 0.6rem;
}

.report-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.report-history-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.report-note {
  margin: 0;
  color: var(--text-main);
  font-weight: 500;
  line-height: 1.6;
  white-space: pre-line;
}

.summary-card {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 22px;
  padding: 1.4rem 1.6rem;
  border: 1px solid rgba(62, 47, 35, 0.08);
  box-shadow: var(--shadow-soft);
}

.summary-card.highlight {
  background: var(--bg-highlight);
}

.summary-label {
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.summary-value {
  font-size: 1.7rem;
  font-weight: 700;
}

.contact-card {
  display: grid;
  gap: 1rem;
}

.contact-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.contact-value {
  margin: 0.25rem 0 0;
  font-weight: 700;
}

.notification-list,
.agenda-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.notification-list li,
.agenda-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 20px;
  padding: 1rem 1.2rem;
  border: 1px solid rgba(62, 47, 35, 0.08);
}

.notification-title,
.agenda-client {
  font-weight: 600;
}

.agenda-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.agenda-item-main {
  display: grid;
  gap: 0.25rem;
  min-width: 180px;
}

.agenda-item-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.agenda-item-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-right: auto;
  justify-content: flex-end;
}

.agenda-status-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.agenda-status-form select {
  min-width: 160px;
}

.compact-btn {
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
}

/* Admin */

.overview-grid,
.accounts-sections,
.agenda-sections,
.reports-sections {
  display: grid;
  gap: 1.6rem;
}

.overview-grid {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.accounts-sections {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.accounts-card {
  grid-column: 1 / -1;
}

.agenda-sections,
.reports-sections {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.appointment-highlight {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.appointment-highlight li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(201, 151, 89, 0.1);
  padding: 0.85rem 1.1rem;
  border-radius: 18px;
}

.appointment-highlight .muted {
  margin: 0;
}

.admin-controls {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  flex-wrap: wrap;
}

.notary-reports-card {
  display: grid;
  gap: 1.2rem;
}

.notary-report-meta {
  display: grid;
  gap: 0.3rem;
}

.notary-report-dates {
  display: grid;
  gap: 0.3rem;
}

.notary-reports-table select {
  min-width: 150px;
}

.admin-stats {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.stat-item {
  background: rgba(255, 255, 255, 0.72);
  padding: 1rem 1.4rem;
  border-radius: 18px;
  border: 1px solid rgba(62, 47, 35, 0.08);
  min-width: 160px;
}

.admin-note {
  margin: 0;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 700;
}

.inline-form {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.inline-form label {
  flex: 1 1 220px;
}

.table-wrapper {
  overflow-x: auto;
  margin-top: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  text-align: right;
  padding: 0.9rem 0.8rem;
  border-bottom: 1px solid rgba(62, 47, 35, 0.08);
}

th {
  color: var(--text-muted);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.6);
}

.table-actions {
  display: flex;
  gap: 0.5rem;
}

/* Responsive */

@media (max-width: 960px) {
  .portal-hero {
    grid-template-columns: 1fr;
  }

  .booking-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .dashboard-tabs {
    flex-wrap: wrap;
    justify-content: center;
  }
}

@media (max-width: 720px) {
  .portal-shell {
    padding: 1.8rem 1.2rem 2.5rem;
  }

  .hero-copy {
    padding: 1.8rem 1.4rem;
  }

  .dashboard-shell {
    padding: 1.8rem 1.2rem 2.5rem;
  }

  .timeline-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .agenda-list li {
    flex-direction: column;
    align-items: flex-start;
  }

  .agenda-item-actions {
    justify-content: flex-start;
    width: 100%;
  }
}
