/* ============================================================
   TAIF Marketing Agency — Design System
   style.css v1.0
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --primary:    #2547D0;
  --secondary:  #7B2FBE;
  --gradient:   linear-gradient(135deg, #2547D0, #7B2FBE);
  --border:     #e5e7eb;
  --radius:     12px;
  --radius-sm:  8px;
  --surface:    #ffffff;
  --surface-2:  #f9fafb;
  --text:       #1a1a2e;
  --text-muted: #6b7280;
  --shadow:     0 2px 8px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 20px rgba(0,0,0,0.12);
  --dark-nav:   #1a1a2e;
  --success:    #10b981;
  --danger:     #ef4444;
  --warning:    #f59e0b;
  --nav-h:      64px;
}

/* ── Reset & Base ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', sans-serif;
  background: var(--surface-2);
  color: var(--text);
  min-height: 100vh;
  padding-top: var(--nav-h);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* ── Top Navigation ────────────────────────────────────────── */
.top-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 24px;
  gap: 16px;
  max-width: 1600px;
  margin: 0 auto;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-img { width: 36px; height: 36px; }

.nav-logo-text {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}

/* Nav Links */
.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 4px;
  flex: 1;
  padding: 0 16px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 99px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
}

.nav-link svg { width: 15px; height: 15px; flex-shrink: 0; }

.nav-link:hover {
  color: var(--primary);
  background: rgba(37,71,208,0.06);
  text-decoration: none;
}

.nav-link.active {
  background: rgba(37,71,208,0.1);
  color: var(--primary);
}

/* Dropdown */
.nav-dropdown { position: relative; }

.nav-dropdown-btn .chevron {
  width: 12px; height: 12px;
  transition: transform 0.2s;
}

.nav-dropdown:hover .chevron { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  min-width: 220px;
  display: none;
  flex-direction: column;
  padding: 6px;
  z-index: 100;
}

[dir="rtl"] .dropdown-menu { left: auto; right: 0; }

.nav-dropdown:hover .dropdown-menu { display: flex; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background: var(--surface-2);
  text-decoration: none;
}

/* Right side of nav */
.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* Language Toggle */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
}

.lang-btn {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.2s;
  font-family: 'Cairo', sans-serif;
  padding: 4px 8px;
  border-radius: 6px;
}

.lang-btn:hover, .lang-btn.lang-active { 
  color: var(--primary); 
  background: rgba(37,71,208,0.06);
  text-decoration: none; 
}

.lang-sep { color: var(--border); }

/* User Info */
.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(37,71,208,0.1);
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
}

.user-role {
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: capitalize;
}

.logout-btn {
  padding: 8px;
  color: var(--text-muted);
  border-radius: 50%;
  display: flex;
  transition: all 0.2s;
  background: var(--surface-2);
}

.logout-btn svg { width: 16px; height: 16px; }
.logout-btn:hover { color: var(--danger); background: rgba(239,68,68,0.1); }

/* ── Page Layout ────────────────────────────────────────── */
.page-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px;
}

.page-wrapper-wide {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 20px;
}

/* Page Header Block */
.page-header {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 32px;
  margin-bottom: 30px;
  color: var(--text);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.page-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.breadcrumb {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { opacity: 0.4; margin: 0 8px; }

.page-title {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 0;
  color: var(--text);
}

.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.page-header-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  align-items: center;
}

/* ── Cards ────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.card-body { padding: 24px; }

/* ── Stats Cards ────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
}

.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg { width: 22px; height: 22px; }

.stat-icon.blue   { background: rgba(37,71,208,0.12); color: var(--primary); }
.stat-icon.purple { background: rgba(123,47,190,0.12); color: var(--secondary); }
.stat-icon.green  { background: rgba(16,185,129,0.12); color: var(--success); }
.stat-icon.orange { background: rgba(245,158,11,0.12); color: var(--warning); }
.stat-icon.red    { background: rgba(239,68,68,0.12); color: var(--danger); }

.stat-info {}
.stat-value { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ── Buttons ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 99px; /* Fully rounded modern buttons */
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37,71,208,0.25);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37,71,208,0.4);
  color: #fff;
  text-decoration: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-muted);
  border: 1px solid #d1d5db;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(37,71,208,0.02);
  text-decoration: none;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  box-shadow: 0 4px 14px rgba(239,68,68,0.25);
}

.btn-danger:hover {
  background: #dc2626;
  text-decoration: none;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239,68,68,0.4);
}

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16,185,129,0.25);
}

.btn-sm { padding: 6px 16px; font-size: 0.8rem; }

/* ── Form Inputs ────────────────────────────────────────── */
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Cairo', sans-serif;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  display: block;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,71,208,0.12);
}

textarea.form-input {
  resize: vertical;
  min-height: 90px;
}

select.form-input { cursor: pointer; }

.form-input[readonly] {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: default;
}

/* ── Brief Table (Main Form/Report Table) ────────────────── */
.brief-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
}

.brief-table thead tr {
  background: var(--gradient);
  color: #fff;
}

.brief-table thead th {
  padding: 12px 18px;
  font-size: 0.875rem;
  font-weight: 700;
  text-align: left;
}

[dir="rtl"] .brief-table thead th { text-align: right; }

.brief-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.brief-table tbody tr:nth-child(even) { background: var(--surface-2); }
.brief-table tbody tr:hover { background: rgba(37,71,208,0.04); }
.brief-table tbody tr:last-child { border-bottom: none; }

.brief-table td {
  padding: 13px 18px;
  vertical-align: top;
  font-size: 0.875rem;
}

.field-label {
  width: 30%;
  font-weight: 600;
  color: var(--text);
  font-size: 0.85rem;
}

.field-label small {
  display: block;
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.75rem;
  margin-top: 2px;
}

.field-value { width: 70%; color: var(--text); }

/* ── Checkbox / Radio Pills ────────────────────────────── */
.checkbox-group {
  margin: 4px 0;
}

.checkbox-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cb-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.2s ease;
  user-select: none;
}

.cb-label:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cb-label input[type="checkbox"] { display: none; }

.cb-label input[type="radio"] { display: none; }

.cb-label:has(input:checked) {
  border-color: var(--primary);
  background: rgba(37,71,208,0.08);
  color: var(--primary);
}

.cb-box {
  width: 14px; height: 14px;
  border-radius: 3px;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.cb-box.radio { border-radius: 50%; }

.cb-label:has(input:checked) .cb-box {
  background: var(--primary);
  border-color: var(--primary);
}

.cb-label:has(input:checked) .cb-box::after {
  content: '';
  width: 6px; height: 6px;
  background: #fff;
  border-radius: 1px;
}

.cb-label:has(input[type="radio"]:checked) .cb-box::after {
  border-radius: 50%;
}

/* ── Brand Info Box ────────────────────────────────────── */
.brand-info-box {
  background: linear-gradient(135deg, rgba(37,71,208,0.05), rgba(123,47,190,0.05));
  border: 1.5px solid rgba(37,71,208,0.2);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
}

.brand-info-box.hidden { display: none; }

.brand-info-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.brand-field {}
.brand-field-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.brand-field-value {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
}

/* ── Section Heading ────────────────────────────────────── */
.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin: 24px 0 14px;
}

.section-heading::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: var(--border);
}

.section-heading-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-heading-icon svg { width: 15px; height: 15px; color: #fff; }

/* ── Alert / Success Banner ────────────────────────────── */
.alert {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; }

.alert-success {
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.3);
  color: #065f46;
}

.alert-danger {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #991b1b;
}

.alert-warning {
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.3);
  color: #92400e;
}

/* ── Attachments Section ────────────────────────────────── */
.attachments-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.attachment-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.attachment-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 8px;
}

.attachment-fields {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ── Status Badges ────────────────────────────────────── */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status-pending   { background: rgba(245,158,11,0.12); color: #b45309; }
.status-progress  { background: rgba(37,71,208,0.12);  color: var(--primary); }
.status-review    { background: rgba(123,47,190,0.12); color: var(--secondary); }
.status-approval  { background: rgba(16,185,129,0.12); color: #065f46; }
.status-completed { background: rgba(16,185,129,0.2);  color: #065f46; }
.status-cancelled { background: rgba(239,68,68,0.12);  color: #991b1b; }

/* ── Data Table (Lists) ────────────────────────────────── */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

[dir="rtl"] .data-table thead th { text-align: right; }

.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.data-table tbody tr:hover { background: var(--surface-2); }
.data-table tbody tr:last-child { border-bottom: none; }

.data-table tbody td {
  padding: 12px 16px;
  font-size: 0.875rem;
  color: var(--text);
  vertical-align: middle;
}

.td-muted { color: var(--text-muted); font-size: 0.8rem; }

/* ── Pill Tags (in reports and tables) ────────────────── */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(37,71,208,0.1);
  color: var(--primary);
  margin: 2px;
}

.tag-green  { background: rgba(5,150,105,0.1); color: #059669; }
.tag-blue   { background: rgba(37,99,235,0.1); color: #2563eb; }
.tag-purple { background: rgba(123,47,190,0.1); color: var(--secondary); }
.tag-orange { background: rgba(245,158,11,0.1); color: #b45309; }
.tag-red    { background: rgba(239,68,68,0.1); color: var(--danger); }

/* ── Kanban Board ────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(6, 280px);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
}

.kanban-col {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  min-height: 200px;
}

.kanban-col-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-col-title {
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}

.kanban-count {
  background: var(--surface-2);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
}

.kanban-col-body { padding: 10px; }

.kanban-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: block;
  color: var(--text);
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  text-decoration: none;
  color: var(--text);
  transform: translateY(-1px);
}

.kanban-card-id {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.kanban-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.kanban-card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Site Footer ─────────────────────────────────────── */
.site-footer {
  margin-top: 60px;
  border-top: 1px solid var(--border);
  padding: 20px;
}

.footer-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-sep { opacity: 0.4; }

/* ── Login Page ────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  padding-top: 0;
  background: var(--dark-nav);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 420px;
  background: var(--surface);
  border-radius: 20px;
  padding: 44px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 32px;
}

.login-logo-img { width: 48px; height: 48px; }

.login-logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-title {
  font-size: 1.4rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
}

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

/* ── Pagination ────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}

.page-link {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
}

.page-link:hover, .page-link.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  text-decoration: none;
}

/* ── Search & Filter Bar ────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  min-width: 220px;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Cairo', sans-serif;
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--primary); }

/* ── Print / Report Styles ────────────────────────── */
body.report-view-body {
  padding-top: 0;
}

.report-wrap {
  font-family: 'Cairo', sans-serif;
  background: var(--surface-2);
  padding: 24px;
  min-height: 100vh;
}

.report-page {
  background: #fff;
  width: 100%;
  max-width: 860px;
  margin: 0 auto 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

/* Cover page */
.cover-page {
  padding: 60px 70px;
  display: flex;
  flex-direction: column;
  min-height: 650px;
}

.cover-logo-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}

.cover-logo-img { width: 60px; height: 60px; }

.cover-agency-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
}

.cover-agency-name small {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
}

.cover-divider {
  height: 3px;
  background: var(--gradient);
  border-radius: 3px;
  margin-bottom: 40px;
}

.cover-badge {
  display: inline-block;
  background: var(--gradient);
  color: #fff;
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 20px;
  align-self: flex-start;
}

.cover-form-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.cover-form-subtitle {
  font-size: 1r;
  color: var(--text-muted);
  margin-bottom: 48px;
}

.cover-info-table {
  width: 100%;
  max-width: 500px;
  border-collapse: collapse;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}

.cover-info-table td {
  padding: 10px 16px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.cover-info-table tr:last-child td { border-bottom: none; }
.cover-info-table td:first-child {
  font-weight: 700;
  background: var(--surface-2);
  width: 40%;
  color: var(--text-muted);
}

.cover-info-table td:last-child { color: var(--text); font-weight: 600; }

.cover-footer {
  margin-top: auto;
  padding-top: 40px;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* Content page */
.content-page { min-height: 650px; }

.report-header {
  background: var(--gradient);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}

.report-header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-header-logo img { width: 32px; height: 32px; }

.report-header-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.report-header-ref {
  font-size: 0.8rem;
  opacity: 0.85;
}

.report-body { padding: 32px; }

.report-section-title {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin: 28px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-section-title::before {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--gradient);
  border-radius: 2px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.report-table tr { border-bottom: 1px solid var(--border); }
.report-table tr:last-child { border-bottom: none; }
.report-table tr:nth-child(even) td { background: var(--surface-2); }

.report-table td {
  padding: 11px 16px;
  font-size: 0.85rem;
  vertical-align: top;
}

.report-table .rt-label {
  width: 32%;
  font-weight: 700;
  color: var(--text-muted);
}

.report-table .rt-label small {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  margin-top: 1px;
}

.report-table .rt-value { color: var(--text); }

.report-page-footer {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding: 14px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Report top bar (above cover) */
.report-top-bar {
  background: var(--dark-nav);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  border-radius: var(--radius);
}

.report-top-bar-title { color: #fff; font-weight: 700; font-size: 0.9rem; }

.report-top-bar-actions { display: flex; gap: 8px; }

.approval-banner {
  background: linear-gradient(135deg, rgba(16,185,129,0.1), rgba(5,150,105,0.1));
  border: 1.5px solid rgba(16,185,129,0.3);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  color: #065f46;
  font-size: 0.875rem;
  font-weight: 600;
}

.approval-banner a { color: #059669; }

/* ── RTL Adjustments ────────────────────────────────── */
[dir="rtl"] .brief-table thead th { text-align: right; }
[dir="rtl"] .data-table thead th { text-align: right; }
[dir="rtl"] .field-label { text-align: right; }
[dir="rtl"] .cover-badge { align-self: flex-end; }
[dir="rtl"] .report-section-title { flex-direction: row-reverse; }
[dir="rtl"] .cover-footer { text-align: right; }
[dir="rtl"] .section-heading { flex-direction: row-reverse; }

/* ── Utility ────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.flex { display: flex; }
.gap-2 { gap: 8px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
.no-print { }

/* ── Print Media ────────────────────────────────────── */
@media print {
  .no-print { display: none !important; }
  body { padding-top: 0; background: #fff; }
  .report-wrap { padding: 0; background: #fff; }
  .report-page {
    box-shadow: none;
    border-radius: 0;
    max-width: 100%;
    page-break-after: always;
  }
  .report-top-bar { display: none !important; }
  @page { size: A4; margin: 1cm; }
}

/* ── Responsive Mobile ────────────────────────────────────── */
/* Mobile elements hidden on Desktop */
.mobile-toggle { display: none; }
.mobile-overlay { display: none; }
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 768px) {
  /* Header & Navigation */
  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--text);
    padding: 8px;
    cursor: pointer;
    z-index: 1001;
  }
  .mobile-toggle svg { width: 24px; height: 24px; }
  
  .nav-links {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 20px 20px;
    box-shadow: var(--shadow-md);
    transition: left 0.3s ease;
    z-index: 999;
    overflow-y: auto;
  }
  [dir="rtl"] .nav-links { left: auto; right: -280px; transition: right 0.3s; }
  
  .nav-links.active { left: 0; }
  [dir="rtl"] .nav-links.active { right: 0; }
  
  .nav-links li { width: 100%; margin-bottom: 8px; }
  .nav-link { width: 100%; padding: 12px 16px; font-size: 1rem; border-radius: 8px; }
  
  .mobile-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 998;
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  .mobile-overlay.active { opacity: 1; pointer-events: all; }
  
  .dropdown-menu { position: static; box-shadow: none; border: none; padding-left: 20px; width: 100%; }
  [dir="rtl"] .dropdown-menu { padding-left: 0; padding-right: 20px; }

  /* Page Layout */
  .page-wrapper, .page-wrapper-wide { padding: 16px; }
  .page-header { padding: 20px; }
  .page-title { font-size: 1.35rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .stat-card { padding: 16px; gap: 10px; }
  .stat-icon { width: 38px; height: 38px; }
  .stat-icon svg { width: 18px; height: 18px; }
  .stat-value { font-size: 1.25rem; }

  /* Data Table (Keep scrolling) */
  .data-table { min-width: 650px; }
  
  /* Brief forms-table (Stack vertically) */
  .brief-table, .brief-table tbody, .brief-table tr, .brief-table td { display: block; width: 100%; }
  .brief-table { box-shadow: none; border: none; background: transparent; }
  .brief-table thead { display: none; }
  .brief-table tbody tr { margin-bottom: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); padding: 6px 0; }
  .brief-table tbody tr:last-child { margin-bottom: 0; }
  .brief-table td { padding: 8px 16px; border-bottom: none; }
  .brief-table td.field-label { width: 100%; border-bottom: 1px dashed var(--border); padding-bottom: 10px; margin-bottom: 8px; font-size: 0.95rem; }
  .brief-table td.field-value { width: 100%; padding-top: 0; }

  /* Report table (Stack vertically) */
  .report-table, .report-table tbody, .report-table tr, .report-table td { display: block; width: 100%; }
  .report-table tr { margin-bottom: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
  .report-table td { padding: 10px 16px; border-bottom: none; }
  .report-table .rt-label { width: 100%; padding-bottom: 6px; font-size: 0.9rem; border-bottom: 1px dashed var(--border); margin-bottom: 6px; }
  .report-table .rt-value { padding-top: 0; }

  /* Cover info table (Stack vertically) */
  .cover-info-table, .cover-info-table tbody, .cover-info-table tr, .cover-info-table td { display: block; width: 100%; }
  .cover-info-table td:first-child { width: 100%; border-bottom: none; padding-bottom: 4px; background: transparent; }
  .cover-info-table td:last-child { width: 100%; padding-top: 0; }

  /* Kanban Board Smooth Horizontal Scroll */
  .kanban-board {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
  }
  .kanban-board::-webkit-scrollbar { height: 6px; }
  .kanban-board::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
  .kanban-col {
    min-width: 280px;
    max-width: 280px;
    scroll-snap-align: start;
    flex-shrink: 0;
  }

  /* Forms & Grids */
  .attachment-fields { grid-template-columns: 1fr; }
  .brand-grid { grid-template-columns: 1fr; }
  
  .cover-page { padding: 24px; min-height: auto; }
  .cover-form-title { font-size: 1.4rem; }
  .report-header { flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px; }
  .report-body { padding: 16px; }
}
