/* ══════════════════════════════════════════════════════
   منصة المحاسبين — Modern Professional Theme
   Clean, minimal design optimized for accountants
   ══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

/* ─── Design Tokens ─── */
:root {
  --primary: #1a56db;
  --primary-hover: #1e40af;
  --primary-light: #dbeafe;
  --primary-50: #eff6ff;
  --accent: #059669;
  --accent-hover: #047857;
  --accent-light: #d1fae5;
  --warning: #d97706;
  --danger: #dc2626;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.05),0 1px 2px rgba(0,0,0,.03);
  --shadow: 0 4px 6px -1px rgba(0,0,0,.06),0 2px 4px -2px rgba(0,0,0,.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,.07);
  --shadow-lg: 0 20px 40px rgba(0,0,0,.08);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --transition: .2s ease;
}

/* ─── Base ─── */
*,*::before,*::after{box-sizing:border-box}

body {
  font-family: 'Cairo','Segoe UI',Tahoma,sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

::selection { background: var(--primary-light); color: var(--primary-hover); }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Navbar ─── */
.navbar {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
  padding: .6rem 0;
}
.navbar-brand { gap: 8px; }
.navbar-brand img { height: 36px; }
.navbar-brand span {
  font-weight: 700;
  font-size: .95rem;
  color: var(--primary) !important;
}
.navbar .nav-link {
  color: var(--text-secondary) !important;
  font-weight: 500;
  font-size: .88rem;
  padding: .45rem .85rem !important;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: var(--primary) !important;
  background: var(--primary-50);
}
.navbar .nav-link i { margin-left: 4px; font-size: .82rem; }
.navbar .badge {
  font-size: .6rem;
  padding: .2em .45em;
  animation: none;
}
.navbar-toggler {
  border: 1px solid var(--border) !important;
  padding: .35rem .55rem;
  box-shadow: none !important;
}
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23475569' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}
.navbar .btn-register {
  background: var(--primary);
  color: #fff !important;
  border: none;
  padding: .4rem 1.2rem !important;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .85rem;
}
.navbar .btn-register:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* ─── Hero Section ─── */
.hero-section {
  background: linear-gradient(160deg,#0f2557 0%,#1a56db 55%,#3b82f6 100%);
  color: #fff;
  padding: 64px 0 56px;
  margin-bottom: 0;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%,rgba(255,255,255,.06) 0%,transparent 60%);
  pointer-events: none;
}
.hero-section::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  right: -100px; bottom: -200px;
  border-radius: 50%;
  background: rgba(255,255,255,.03);
  pointer-events: none;
}
.hero-section h1 {
  font-weight: 800;
  font-size: 2.3rem;
  line-height: 1.4;
  margin-bottom: .75rem;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: unset;
  background: none;
}
.hero-section .lead {
  opacity: .8;
  font-size: 1.05rem;
  line-height: 1.8;
}
.hero-section .btn {
  font-size: .9rem;
  padding: .65rem 1.6rem;
  border-radius: var(--radius-sm);
}
.hero-section .btn-primary {
  background: #fff !important;
  color: var(--primary) !important;
  border: none !important;
  font-weight: 700;
}
.hero-section .btn-primary:hover {
  background: var(--primary-light) !important;
  color: var(--primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,.15);
}
.hero-section .btn-outline-primary {
  border: 2px solid rgba(255,255,255,.35) !important;
  color: #fff !important;
  font-weight: 600;
  background: transparent !important;
}
.hero-section .btn-outline-primary:hover {
  background: rgba(255,255,255,.12) !important;
  border-color: rgba(255,255,255,.6) !important;
  color: #fff !important;
}
.hero-section img.img-fluid {
  max-height: 320px;
  filter: drop-shadow(0 8px 30px rgba(0,0,0,.2));
}

/* ─── Search Section ─── */
.search-section {
  margin-top: -28px;
  position: relative;
  z-index: 10;
}
.search-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}
.search-form {
  background: var(--surface);
  padding: 26px 30px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.search-form .form-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: .3rem;
}

/* ─── Cards ─── */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease,box-shadow .25s ease;
  margin-bottom: 1.1rem;
  background: var(--surface);
  animation: none;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card-header {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  padding: .85rem 1.15rem;
  font-size: .92rem;
}
.card-body { padding: 1.2rem; }

.accountant-card {
  height: 100%;
  border: 1px solid var(--border);
}
.accountant-card:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 20px rgba(26,86,219,.08);
}

/* ─── Profile Image ─── */
.profile-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 3px solid var(--primary-light);
  border-radius: 50%;
}

/* ─── Feature Icons ─── */
.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  line-height: normal;
  background: var(--primary-50);
  border-radius: var(--radius);
  margin: 0 auto;
  transition: transform .3s;
}
.feature-icon:hover { transform: scale(1.06); }
.feature-icon i.fa-3x { font-size: 1.5rem !important; }

