/* ===================================================
   نظام الأرشفة الإلكترونية — الستايل الموحد الرسمي
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

:root {
  --primary:       #1a3a5c;
  --primary-mid:   #1e4a73;
  --primary-light: #2563a8;
  --accent:        #c8a84b;
  --accent-light:  #f0d98a;
  --danger:        #b91c1c;
  --success:       #15803d;
  --warning:       #92400e;
  --text-dark:     #0f172a;
  --text-mid:      #334155;
  --text-muted:    #64748b;
  --surface:       #ffffff;
  --surface-2:     #f8fafc;
  --surface-3:     #f1f5f9;
  --border:        #dde3eb;
  --border-strong: #b0bec8;
  --shadow-sm: 0 1px 3px rgba(26,58,92,.08), 0 1px 2px rgba(26,58,92,.06);
  --shadow:    0 4px 16px rgba(26,58,92,.10), 0 2px 6px rgba(26,58,92,.06);
  --shadow-lg: 0 12px 40px rgba(26,58,92,.14), 0 4px 12px rgba(26,58,92,.08);
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
}

/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'IBM Plex Sans Arabic', Tahoma, Arial, sans-serif;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--text-dark);
  background: #eef2f7;
  min-height: 100vh;
}

/* ── Typography ───────────────────────────────────── */
h1,h2,h3,h4,h5,h6 {
  font-family: 'IBM Plex Sans Arabic', Tahoma, Arial, sans-serif;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

/* ── Navbar ───────────────────────────────────────── */
.app-navbar {
  background: var(--primary);
  border-bottom: 3px solid var(--accent);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.app-navbar .container {
  display: flex;
  align-items: stretch;
  min-height: 60px;
  gap: 0;
}

.navbar-brand-custom {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff !important;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .3px;
  padding: 0 20px 0 24px;
  border-left: 1px solid rgba(255,255,255,.12);
  white-space: nowrap;
}

.navbar-brand-custom .brand-icon {
  width: 34px;
  height: 34px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;   /* RTL: push to left */
  padding: 10px 16px;
  flex-wrap: wrap;
}

.navbar-user {
  color: rgba(255,255,255,.75);
  font-size: 13px;
  padding: 0 12px;
  border-right: 1px solid rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.navbar-user .role-badge {
  background: rgba(200,168,75,.25);
  color: var(--accent-light);
  border: 1px solid rgba(200,168,75,.4);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
}

/* ── Navbar Buttons ───────────────────────────────── */
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all .18s ease;
  border: 1px solid transparent;
  white-space: nowrap;
  font-family: inherit;
  cursor: pointer;
}

.nav-btn-primary  { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.25); }
.nav-btn-primary:hover { background: rgba(255,255,255,.25); color: #fff; }

.nav-btn-gold     { background: var(--accent); color: var(--primary); border-color: var(--accent); }
.nav-btn-gold:hover { background: var(--accent-light); color: var(--primary); }

.nav-btn-outline  { background: transparent; color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.3); }
.nav-btn-outline:hover { background: rgba(255,255,255,.1); color: #fff; }

.nav-btn-danger   { background: rgba(185,28,28,.15); color: #fca5a5; border-color: rgba(185,28,28,.3); }
.nav-btn-danger:hover { background: rgba(185,28,28,.3); color: #fff; }

/* ── Page Wrapper ─────────────────────────────────── */
.page-wrapper {
  max-width: 1300px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

/* ── Page Header ──────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.page-header-icon {
  width: 46px;
  height: 46px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.page-header h2 {
  font-size: 20px;
  color: var(--primary);
}

.page-header p {
  color: var(--text-muted);
  font-size: 13px;
  margin: 2px 0 0;
}

/* ── Card ─────────────────────────────────────────── */
.card-pro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-pro-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-2);
}

.card-pro-header h5 {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 7px;
}

.card-pro-body { padding: 20px; }

/* Colored header variants */
.card-pro-header.primary { background: var(--primary); border-color: var(--primary); }
.card-pro-header.primary h5 { color: #fff; }

.card-pro-header.gold    { background: linear-gradient(90deg,#b8923c,#c8a84b); border-color: #c8a84b; }
.card-pro-header.gold h5 { color: #fff; }

/* ── Stat Cards ───────────────────────────────────── */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
  text-decoration: none;
}

.stat-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.blue   { background: rgba(26,58,92,.1); }
.stat-icon.gold   { background: rgba(200,168,75,.15); }
.stat-icon.green  { background: rgba(21,128,61,.1); }
.stat-icon.red    { background: rgba(185,28,28,.1); }

.stat-value { font-size: 26px; font-weight: 700; color: var(--primary); line-height: 1; }
.stat-label { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

/* ── Table ────────────────────────────────────────── */
.table-pro {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.table-pro thead th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 12.5px;
  padding: 11px 14px;
  text-align: right;
  border: none;
  white-space: nowrap;
}

.table-pro thead th:first-child { border-radius: 0; }

.table-pro tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .14s;
}

.table-pro tbody tr:hover { background: #f0f5fb; }

.table-pro tbody td {
  padding: 11px 14px;
  color: var(--text-mid);
  vertical-align: middle;
}

.table-pro tbody tr:last-child { border-bottom: none; }

/* ── Badges ───────────────────────────────────────── */
.badge-pro {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-admin   { background: rgba(185,28,28,.1);  color: var(--danger);  border: 1px solid rgba(185,28,28,.2); }
.badge-user    { background: rgba(30,74,115,.1);  color: var(--primary-mid); border: 1px solid rgba(30,74,115,.2); }
.badge-complete{ background: rgba(21,128,61,.1);  color: var(--success); border: 1px solid rgba(21,128,61,.2); }
.badge-partial { background: rgba(146,64,14,.1);  color: var(--warning); border: 1px solid rgba(146,64,14,.2); }
.badge-pending { background: rgba(100,116,139,.1);color: var(--text-muted); border: 1px solid var(--border); }
.badge-count   { background: var(--primary);      color: #fff; }

/* ── Buttons ──────────────────────────────────────── */
.btn-pro {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all .16s;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.btn-pro-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-pro-primary:hover { background: var(--primary-mid); color: #fff; }

.btn-pro-gold    { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-pro-gold:hover { background: #b8923c; color: #fff; }

.btn-pro-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-pro-success:hover { background: #166534; color: #fff; }

.btn-pro-danger  { background: transparent; color: var(--danger); border-color: rgba(185,28,28,.35); }
.btn-pro-danger:hover  { background: var(--danger); color: #fff; }

.btn-pro-outline { background: transparent; color: var(--primary); border-color: var(--border-strong); }
.btn-pro-outline:hover { background: var(--surface-3); color: var(--primary); }

.btn-pro-sm  { padding: 4px 10px; font-size: 12px; }
.btn-pro-lg  { padding: 10px 24px; font-size: 15px; }

.btn-pro-block { width: 100%; justify-content: center; }

/* ── Form ─────────────────────────────────────────── */
.form-label-pro {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 6px;
}

.form-control-pro,
.form-select-pro {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-dark);
  background: var(--surface);
  transition: border-color .16s, box-shadow .16s;
  outline: none;
  appearance: none;
}

.form-control-pro:focus,
.form-select-pro:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(37,99,168,.12);
}

.form-control-pro::placeholder { color: #94a3b8; }

.form-select-pro {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2364748b' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 32px;
}

.form-text-pro { font-size: 12px; color: var(--text-muted); margin-top: 5px; }

.form-section {
  padding: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 7px;
}

.form-control-static {
  padding: 9px 13px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-mid);
  min-height: 40px;
}

textarea.form-control-pro { resize: vertical; min-height: 90px; }

/* ── Alerts ───────────────────────────────────────── */
.alert-pro {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-success-pro { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
.alert-danger-pro  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning-pro { background: #fef9c3; color: #92400e; border: 1px solid #fde047; }
.alert-info-pro    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ── Image Grid ───────────────────────────────────── */
.img-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}

.img-thumb:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow);
}

/* ── Divider ──────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

/* ── Note ellipsis ────────────────────────────────── */
.note-clip {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
  .page-wrapper { padding: 16px 12px 40px; }
  .app-navbar .container { flex-wrap: wrap; }
  .navbar-actions { padding: 6px 10px; }
  .table-pro thead th, .table-pro tbody td { padding: 8px 10px; }
  .stat-value { font-size: 22px; }
}

@media print {
  .app-navbar, .no-print { display: none !important; }
  body { background: #fff; }
  .card-pro { box-shadow: none; border: 1px solid #ccc; }
}
