:root {
  --ink: #10253a;
  --ink-soft: #4e6479;
  --line: #d7e3ef;
  --card: #ffffff;
  --bg: #eef3f9;
  --brand: #0f8b8d;
  --brand-deep: #156082;
  --brand-soft: #d8f1ee;
  --accent: #f19c48;
  --accent-soft: #fff1e3;
  --ok-bg: #e8f8ef;
  --ok-ink: #12653f;
  --warn-bg: #fff8e8;
  --warn-ink: #775812;
  --danger-bg: #ffeceb;
  --danger-ink: #8b211f;
  --shadow-1: 0 8px 22px rgba(16, 37, 58, 0.08);
  --shadow-2: 0 20px 40px rgba(16, 37, 58, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  color: var(--ink);
  font-family: "Poppins", "Manrope", "Noto Sans Arabic", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 8%, #d9f2ee 0, transparent 28%),
    radial-gradient(circle at 92% 92%, #fde8d3 0, transparent 30%),
    linear-gradient(180deg, #f6f9fd 0%, var(--bg) 100%);
  background-attachment: fixed;
  line-height: 1.45;
}

.app-shell {
  display: grid;
  grid-template-columns: 274px 1fr;
  min-height: 100vh;
  position: relative;
  min-width: 0;
}

.sidebar {
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 255, 255, 0.12), transparent 34%),
    linear-gradient(185deg, #0f8b8d 0%, #17607d 66%, #1a3652 100%);
  color: #fff;
  padding: 18px 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin: 0 4px 16px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.94);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 7px;
  font-size: 14px;
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.nav a > span:last-child {
  min-width: 0;
  flex: 1 1 auto;
}

.nav a:hover,
.nav a.active {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  transform: translateX(2px);
}

.nav-ic {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
  flex: 0 0 28px;
  overflow: hidden;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.nav-ic svg {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px;
  min-height: 16px;
  max-width: 16px;
  max-height: 16px;
  display: block;
  color: rgba(255, 255, 255, 0.9);
}

.nav .nav-ic {
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  min-height: 28px !important;
  max-width: 28px !important;
  max-height: 28px !important;
}

.nav .nav-ic svg {
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
}

.nav a:hover .nav-ic,
.nav a.active .nav-ic {
  transform: scale(1.06);
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.28);
}

.sidebar .secondary {
  background: rgba(255, 255, 255, 0.95);
  color: #123047;
  border: none;
  font-weight: 700;
}

.sidebar .secondary:hover {
  transform: translateY(-1px);
}

.sidebar-backdrop {
  display: none;
}

.main {
  padding: 18px;
  min-width: 0;
}

.topbar {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border: 1px solid #d8e4f0;
  border-radius: 18px;
  padding: 15px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-1);
  position: sticky;
  top: 10px;
  z-index: 24;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-title {
  min-width: 0;
}

.topbar-search {
  width: min(360px, 36vw);
  min-width: 160px;
}

.topbar-search input {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #d4e2ef;
  padding: 0 12px;
  background: #fff;
}

.topbar h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.4px;
  text-transform: capitalize;
}

.topbar .muted {
  margin-top: 3px;
}

.mobile-nav-toggle {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 7px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.mobile-nav-toggle span {
  display: block;
  height: 2px;
  background: #204662;
  border-radius: 2px;
  transform-origin: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.mobile-nav-toggle:hover {
  transform: translateY(-1px);
  border-color: #a8c3da;
  box-shadow: 0 8px 16px rgba(13, 45, 72, 0.16);
}

body.sidebar-open .mobile-nav-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

body.sidebar-open .mobile-nav-toggle span:nth-child(2) {
  opacity: 0;
}

body.sidebar-open .mobile-nav-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.head-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  border: 1px solid #d6e4f1;
  color: #173b57;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

button.head-chip {
  cursor: pointer;
}

.head-chip:hover {
  transform: translateY(-1px);
  border-color: #b7cadb;
  box-shadow: 0 8px 16px rgba(18, 49, 73, 0.12);
}

.chip-count {
  background: linear-gradient(130deg, var(--brand), var(--brand-deep));
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  padding: 4px 7px;
  min-width: 20px;
  text-align: center;
  transition: transform 0.25s ease;
}

.chip-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 16px;
}

.chip-icon svg {
  width: 16px !important;
  height: 16px !important;
  display: block;
  color: #204e6d;
}

.head-chip.sound-off {
  opacity: 0.72;
  border-color: #d7dfe8;
}

.head-chip.bump {
  animation: chipBump 0.45s ease;
}

.head-chip.bump .chip-count {
  transform: scale(1.14);
}

.user-panel {
  min-width: 210px;
  text-align: right;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid #d8e5f1;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.user-main-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.role-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  color: #13445f;
  background: #e4f2fb;
  border: 1px solid #bfdaeb;
  text-transform: uppercase;
  letter-spacing: 0.25px;
}

.user-panel .small {
  margin-top: 3px;
}

.head-noti-wrap {
  position: relative;
}

.head-noti-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 340px;
  max-height: 380px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
  display: none;
  z-index: 260;
}

.head-noti-dropdown.open {
  display: block;
  animation: dropIn 0.18s ease;
}

.head-noti-wrap.open .head-noti-dropdown {
  display: block;
  animation: dropIn 0.18s ease;
}

.head-noti-wrap:focus-within .head-noti-dropdown {
  display: block;
  animation: dropIn 0.18s ease;
}

.head-noti-item {
  display: block;
  padding: 10px 12px;
  border-bottom: 1px solid #edf3f8;
  color: var(--ink);
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.head-noti-item:hover {
  background: #f6fbff;
}

.head-noti-item span {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
  margin-top: 2px;
}

.head-noti-viewall {
  display: block;
  text-align: center;
  padding: 10px 12px;
  text-decoration: none;
  font-weight: 700;
  color: #1c5276;
  background: #f5fbff;
}

.muted {
  color: var(--ink-soft);
}

.page {
  margin-top: 16px;
  animation: pageFade 0.28s ease;
}

.reveal-item {
  opacity: 1;
  transform: none;
  animation: revealUp 0.44s ease both;
  animation-delay: var(--reveal-delay, 0ms);
}

.flash {
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid transparent;
  font-size: 14px;
}

.flash.success {
  background: var(--ok-bg);
  color: var(--ok-ink);
  border-color: #bce6d0;
}

.flash.error {
  background: var(--danger-bg);
  color: var(--danger-ink);
  border-color: #f3c7c5;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.kpi {
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}

.card {
  background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  box-shadow: var(--shadow-1);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, rgba(15, 139, 141, 0.05), rgba(21, 96, 130, 0.35), rgba(15, 139, 141, 0.05));
}

.card:hover {
  transform: translateY(-2px);
  border-color: #c6d7e7;
  box-shadow: 0 14px 24px rgba(16, 37, 58, 0.1);
}

.kpi-value {
  font-size: 30px;
  font-weight: 700;
  margin: 5px 0 0;
  letter-spacing: -0.4px;
  overflow-wrap: anywhere;
}

label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin: 8px 0 6px;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #86aeda;
  box-shadow: 0 0 0 3px rgba(43, 104, 151, 0.13);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #bfd2e5;
}

