/* ==========================================================================
   Post Manager — design system
   Hand-written CSS (no build step). Dark theme, RTL (Arabic) layout.
   Palette: near-black + soft dark gray + lime accent.
   ========================================================================== */

/* ---------- Typography: Tajawal (self-hosted) ---------- */

@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/tajawal/tajawal-400-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/tajawal/tajawal-400-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/tajawal/tajawal-500-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/tajawal/tajawal-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/tajawal/tajawal-700-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/tajawal/tajawal-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/tajawal/tajawal-800-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/fonts/tajawal/tajawal-800-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122;
}

:root {
  color-scheme: dark;

  --bg: #0B0B0D;
  --card: #17171A;
  --card-hover: #1D1D21;
  --text: #F2F2F3;
  --text-secondary: #9A9AA2;
  --border: #2A2A2F;
  --accent: #C7F000;
  --accent-text: #16210A;
  --danger: #F87171;
  --danger-bg: rgba(248, 113, 113, 0.12);
  --success: #4ADE80;
  --success-bg: rgba(74, 222, 128, 0.12);
  --warning: #FBBF24;
  --warning-bg: rgba(251, 191, 36, 0.14);
  --info: #60A5FA;
  --info-bg: rgba(96, 165, 250, 0.14);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 12px 28px -12px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --sidebar-w: 248px;
  --font-sans: 'Tajawal', -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, "Noto Sans Arabic", "Segoe UI Arabic", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

[x-cloak] { display: none !important; }

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; line-height: 1.35; }

::selection { background: var(--accent); color: var(--accent-text); }

::placeholder { color: #6B6B72; }

a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Scrollbar (subtle, dark) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #3A3A40; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- Layout (RTL: sidebar on the right) ---------- */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #08080A;
  color: #F4F4F4;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: fixed;
  top: 0;
  right: 0;
  left: auto;
  bottom: 0;
  z-index: 40;
  border-left: 1px solid var(--border);
  transition: transform 0.2s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 22px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.sidebar-brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
  flex-shrink: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #ACACB4;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link:hover { background: #1A1A1D; color: #fff; }

.sidebar-link.active {
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}

.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-foot {
  border-top: 1px solid #202023;
  padding-top: 10px;
  margin-top: 10px;
  flex-shrink: 0;
}

.sidebar-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #ACACB4;
  background: transparent;
  border: none;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  text-align: right;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-logout-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-logout-btn:hover { background: var(--danger-bg); color: var(--danger); }

.main {
  margin-right: var(--sidebar-w);
  margin-left: 0;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
  background: rgba(11, 11, 13, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-titles { display: flex; flex-direction: column; justify-content: center; }
.header-title { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.3; }
.header-sub { color: var(--text-secondary); font-size: 13px; font-weight: 500; margin-top: 3px; line-height: 1.4; }

.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.header-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.mobile-menu-btn {
  display: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  flex-shrink: 0;
}

.mobile-menu-btn svg { width: 18px; height: 18px; }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

/* ---------- Account dropdown ---------- */

.account-menu { position: relative; }

.avatar-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 9px 5px 5px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { background: var(--card); border-color: var(--border); }

.avatar-btn-name {
  font-size: 13.5px;
  font-weight: 600;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: none;
}

.avatar-btn svg.chevron { width: 14px; height: 14px; color: var(--text-secondary); flex-shrink: 0; display: none; }

@media (min-width: 640px) {
  .avatar-btn-name, .avatar-btn svg.chevron { display: block; }
}

.account-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: auto;
  min-width: 240px;
  max-width: calc(100vw - 32px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px;
  z-index: 50;
}

.account-dropdown-head {
  padding: 10px 12px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.account-dropdown-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-dropdown-email {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: right;
}

.account-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: right;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
}

.account-dropdown-item svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--text-secondary); }

.account-dropdown-item:hover { background: var(--card-hover); }

.account-dropdown-item.danger { color: var(--danger); margin-top: 4px; padding-top: 9px; border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.account-dropdown-item.danger svg { color: var(--danger); }
.account-dropdown-item.danger:hover { background: var(--danger-bg); }

.content { padding: 24px 28px 48px; flex: 1; }

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 35;
}

/* ---------- Guest / login ---------- */

.guest-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 80% 20%, rgba(199, 240, 0, 0.08) 0%, var(--bg) 45%);
}