/* ─── Buttons ─── */
.btn {
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: all var(--transition);
  font-size: .88rem;
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(26,86,219,.2);
}
.btn-success {
  background: var(--accent);
  border-color: var(--accent);
}
.btn-success:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn-lg {
  padding: .65rem 1.6rem;
  font-size: .92rem;
  border-radius: var(--radius-sm);
}

/* ─── Forms ─── */
.form-control,.form-select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .55rem .85rem;
  font-size: .88rem;
  transition: border-color var(--transition),box-shadow var(--transition);
  background: var(--surface);
}
.form-control:focus,.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}
.form-label {
  font-weight: 600;
  font-size: .86rem;
  color: var(--text-secondary);
  margin-bottom: .3rem;
}

/* ─── Alerts ─── */
.alert {
  border-radius: var(--radius-sm);
  border: none;
  font-size: .9rem;
  font-weight: 500;
}
.alert-success { background: var(--accent-light); color: #065f46; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: var(--primary-light); color: #1e3a8a; }

/* ─── List Groups ─── */
.list-group-item {
  border-color: var(--border);
  padding: .7rem 1rem;
  font-size: .88rem;
  transition: all var(--transition);
}
.list-group-item i { width: 20px; text-align: center; }
.list-group-item-action:hover {
  background: var(--primary-50);
  color: var(--primary);
}
.list-group-item.active {
  background: var(--primary);
  border-color: var(--primary);
}

/* ─── Badges ─── */
.badge { font-weight: 600; border-radius: 6px; font-size: .72rem; }

/* ─── Stats Cards ─── */
.stat-card { text-align: center; }
.stat-card .stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: .6rem;
}
.stat-card .stat-icon.blue { background: var(--primary-50); color: var(--primary); }
.stat-card .stat-icon.green { background: var(--accent-light); color: var(--accent); }
.stat-card .stat-icon.amber { background: #fef3c7; color: var(--warning); }
.stat-card h3 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: .1rem;
}
.stat-card .text-muted { font-size: .82rem; }

/* Old-style stat cards (backward compat) */
.card.text-center .fa-3x { font-size: 1.6rem !important; }
.card.text-center h3 { font-size: 1.6rem; font-weight: 800; }

/* ─── Messages ─── */
#messages-container {
  background: var(--bg);
  border-radius: var(--radius-sm);
}

/* ─── Featured Section ─── */
.featured-section { background: var(--surface); }
.featured-section h2,.features-section h2,.search-section h2 {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--text);
}

/* ─── Features Section ─── */
.features-section { background: #f8fafc; }
.features-section h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-top: .3rem;
}
.features-section p {
  color: var(--text-secondary);
  font-size: .86rem;
  line-height: 1.6;
}

/* ─── Auth Pages (Login/Register) ─── */
.auth-wrapper {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  padding: 2rem 0;
}
.auth-card {
  border: none !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-md) !important;
  max-width: 480px;
  margin: 0 auto;
}
.auth-card .card-body { padding: 2.5rem !important; }
.auth-card h2 {
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text);
}
.auth-card .auth-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius);
  background: var(--primary-50);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1rem;
}
.auth-card .btn-primary {
  padding: .6rem 1rem;
  font-size: .92rem;
}
.auth-card .form-control { padding: .6rem .9rem; }