button,
.btn {
  background: linear-gradient(125deg, var(--brand), var(--brand-deep));
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button:hover,
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(18, 73, 109, 0.24);
  filter: saturate(1.07);
}

button.secondary,
.btn.secondary {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

button.secondary:hover,
.btn.secondary:hover {
  box-shadow: 0 8px 16px rgba(16, 37, 58, 0.1);
}

button.warn {
  background: linear-gradient(125deg, #e8a415, #cf8400);
}

button.danger {
  background: linear-gradient(125deg, #d8554c, #a92e27);
}

.table-wrap {
  overflow: auto;
  width: 100%;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid #e0e9f1;
  background: #fff;
  scrollbar-width: thin;
  scrollbar-color: #b6c9da #eef4f9;
}

.table-wrap::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #b6c9da;
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #eef4f9;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 740px;
  background: #fff;
}

th,
td {
  text-align: left;
  padding: 9px 8px;
  border-bottom: 1px solid #edf2f7;
  font-size: 13px;
  vertical-align: top;
}

th {
  color: var(--ink-soft);
  font-weight: 700;
  background: #f8fbff;
  position: sticky;
  top: 0;
  z-index: 1;
}

tr:hover td {
  background: #fbfdff;
}

.attendance-sheet-wrap {
  overflow-x: auto;
}

.attendance-sheet-table {
  min-width: 1100px;
}

.attendance-sheet-table th,
.attendance-sheet-table td {
  text-align: center;
  white-space: nowrap;
  padding: 8px 6px;
}

.attendance-sheet-table th:nth-child(-n + 3),
.attendance-sheet-table td:nth-child(-n + 3) {
  text-align: left;
  background: #f8fbff;
  position: sticky;
  left: 0;
  z-index: 2;
}

.attendance-sheet-table th:nth-child(2),
.attendance-sheet-table td:nth-child(2) {
  left: 146px;
}

.attendance-sheet-table th:nth-child(3),
.attendance-sheet-table td:nth-child(3) {
  left: 272px;
}

.sheet-status-p {
  background: #e7f7ef;
  color: #1a6d45;
  font-weight: 800;
}

.sheet-status-l {
  background: #fff3d5;
  color: #7f5a00;
  font-weight: 800;
}

.sheet-status-ul,
.sheet-status-a {
  background: #ffe9e8;
  color: #8b2e2a;
  font-weight: 800;
}

.sheet-day-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  padding: 1px 5px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
  font-weight: 800;
}

.sheet-day-link:hover {
  border-color: rgba(16, 37, 58, 0.24);
  background: rgba(255, 255, 255, 0.58);
}

.invoice-print-card {
  background: #fff;
}

.invoice-head {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  border-bottom: 2px solid #d8e5f1;
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.invoice-logo {
  max-width: 190px;
  max-height: 110px;
  object-fit: contain;
}

.invoice-logo-fallback {
  width: 120px;
  height: 120px;
  border-radius: 12px;
  border: 1px solid #d6e3ef;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1f4d6d;
  background: #f6fbff;
}

.invoice-logo-fallback svg {
  width: 44px;
  height: 44px;
}

.invoice-brand-right h2 {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.1;
}

.invoice-brand-right p {
  margin: 2px 0;
  color: #34546d;
}

.invoice-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 20px;
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid #dce8f2;
  border-radius: 12px;
  background: #f9fcff;
}

.invoice-note {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #dce8f2;
  border-radius: 10px;
  background: #f9fcff;
}

.invoice-signature-row {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.invoice-sign-block {
  border: 1px dashed #c8d9e8;
  border-radius: 12px;
  padding: 10px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.invoice-sign-block img {
  max-width: 180px;
  max-height: 80px;
  object-fit: contain;
}

.invoice-sign-placeholder {
  color: #5a758c;
  font-size: 12px;
  border: 1px dashed #b9cedf;
  border-radius: 8px;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge {
  display: inline-block;
  border-radius: 999px;
  font-size: 11px;
  padding: 4px 9px;
  font-weight: 700;
}

.badge.ok {
  color: var(--ok-ink);
  background: var(--ok-bg);
  border: 1px solid #bce6d0;
}

.badge.warn {
  color: var(--warn-ink);
  background: var(--warn-bg);
  border: 1px solid #f1e0af;
}

.badge.danger {
  color: var(--danger-ink);
  background: var(--danger-bg);
  border: 1px solid #f4c9c8;
}

.badge.muted {
  color: #3a4f63;
  background: #edf2f7;
  border: 1px solid #d6e2ed;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1;
  padding: 4px 8px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.tier-silver {
  color: #2b4f66;
  background: #e9f0f5;
  border: 1px solid #ccdae5;
}

.tier-gold {
  color: #6c4b00;
  background: #fff0c7;
  border: 1px solid #eed38a;
}

.tier-platinum {
  color: #3a245e;
  background: #efe6ff;
  border: 1px solid #ccb8f2;
}

.row {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.col-1 { grid-column: span 1; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; }
.col-12 { grid-column: span 12; }

.auth-wrap {
  max-width: 1040px;
  margin: 26px auto;
  padding: 0 16px 20px;
}

.auth-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
}

.hero {
  background:
    radial-gradient(circle at 12% 12%, rgba(255, 255, 255, 0.2), transparent 35%),
    linear-gradient(135deg, #0f8b8d 0%, #145678 65%, #21365a 100%);
  color: #fff;
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 20px 30px rgba(10, 31, 52, 0.2);
}

.hero h2 {
  margin-top: 0;
  font-size: 30px;
}

.hero p {
  opacity: 0.95;
  line-height: 1.5;
}

.small {
  font-size: 12px;
  color: var(--ink-soft);
}

.auth-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-1);
}

.video-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}

video,
canvas {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0b1722;
}

.chat-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  max-height: 380px;
  overflow: auto;
  padding: 10px;
  background: #f8fbff;
  scrollbar-width: thin;
}

.bubble {
  max-width: 78%;
  margin-bottom: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 13px;
}

.bubble.me {
  background: #ddf2ff;
  margin-left: auto;
}

.bubble.other {
  background: #fff;
  border: 1px solid var(--line);
}

.timeline-post {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  box-shadow: 0 8px 18px rgba(16, 37, 58, 0.06);
}

.timeline-post-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.timeline-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.timeline-comments {
  margin-top: 10px;
}

.timeline-comment {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #fff;
  margin-bottom: 8px;
}

.timeline-comment.reply {
  margin-left: 20px;
  background: #f7fbff;
}

.mail-folder-active {
  border-color: #98bdd9 !important;
  background: #eaf6ff !important;
  color: #0f4e77 !important;
}

.mail-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 8px;
}

.mail-editor-toolbar .secondary {
  padding: 6px 10px;
  border-radius: 9px;
}

.mail-rich-editor {
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  outline: none;
}

.mail-rich-editor:focus {
  border-color: #86aeda;
  box-shadow: 0 0 0 3px rgba(43, 104, 151, 0.13);
}

.mail-card {
  border: 1px solid #dce7f2;
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
}

.mail-unread {
  border-left: 4px solid #2b6b99;
}

.mail-read {
  border-left: 4px solid #cbd8e5;
}

.mail-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.mail-body {
  margin: 8px 0;
  overflow-wrap: anywhere;
}

.mail-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.mail-reply-box summary {
  cursor: pointer;
  color: #1d5379;
  font-weight: 700;
}

.doc-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.doc-thumb-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid #d7e4ef;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.doc-thumb-card:hover {
  transform: translateY(-2px);
  border-color: #a9c6de;
  box-shadow: 0 10px 18px rgba(16, 37, 58, 0.12);
}