.guest-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 36px 32px;
}

.guest-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 26px;
}

.guest-brand .dot { width: 11px; height: 11px; border-radius: 3px; background: var(--accent); }

/* ---------- Cards / grid ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-pad { padding: 20px; }

.grid { display: grid; gap: 18px; }
.grid-stats { grid-template-columns: repeat(3, 1fr); }
.grid-companies { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-posts { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-2 { grid-template-columns: 1fr 1fr; }

@media (max-width: 900px) {
  .grid-stats { grid-template-columns: 1fr 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid-stats { grid-template-columns: 1fr; }
}

.stat-card { padding: 20px; }
.stat-label { color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.stat-value { font-size: 30px; font-weight: 800; margin-top: 6px; letter-spacing: -0.02em; }

/* Company card */

.company-card {
  display: flex;
  flex-direction: column;
  padding: 18px;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.company-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); border-color: #3A3A40; }

.company-card-top { display: flex; align-items: center; gap: 12px; }

.company-logo {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.company-logo-fallback {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.company-name { font-weight: 600; font-size: 15px; }
.company-meta { color: var(--text-secondary); font-size: 13px; margin-top: 2px; }

.company-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Post card */

.post-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.post-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #1D1D21;
  border-bottom: 1px solid var(--border);
}

.post-thumb-fallback {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #1D1D21;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #46464C;
}

.post-card-body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; }
.post-title { font-weight: 600; font-size: 14.5px; margin-bottom: 4px; }

.post-caption-preview {
  color: var(--text-secondary);
  font-size: 13px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: pre-wrap;
  min-height: 2.6em;
  unicode-bidi: plaintext;
}