/* ─── Dashboard Sidebar ─── */
.dash-sidebar .card {
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.dash-sidebar .profile-section {
  padding: 1.5rem 1rem;
  background: linear-gradient(160deg,#0f2557,#1a56db);
  color: #fff;
  text-align: center;
}
.dash-sidebar .profile-section img {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.25);
}
.dash-sidebar .profile-section h5 { color: #fff; font-weight: 700; font-size: 1rem; margin-top: .6rem; }
.dash-sidebar .profile-section p { color: rgba(255,255,255,.7); font-size: .82rem; margin-bottom: .3rem; }
.dash-sidebar .list-group-item {
  border: none;
  border-bottom: 1px solid var(--border-light);
  padding: .65rem 1rem;
  font-size: .86rem;
}
.dash-sidebar .list-group-item:last-child { border-bottom: none; }
.dash-sidebar .list-group-item.active {
  background: var(--primary-50);
  color: var(--primary);
  font-weight: 700;
}
.dash-sidebar .list-group-item:hover:not(.active) {
  background: var(--primary-50);
}

/* ─── Footer ─── */
footer {
  background: #0f172a !important;
  color: #cbd5e1;
}
footer h5 {
  font-size: .95rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: .6rem;
}
footer p,footer li { font-size: .85rem; }
footer a {
  color: #94a3b8 !important;
  transition: color var(--transition);
}
footer a:hover { color: #fff !important; }
footer hr { border-color: rgba(255,255,255,.08); }

/* ─── Section Headings ─── */
section h2 { font-weight: 700; }
section .text-muted { color: var(--text-secondary) !important; }

/* ─── Tables ─── */
.table { font-size: .88rem; }
.table thead th {
  background: #f8fafc;
  font-weight: 700;
  font-size: .82rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .02em;
  border-bottom: 2px solid var(--border);
}

/* ─── RTL Adjustments ─── */
[dir="rtl"] .text-end { text-align: left !important; }
[dir="rtl"] .me-2 { margin-left: .5rem !important; margin-right: 0 !important; }
[dir="rtl"] .me-3 { margin-left: 1rem !important; margin-right: 0 !important; }

/* ─── Page Header ─── */
.page-header {
  background: linear-gradient(160deg,#0f2557,#1a56db);
  color: #fff;
  padding: 2.5rem 0;
  margin-bottom: 0;
}
.page-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
}
.page-header p { opacity: .7; font-size: .92rem; }

/* ─── Empty State ─── */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: .8rem; opacity: .3; display: block; }
.empty-state h5 { color: var(--text-secondary); font-weight: 600; }

/* ─── Responsive ─── */
@media (max-width: 991.98px) {
  .navbar .navbar-collapse { padding-top: .5rem; }
  .navbar .nav-link { padding: .5rem .6rem !important; }
}
@media (max-width: 768px) {
  .hero-section { padding: 40px 0 32px; }
  .hero-section h1 { font-size: 1.6rem; }
  .hero-section .lead { font-size: .9rem; }
  .hero-section .col-lg-6:last-child { display: none; }
  .search-form { padding: 18px; }
  .card-body { padding: 1rem; }
  section h2 { font-size: 1.25rem; }
  .auth-card .card-body { padding: 1.5rem !important; }
}
@media (max-width: 576px) {
  .hero-section .btn { width: 100%; margin-bottom: .5rem; }
  .hero-section .me-3 { margin-left: 0 !important; }
}

/* ─── Smooth Animations ─── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .4s ease-out; }

/* ─── Utility Classes ─── */
.text-primary { color: var(--primary) !important; }
.bg-soft-primary { background: var(--primary-50) !important; }
.bg-soft-success { background: var(--accent-light) !important; }
.bg-soft-warning { background: #fef3c7 !important; }
.bg-soft-danger { background: #fee2e2 !important; }
.rounded-xl { border-radius: var(--radius-lg) !important; }
.fw-800 { font-weight: 800 !important; }

/* ─── News Cards ─── */
.news-card {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  overflow: hidden;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0,0,0,.08);
  border-color: var(--primary) !important;
}
.news-image-wrap { position: relative; overflow: hidden; }
.news-img {
  height: 180px;
  object-fit: cover;
  transition: transform .4s ease;
}
.news-card:hover .news-img { transform: scale(1.05); }
.news-image-placeholder {
  height: 180px;
  background: linear-gradient(135deg,#eff6ff,#dbeafe);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.news-image-placeholder i {
  font-size: 2.5rem;
  color: #93c5fd;
}
.news-badge-important {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #f59e0b;
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(245,158,11,.3);
}
.news-content p { margin-bottom: 1rem; }
.news-content p:last-child { margin-bottom: 0; }
.news-content a { color: var(--primary); word-break: break-all; }

/* ─── News Section (Homepage) ─── */
.news-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.news-section .section-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}
.news-section .section-header a {
  font-size: .85rem;
  font-weight: 600;
}

/* ─── Important News Banner (Services Page) ─── */
.important-news-banner {
  background: linear-gradient(135deg,#fef3c7,#fde68a);
  border: 1px solid #fcd34d;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 1.5rem;
}
.important-news-banner .banner-title {
  font-weight: 700;
  color: #92400e;
  font-size: .9rem;
  margin-bottom: .5rem;
}
.important-news-banner .banner-title i {
  margin-left: 6px;
}
.important-news-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(255,255,255,.6);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  transition: background .2s;
  text-decoration: none;
  color: var(--text);
}
.important-news-item:last-child { margin-bottom: 0; }
.important-news-item:hover {
  background: #fff;
  color: var(--primary);
}
.important-news-item img {
  width: 50px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.important-news-item .news-info { flex: 1; min-width: 0; }
.important-news-item .news-info strong {
  font-size: .82rem;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.important-news-item .news-info small {
  font-size: .72rem;
  color: var(--text-muted);
}

/* ─── Jobs ─── */
.job-card {
  border: 1px solid var(--border) !important;
  border-radius: var(--radius) !important;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.job-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.07);
  border-color: var(--primary) !important;
}
.job-featured {
  border-right: 4px solid #f59e0b !important;
}
.job-status {
  display: inline-flex;
  align-items: center;
  font-size: .75rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 20px;
  white-space: nowrap;
}
.job-status-available {
  background: #d1fae5;
  color: #065f46;
}
.job-status-noresponse {
  background: #f1f5f9;
  color: #64748b;
}
.job-status-filled {
  background: #fee2e2;
  color: #991b1b;
}
