/* ═══════════════════════════════════════════════════════════
   Prime Advertising — Internal App Stylesheet
   Brand: Red (#c0392b) + Black (#1a1a1a) + White + Gray
   ═══════════════════════════════════════════════════════════ */

:root {
  --brand-red: #c0392b;
  --brand-red-dark: #96281b;
  --brand-red-light: #e74c3c;
  --brand-black: #1a1a1a;
  --brand-gray: #6c757d;
  --sidebar-width: 240px;
  --topbar-height: 60px;
  --sidebar-bg: #1a1a1a;
  --sidebar-text: #e0e0e0;
  --sidebar-active: #c0392b;
  --card-border: #e9ecef;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  color: #1a1a1a;
  background: #f5f6fa;
  margin: 0;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.brand-icon {
  width: 36px; height: 36px;
  background: var(--brand-red);
  color: #fff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px; letter-spacing: 0.5px;
  flex-shrink: 0;
}

.brand-text {
  display: flex; flex-direction: column; line-height: 1.1;
}
.brand-name { font-size: 15px; font-weight: 700; color: #fff; }
.brand-sub { font-size: 10px; color: rgba(255,255,255,0.5); letter-spacing: 1px; text-transform: uppercase; }

.sidebar-nav {
  list-style: none; padding: 12px 0; margin: 0; flex: 1;
}

.sidebar-nav .nav-section {
  padding: 12px 16px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-radius: 0;
  font-size: 13.5px;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.sidebar-nav .nav-link:hover {
  background: rgba(255,255,255,0.06);
  color: #fff;
}
.sidebar-nav .nav-link.active {
  background: rgba(192,57,43,0.2);
  color: #fff;
  border-left-color: var(--brand-red);
  font-weight: 600;
}
.sidebar-nav .nav-link i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  opacity: 0.8;
}

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.25s ease;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--brand-black);
}