.post-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.post-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-draft { background: rgba(255, 255, 255, 0.08); color: #B4B4BC; }
.badge-ready { background: var(--warning-bg); color: var(--warning); }
.badge-published { background: var(--success-bg); color: var(--success); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.btn svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary { background: #F2F2F3; color: #0B0B0D; }
.btn-primary:hover { background: #DADADC; }

.btn-accent { background: var(--accent); color: var(--accent-text); }
.btn-accent:hover { background: #b6da00; }

.btn-secondary { background: #1C1C20; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--card-hover); }

.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { background: #1C1C20; color: var(--text); }

.btn-danger { background: var(--danger-bg); color: var(--danger); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.2); }

.btn-danger-solid { background: var(--danger); color: #1A0000; }
.btn-danger-solid:hover { background: #f95d5d; }

.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; }

/* ---------- Forms ---------- */

.form-group { margin-bottom: 18px; }

.label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 7px;
  color: var(--text);
}

.label-hint { font-weight: 400; color: var(--text-secondary); }

.input, .textarea, .select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  background: #1C1C20;
  color: var(--text);
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(199, 240, 0, 0.15);
}

.select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239A9AA2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 34px;
  cursor: pointer;
}

.textarea {
  height: auto;
}

.textarea {
  resize: vertical;
  min-height: 220px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.field-error {
  color: var(--danger);
  font-size: 12.5px;
  margin-top: 6px;
}

.field-hint { color: var(--text-secondary); font-size: 12.5px; margin-top: 6px; }

.search-form { position: relative; max-width: 340px; }
.search-form input { padding-right: 36px; }
.search-form svg {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
  pointer-events: none;
}

/* ---------- Page header ---------- */

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.page-title { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.3; }
.page-sub { color: var(--text-secondary); font-size: 13.5px; font-weight: 500; margin-top: 4px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

/* ---------- Empty state ---------- */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state svg { width: 42px; height: 42px; margin: 0 auto 14px; color: #3F3F46; }
.empty-state-title { color: var(--text); font-weight: 600; font-size: 15px; margin-bottom: 4px; }

/* ---------- Post detail ---------- */

.post-detail-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .post-detail-grid { grid-template-columns: 1fr; }
}

.post-detail-image {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: #1D1D21;
}

.post-detail-image img { width: 100%; display: block; }

.caption-box {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 14.5px;
  line-height: 1.8;
  padding: 18px;
  background: #1C1C20;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  unicode-bidi: plaintext;
}

.detail-meta-list { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.detail-meta-row { display: flex; justify-content: space-between; font-size: 13.5px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.detail-meta-label { color: var(--text-secondary); }
.detail-meta-value { font-weight: 600; }

/* ---------- Toasts ---------- */

.toast-container {
  position: fixed;
  top: 20px;
  left: 20px;
  right: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: calc(100vw - 40px);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  background: #1A1A1E;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 14px 14px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.55;
  box-shadow: var(--shadow);
  min-width: 300px;
  max-width: 380px;
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast-icon svg { width: 16px; height: 16px; }

.toast-message { flex: 1; padding-top: 4px; word-break: break-word; }

.toast-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.toast-close:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.toast-close svg { width: 14px; height: 14px; }

.toast-success .toast-icon { background: var(--success-bg); color: var(--success); }
.toast-error .toast-icon { background: var(--danger-bg); color: var(--danger); }
.toast-warning .toast-icon { background: var(--warning-bg); color: var(--warning); }
.toast-info .toast-icon { background: var(--info-bg); color: var(--info); }

.toast-success { border-color: rgba(74, 222, 128, 0.3); }
.toast-error { border-color: rgba(248, 113, 113, 0.3); }
.toast-warning { border-color: rgba(251, 191, 36, 0.3); }
.toast-info { border-color: rgba(96, 165, 250, 0.3); }

.toast-enter { transition: opacity 0.25s ease, transform 0.25s ease; }
.toast-enter-start { opacity: 0; transform: translateY(-10px) scale(0.97); }
.toast-enter-end { opacity: 1; transform: translateY(0) scale(1); }
.toast-leave { transition: opacity 0.18s ease, transform 0.18s ease; }
.toast-leave-start { opacity: 1; transform: translateY(0) scale(1); }
.toast-leave-end { opacity: 0; transform: translateY(-8px) scale(0.97); }

@media (max-width: 480px) {
  .toast-container { left: 12px; right: 12px; top: 12px; }
  .toast { min-width: 0; max-width: none; width: 100%; }
}

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
}

.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.modal-body { color: var(--text-secondary); font-size: 14px; line-height: 1.6; margin-bottom: 22px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* ---------- Pagination ---------- */

.pagination { display: flex; align-items: center; gap: 4px; margin-top: 26px; flex-wrap: wrap; }

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  border: 1px solid transparent;
}

.pagination a:hover { background: var(--card-hover); border-color: var(--border); }
.pagination .active span { background: var(--accent); color: var(--accent-text); }
.pagination .disabled { color: #4B4B52; }

/* ---------- Account settings ---------- */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  align-items: start;
}

@media (max-width: 900px) {
  .settings-grid { grid-template-columns: 1fr; }
}

.settings-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.settings-card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--card-hover);
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.settings-card-icon svg { width: 18px; height: 18px; }

.settings-card-title { font-size: 15.5px; font-weight: 700; }
.settings-card-sub { color: var(--text-secondary); font-size: 12.5px; font-weight: 500; margin-top: 3px; line-height: 1.5; }

/* ---------- Misc ---------- */

.text-muted { color: var(--text-secondary); }
.mt-0 { margin-top: 0 !important; }
.image-preview-box {
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: #1C1C20;
}
.image-preview-box img { width: 70px; height: 70px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }

.divider { height: 1px; background: var(--border); margin: 20px 0; }

/* ---------- Mobile ---------- */

@media (max-width: 880px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-right: 0; }
  .mobile-menu-btn { display: inline-flex; }
  .sidebar-backdrop.open { display: block; }
  .header { padding: 14px 16px; }
  .content { padding: 18px 16px 40px; }
  .post-card-actions, .company-card-actions { flex-wrap: wrap; }
  .post-card-actions .btn, .company-card-actions .btn { flex: 1 1 auto; }
}