.doc-thumb-media {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f8fc;
}

.doc-thumb-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doc-thumb-file {
  font-weight: 800;
  font-size: 14px;
  color: #35546c;
}

.doc-thumb-meta {
  padding: 8px;
}

.doc-thumb-meta strong {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

.profile-photo-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 8px;
  text-align: center;
}

.profile-photo-card img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #dbe6f1;
}

.profile-photo-fallback {
  height: 120px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d8eef8, #f6fbff);
  color: #1e5579;
  font-size: 32px;
  font-weight: 800;
}

.holy-book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.holy-book-card {
  border: 1px solid #dce8f3;
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, #ffffff, #f8fcff);
}

.holy-book-card h4 {
  margin: 0 0 6px;
}

.mobile-quickbar {
  display: none;
}

@keyframes pageFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dropIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chipBump {
  0% {
    transform: translateY(0);
  }
  35% {
    transform: translateY(-2px);
  }
  100% {
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .topbar {
    align-items: center;
    flex-wrap: wrap;
  }

  .topbar-left {
    flex: 1 1 460px;
  }

  .topbar-right {
    flex: 1 1 300px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
  }

  .header-actions {
    justify-content: flex-end;
  }

  .user-panel {
    min-width: 180px;
  }

  .topbar-search {
    width: min(320px, 40vw);
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: min(82vw, 320px);
    transform: translateX(-104%);
    transition: transform 0.25s ease;
    z-index: 120;
    box-shadow: 12px 0 30px rgba(10, 25, 40, 0.26);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(8, 20, 33, 0.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 110;
  }

  body.sidebar-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-nav-toggle {
    display: inline-flex;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f1f7ff 100%);
    border-color: #bfd4e7;
    box-shadow: 0 8px 16px rgba(14, 44, 69, 0.1);
    gap: 5px;
    padding: 9px;
  }

  .main {
    padding: 12px;
    padding-bottom: 84px;
  }

  .topbar {
    top: 8px;
    border-radius: 14px;
    padding: 12px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .topbar-left {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "menu title"
      "search search";
    align-items: center;
    gap: 10px;
  }

  .mobile-nav-toggle {
    grid-area: menu;
  }

  .topbar-title {
    grid-area: title;
    min-width: 0;
  }

  .topbar-title .muted {
    display: none;
  }

  .topbar h1 {
    font-size: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-search {
    grid-area: search;
    width: 100%;
    min-width: 0;
  }

  .topbar-search input {
    height: 42px;
    border-radius: 12px;
  }

  .topbar-right {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
    align-items: stretch;
  }

  .header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    justify-content: initial;
  }

  .head-chip {
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding: 8px 6px;
    border-radius: 12px;
  }

  .chip-label {
    display: none;
  }

  .user-panel {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .user-main-row {
    justify-content: flex-start;
  }

  .auth-grid {
    grid-template-columns: 1fr;
  }

  .col-1,
  .col-2,
  .col-3,
  .col-4,
  .col-5,
  .col-6,
  .col-7,
  .col-8,
  .col-9,
  .col-10,
  .col-11,
  .col-12 {
    grid-column: span 12;
  }

  table {
    min-width: 620px;
  }

  .video-wrap {
    grid-template-columns: 1fr;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .head-noti-dropdown {
    width: min(92vw, 320px);
    right: 0;
  }

  .invoice-head {
    grid-template-columns: 1fr;
  }

  .invoice-meta-grid {
    grid-template-columns: 1fr;
  }

  .invoice-signature-row {
    grid-template-columns: 1fr;
  }

  .mobile-quickbar {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 115;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    padding: 7px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #d4e2ef;
    box-shadow: 0 12px 28px rgba(11, 37, 59, 0.18);
    backdrop-filter: blur(8px);
  }

  .mobile-quickbar a {
    min-width: 0;
    text-decoration: none;
    color: #29445b;
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 5px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 700;
  }

  .mobile-quickbar a:hover,
  .mobile-quickbar a.active {
    background: #edf7ff;
    border-color: #c8dff2;
    color: #0f5278;
  }

  .mobile-quickbar-ic {
    width: 18px;
    height: 18px;
    display: inline-flex;
  }

  .mobile-quickbar-ic svg {
    width: 18px !important;
    height: 18px !important;
  }
}

@media (max-width: 640px) {
  .topbar {
    padding: 12px;
  }

  .topbar h1 {
    font-size: 22px;
  }

  .head-chip {
    padding: 7px 5px;
  }

  .chip-count {
    min-width: 18px;
    padding: 3px 6px;
  }

  .header-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .user-main-row {
    justify-content: flex-start;
  }

  .mobile-quickbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .mobile-quickbar a span:last-child {
    display: none;
  }

  .kpi-value {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