.sidebar-toggle {
  background: none; border: none; cursor: pointer;
  padding: 6px; color: var(--brand-gray);
  font-size: 20px;
  border-radius: 6px;
  transition: background 0.15s;
}
.sidebar-toggle:hover { background: #f0f0f0; }

.topbar-right { display: flex; align-items: center; gap: 8px; }

.topbar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 8px;
  color: var(--brand-gray);
  text-decoration: none;
  font-size: 18px;
  transition: background 0.15s;
}
.topbar-icon:hover { background: #f0f0f0; color: var(--brand-black); }

.notif-badge {
  position: absolute;
  top: -3px; right: -3px;
  background: var(--brand-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

.topbar-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--brand-black);
  font-size: 13px;
  transition: background 0.15s;
}
.topbar-profile:hover { background: #f0f0f0; }
.topbar-profile::after { display: none; }

/* ── Page Content ── */
.page-content {
  padding: 24px;
  flex: 1;
  max-width: 1400px;
  width: 100%;
}

/* ── Bootstrap Override: Primary ── */
.btn-primary, .bg-primary { background-color: var(--brand-red) !important; border-color: var(--brand-red) !important; }
.btn-primary:hover { background-color: var(--brand-red-dark) !important; border-color: var(--brand-red-dark) !important; }
.btn-outline-primary { color: var(--brand-red) !important; border-color: var(--brand-red) !important; }
.btn-outline-primary:hover { background-color: var(--brand-red) !important; color: #fff !important; }
.text-primary { color: var(--brand-red) !important; }
.border-primary { border-color: var(--brand-red) !important; }

/* ── Cards ── */
.card {
  border: 1px solid var(--card-border);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--card-border);
  padding: 12px 16px;
  font-size: 14px;
  border-radius: 10px 10px 0 0 !important;
}

/* ── KPI Cards ── */
.kpi-card {
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.kpi-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.kpi-value { font-size: 28px; font-weight: 800; line-height: 1; color: var(--brand-black); }
.kpi-label { font-size: 12px; color: var(--brand-gray); font-weight: 500; }

.bg-primary-soft { background: rgba(192,57,43,0.1); }
.bg-warning-soft { background: rgba(255,193,7,0.15); }
.bg-danger-soft { background: rgba(220,53,69,0.1); }
.bg-success-soft { background: rgba(25,135,84,0.1); }
.bg-info-soft { background: rgba(13,202,240,0.1); }

/* ── Deadline Colors ── */
.deadline-overdue { color: #dc3545; font-weight: 600; }
.deadline-due-today { color: #f39c12; font-weight: 600; }
.deadline-on-time { color: #198754; }

/* ── Status Badges ── */
.badge { font-size: 11px; font-weight: 600; }

/* ── Table ── */
.table { font-size: 13.5px; }
.table-danger-light { background: rgba(220,53,69,0.04); }

/* ── Job Actions ── */
.job-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Auth Layout ── */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 50%, #1a1a1a 100%);
}
.auth-container {
  width: 100%;
  max-width: 420px;
  padding: 20px;
}
.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.auth-brand { text-align: center; margin-bottom: 32px; }
.auth-logo {
  width: 60px; height: 60px;
  background: var(--brand-red);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 800; color: #fff;
  margin: 0 auto 16px;
}
.auth-title { font-size: 22px; font-weight: 800; margin: 0; color: var(--brand-black); }
.auth-subtitle { font-size: 13px; color: var(--brand-gray); margin: 4px 0 0; }
.auth-form .form-control { padding: 10px 14px; }

/* ── Avatars ── */
.avatar-xs { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-md { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.avatar-lg { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }

/* ── Comments ── */
.comments-thread { display: flex; flex-direction: column; gap: 16px; }
.comment-item { display: flex; gap: 12px; }
.comment-body { flex: 1; background: #f8f9fa; border-radius: 10px; padding: 12px 16px; }
.comment-meta { font-size: 12px; margin-bottom: 6px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.comment-text { font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.revision-comment .comment-body { background: #fef2f2; border: 1px solid #fecaca; }

/* ── Timeline ── */
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: #e0e0e0; }
.timeline-item { position: relative; margin-bottom: 20px; }
.timeline-dot {
  position: absolute; left: -17px; top: 4px;
  width: 12px; height: 12px;
  background: var(--brand-red); border-radius: 50%;
  border: 2px solid #fff;
}
.timeline-content { padding-left: 8px; }

/* ── Kanban ── */
.kanban-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  min-height: 60vh;
}
.kanban-column {
  min-width: 220px; width: 220px; flex-shrink: 0;
  display: flex; flex-direction: column;
}
.kanban-column-header {
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex; align-items: center; justify-content: space-between;
}
.kanban-cards {
  background: #f0f2f5;
  border-radius: 0 0 8px 8px;
  padding: 8px;
  flex: 1;
  display: flex; flex-direction: column; gap: 8px;
}
.kanban-card {
  background: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border: 1px solid #e9ecef;
  transition: box-shadow 0.15s;
  display: block;
}
.kanban-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.12); }
.kanban-card-overdue { border-left: 3px solid #dc3545 !important; }
.kanban-client { font-size: 11px; color: var(--brand-gray); margin-bottom: 2px; }
.kanban-job-name { font-size: 13px; line-height: 1.3; }
.kanban-assignee { font-size: 11px; }
.kanban-empty { text-align: center; color: #bbb; font-size: 12px; padding: 16px 0; }

/* ── Artwork ── */
.artwork-card { background: #fff; transition: box-shadow 0.15s; }
.artwork-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.artwork-preview-wrap { position: relative; overflow: hidden; height: 160px; background: #f8f9fa; }
.artwork-thumb { width: 100%; height: 100%; object-fit: contain; }
.artwork-lightbox { display: block; height: 100%; }
.artwork-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s; color: #fff; font-size: 28px;
}
.artwork-lightbox:hover .artwork-overlay { opacity: 1; }

/* ── Upload Dropzone ── */
.upload-dropzone {
  border: 2px dashed #dee2e6;
  border-radius: 10px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.upload-dropzone:hover, .upload-dropzone.drag-over {
  border-color: var(--brand-red);
  background: rgba(192,57,43,0.04);
}

/* ── Notifications ── */
.unread-notification { background: #fef9f0 !important; }
.notif-dot-wrap { width: 12px; flex-shrink: 0; padding-top: 4px; }
.notif-unread-dot { width: 8px; height: 8px; background: var(--brand-red); border-radius: 50%; }

/* ── Client Cards ── */
.client-card { transition: box-shadow 0.15s; }
.client-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.client-avatar { width: 44px; height: 44px; background: #f0f2f5; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ── Brief Content (supports Arabic RTL) ── */
.brief-content {
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 16px;
}

/* ── Responsive: Mobile ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }

  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }

  .kpi-card { padding: 14px; }
  .kpi-value { font-size: 22px; }

  .kanban-board { min-height: 40vh; }

  .artwork-preview-wrap { height: 120px; }

  /* Big approve/revision buttons on mobile */
  .btn-lg { padding: 14px 20px; font-size: 16px; }
}

/* ── Sidebar overlay on mobile ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}
.sidebar-overlay.show { display: block; }

/* ── Misc utilities ── */
.required::after { content: ' *'; color: var(--brand-red); }
.form-label.required::after { content: ' *'; color: var(--brand-red); }
.text-truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cursor-pointer { cursor: pointer; }

/* ── Progress bar brand color ── */
.progress-bar { background-color: var(--brand-red); }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }
