:root {
  --primary: #0d6efd;
  --secondary: #6c757d;
  --success: #198754;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #0dcaf0;
  --light: #f8f9fa;
  --dark: #212529;
  --surface: #ffffff;
  --muted: #6c757d;
  --border: #e9ecef;
  --radius: 16px;
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 10px 24px rgba(0, 0, 0, 0.10);
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--light);
  color: var(--dark);
  font-family: "Cairo", "Segoe UI", sans-serif;
  min-height: 100%;
  min-width: 100%;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

.app-topbar {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.app-shell {
  display: flex;
  min-height: calc(100vh - 72px);
}

.app-sidebar {
  width: 260px;
  background-color: var(--light);
  border-left: 1px solid var(--border);
  padding: 1.5rem 1rem;
}

.app-sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--dark);
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  transition: all 0.2s ease-in-out;
}

.app-sidebar .nav-link i {
  font-size: 1.1rem;
}

.app-sidebar .nav-link:hover,
.app-sidebar .nav-link.active {
  background-color: rgba(13, 110, 253, 0.1);
  color: var(--primary);
}

.app-sidebar-offcanvas {
  width: 260px;
}

.app-main {
  flex: 1;
  min-width: 0;
}

.app-topbar .navbar-brand {
  font-size: clamp(0.95rem, 2.4vw, 1.2rem);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
}

@media (min-width: 992px) {
  .app-card {
    padding: 1.25rem;
  }
}

.app-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.app-btn.btn {
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn {
  border-radius: var(--radius);
}

.app-table thead {
  background-color: var(--light);
}

.app-table tbody tr:hover {
  background-color: rgba(13, 110, 253, 0.05);
}

.badge-present {
  background-color: rgba(25, 135, 84, 0.15);
  color: var(--success);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-weight: 600;
}

.badge-absent {
  background-color: rgba(220, 53, 69, 0.15);
  color: var(--danger);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-weight: 600;
}

.page-title-row h1 {
  font-weight: 700;
}

.text-muted {
  color: var(--muted) !important;
}

.form-control,
.form-select,
.input-group-text {
  border-radius: var(--radius);
}

.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
  border-color: var(--primary);
}

.table-responsive {
  border-radius: var(--radius);
}

.table-responsive > .table {
  min-width: 680px;
}

.table-responsive td,
.table-responsive th {
  word-break: break-word;
}

.app-auth-body {
  background: linear-gradient(180deg, rgba(13, 110, 253, 0.08), rgba(248, 249, 250, 1));
}

.app-auth-card {
  width: 100%;
  height:100%;
}

.app-home-main {
  background-color: var(--light);
  min-height: calc(100vh - 72px);
}

.home-figure {
  border: 1px solid var(--border);
  background: var(--light);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 0.5rem;
}

.home-figure--portrait {
  width: clamp(84px, 22vw, 100px);
  height: clamp(102px, 28vw, 120px);
}

.home-figure--landscape {
  width: clamp(118px, 36vw, 140px);
  height: clamp(86px, 24vw, 100px);
}

.home-story-image {
  max-width: 280px;
  margin: 0 auto;
}

.app-preline {
  white-space: pre-line;
}

@media (max-width: 991.98px) {
  .app-topbar {
    padding: 0.75rem 1rem;
  }

  .app-sidebar-offcanvas {
    width: min(88vw, 320px);
  }

  .app-main > .container-fluid,
  .app-home-main {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .app-card {
    border-radius: 12px;
  }

  .app-card-header {
    align-items: flex-start;
  }

  .app-card-header > .btn,
  .app-card-header > a.btn {
    width: 100%;
    justify-content: center;
  }

  .app-card-header .btn {
    width: 100%;
    justify-content: center;
  }

  .app-topbar .dropdown-menu {
    max-width: min(92vw, 360px);
  }

  .table-responsive > .table {
    min-width: 560px;
  }

  .page-title-row h1 {
    font-size: 1.2rem;
  }

  .breadcrumb {
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
  }

  .breadcrumb-item {
    flex: 0 0 auto;
  }

  .app-table th,
  .app-table td {
    font-size: 0.9rem;
    padding: 0.55rem;
  }

  .app-topbar .navbar-brand {
    max-width: min(62vw, 260px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 767.98px) {
  .table-responsive {
    overflow: visible;
  }

  .table-responsive > .table.app-table-mobile-ready {
    min-width: 0;
  }

  .app-table-mobile-ready thead {
    display: none;
  }

  .app-table-mobile-ready,
  .app-table-mobile-ready tbody,
  .app-table-mobile-ready tr,
  .app-table-mobile-ready td {
    display: block;
    width: 100%;
  }

  .app-table-mobile-ready tbody tr {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 0.75rem;
    padding: 0.35rem 0.6rem;
    box-shadow: var(--shadow-sm);
  }

  .app-table-mobile-ready tbody tr:hover {
    background: var(--surface);
  }

  .app-table-mobile-ready tbody td {
    display: grid;
    grid-template-columns: minmax(92px, 42%) 1fr;
    gap: 0.5rem;
    align-items: start;
    border: 0 !important;
    border-bottom: 1px dashed var(--border);
    padding: 0.55rem 0.2rem !important;
    text-align: right !important;
  }

  .app-table-mobile-ready tbody td:last-child {
    border-bottom: 0;
  }

  .app-table-mobile-ready tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--muted);
  }

  .app-table-mobile-ready tbody td[data-label=""] {
    display: block;
    text-align: center !important;
  }

  .app-table-mobile-ready tbody td[data-label=""]::before {
    content: none;
  }

  .app-table-mobile-ready .d-flex {
    justify-content: flex-start !important;
  }

  .app-table-mobile-ready form {
    width: 100%;
  }

  .app-table-mobile-ready .btn {
    width: 100%;
    justify-content: center;
  }
}

@media print {
  .app-topbar,
  .app-sidebar,
  .app-sidebar-offcanvas,
  .app-btn,
  .btn,
  .dropdown,
  .offcanvas {
    display: none !important;
  }

  body {
    background-color: #ffffff;
  }
}
