@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --paper: #faf6f0;
  --paper-dark: #f2ebe0;
  --primary: #3b3e94;
  --primary-dark: #2c2f75;
  --accent: #c8975c;
  --accent-dark: #9f7340;
  --accent-bg: #f7ebd9;
  --ink: #1a1b3a;
  --ink-soft: #5a5d7a;
  --ink-faint: #9a9db5;
  --success: #5b8a6f;
  --success-bg: #e6f0ea;
  --danger: #b5544a;
  --danger-bg: #f7e8e5;
  --border: #e8dfd2;
  --surface: #ffffff;
  --sidebar: #1a1b3a;
  --radius: 10px;
  --sidebar-width: 248px;
  --topbar-height: 72px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6,
.page-heading,
.brand-name {
  font-family: 'Fraunces', serif;
}

a {
  color: var(--primary);
}

/* Application shell */
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 998;
  display: flex;
  width: var(--sidebar-width);
  height: 100vh;
  flex-direction: column;
  overflow: hidden;
  background: var(--sidebar);
  transition: transform .22s ease;
}

.app-brand {
  display: flex;
  min-height: 86px;
  align-items: center;
  gap: 11px;
  padding: 20px 22px 16px;
  color: #fff;
}

.app-brand:hover {
  background: transparent;
}

.app-brand > span:last-child {
  min-width: 0;
}

.app-brand-logo {
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  overflow: hidden;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(59, 62, 148, .3);
}

.app-brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-name {
  display: block;
  overflow: hidden;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-caption {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: rgba(255, 255, 255, .46);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-sidebar-menu {
  flex: 1;
  overflow-y: auto;
  padding: 0 14px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .15) transparent;
}

.app-nav-section {
  margin-top: 10px;
}

.app-nav-label {
  padding: 7px 14px;
  color: rgba(255, 255, 255, .34);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.app-nav-item {
  display: flex;
  min-height: 42px;
  align-items: center;
  gap: 12px;
  margin: 3px 0;
  padding: 10px 14px;
  border-radius: 10px;
  color: rgba(255, 255, 255, .66);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  transition: background .18s ease, color .18s ease;
}

.app-nav-item i {
  width: 18px;
  color: rgba(255, 255, 255, .52);
  font-size: 17px;
  text-align: center;
}

.app-nav-item:hover {
  background: rgba(255, 255, 255, .06);
  color: #fff;
}

.app-nav-item.active {
  background: rgba(59, 62, 148, .28);
  color: #fff;
  font-weight: 600;
}

.app-nav-item.active i {
  color: var(--accent);
}

.app-sidebar-footer {
  padding: 12px 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.app-nav-item.danger,
.app-nav-item.danger i {
  color: #d9857d;
}

.app-topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-width);
  z-index: 997;
  height: var(--topbar-height);
  border-bottom: 1px solid var(--border);
  background: rgba(250, 246, 240, .94);
  backdrop-filter: blur(12px);
  transition: left .22s ease;
}

.app-topbar-inner {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 28px;
}

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

.app-topbar-title {
  overflow: hidden;
}

.app-topbar-title strong {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-family: 'Fraunces', serif;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-topbar-date {
  display: block;
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 11px;
}

.app-user-menu {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
}

.app-user-menu:hover {
  color: var(--primary);
}

.app-user-avatar {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent-dark);
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-weight: 700;
}

.app-user-copy {
  max-width: 190px;
}

.app-user-name,
.app-user-role {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-user-name {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.app-user-role {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10.5px;
}

.app-mobile-trigger {
  display: none;
  color: var(--ink);
}

.app-sidebar-toggle {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.app-sidebar-toggle:hover,
.app-sidebar-toggle:focus {
  border-color: var(--primary);
  background: rgba(59, 62, 148, .06);
  color: var(--primary);
}

.content {
  width: auto;
  min-height: 100vh;
  margin: 0 0 0 var(--sidebar-width) !important;
  padding: calc(var(--topbar-height) + 26px) 28px 36px;
  transition: margin-left .22s ease;
}

html.sidebar-collapsed .app-sidebar {
  transform: translateX(-100%);
}

html.sidebar-collapsed .app-topbar {
  left: 0;
}

html.sidebar-collapsed .content {
  margin-left: 0 !important;
}

.content > .row:first-child,
.content > .underline:first-child {
  margin-bottom: 22px;
}

.content .title,
.content > .row:first-child .left {
  color: var(--ink);
  font-family: 'Fraunces', serif;
  font-size: 24px;
  font-weight: 600;
  text-transform: none;
}

.underline {
  border-bottom: 1px solid var(--border);
}

/* Existing component compatibility */
.card,
.card-panel,
.content-box,
.modal {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

.card-panel {
  padding: 20px;
}

.btn,
.btn-large,
.btn-small,
.btn-submit,
.btn-add,
.btn-cancel {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  box-shadow: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 40px;
  text-transform: none;
}

.btn-submit,
.btn-add {
  padding: 0 18px;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(59, 62, 148, .24);
}

.btn-submit:hover,
.btn-submit:focus,
.btn-add:hover,
.btn-add:focus {
  background: var(--primary-dark);
  color: #fff;
}

.btn-cancel {
  padding: 0 18px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink-soft);
}

.btn-cancel:hover,
.btn-cancel:focus {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent-dark);
}

.btn-floating {
  box-shadow: none;
}

.btn-floating:disabled {
  cursor: not-allowed;
  opacity: .55;
}

/* Attendance photo cards */
.attendance-card {
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(25, 26, 77, .05);
  color: var(--ink);
  font-weight: 700;
}

.attendance-photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  margin: 12px 0 14px;
  border-radius: 10px;
  background: transparent;
  object-fit: cover;
  object-position: center;
  image-orientation: from-image;
}

.attendance-photo-placeholder {
  object-fit: cover;
  opacity: .72;
}

.attendance-photo.active {
  width: auto;
  height: auto;
  aspect-ratio: auto;
  margin: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}

.attendance-page #materialbox-overlay {
  background: rgba(12, 13, 22, .96);
}

.attendance-card .btn-floating {
  width: 40px;
  height: 40px;
  line-height: 40px;
  box-shadow: none;
}

.attendance-card .btn-floating i {
  line-height: 40px;
}

.dashboard-attendance-photo {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  background: var(--paper-dark);
  object-fit: cover;
  object-position: center;
}

.dashboard-attendance-photo.active {
  width: auto;
  aspect-ratio: auto;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
}

/* Employee attendance dashboard */
.employee-attendance-section {
  max-width: 640px;
  margin: 22px 0 30px;
}

.employee-attendance-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.employee-attendance-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.employee-attendance-heading h2 {
  margin: 0;
  color: var(--ink);
  font-family: 'Libre Baskerville', serif;
  font-size: 22px;
  line-height: 1.35;
}

.employee-attendance-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}

.employee-attendance-status i {
  font-size: 7px;
}

.employee-attendance-status.is-approved {
  background: rgba(35, 133, 109, .1);
  color: var(--success);
}

.employee-attendance-status.is-pending,
.employee-attendance-status.is-flagged {
  background: rgba(193, 122, 34, .11);
  color: var(--warning);
}

.employee-attendance-status.is-rejected {
  background: rgba(198, 75, 75, .1);
  color: var(--danger);
}

.employee-attendance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.employee-attendance-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(25, 26, 77, .05);
}

.employee-attendance-card-head {
  display: flex;
  align-items: center;
  gap: 11px;
}

.employee-attendance-card-head > div:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.employee-attendance-card-head span {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.employee-attendance-card-head small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 11px;
}

.employee-attendance-icon {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}

.employee-attendance-icon.is-in {
  background: rgba(59, 62, 148, .09);
  color: var(--primary);
}

.employee-attendance-icon.is-out {
  background: rgba(213, 153, 97, .14);
  color: var(--accent-dark);
}

.employee-attendance-card .dashboard-attendance-photo {
  margin: 16px 0;
}

.employee-attendance-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid var(--border);
}

.employee-attendance-meta span {
  color: var(--ink-faint);
  font-size: 12px;
}

.employee-attendance-meta i {
  margin-right: 4px;
  color: var(--accent-dark);
}

.employee-attendance-meta strong {
  color: var(--ink);
  font-size: 15px;
}

.employee-attendance-empty {
  display: flex;
  min-height: 220px;
  flex: 1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin: 16px 0;
  padding: 24px;
  border: 1px dashed #d8d2ca;
  border-radius: 10px;
  background: var(--paper);
  text-align: center;
}

.employee-attendance-empty > i {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 28px;
}

.employee-attendance-empty strong {
  color: var(--ink);
  font-size: 14px;
}

.employee-attendance-empty span {
  max-width: 190px;
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 12px;
  line-height: 1.5;
}

.employee-attendance-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.employee-attendance-action:hover,
.employee-attendance-action:focus {
  background: var(--primary-dark);
  color: #fff;
}

.employee-attendance-action:disabled {
  background: #ebe8e3;
  color: var(--ink-faint);
  cursor: not-allowed;
}

/* Attendance camera keeps live and captured frames at one portrait ratio. */
.attendance-camera-column {
  max-width: 430px;
}

#my_camera {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 12px;
  background: #171821;
}

#my_camera video,
#my_camera canvas,
#my_camera .attendance-camera-preview {
  display: block;
  width: 100% !important;
  height: 100% !important;
  border-radius: inherit;
  object-fit: cover;
}

input:not([type]),
input[type=text]:not(.browser-default),
input[type=password]:not(.browser-default),
input[type=email]:not(.browser-default),
input[type=tel]:not(.browser-default),
input[type=number]:not(.browser-default),
textarea.materialize-textarea,
select.browser-default,
.select2-container .select2-selection--single {
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  box-shadow: none;
}

input:not([type]):focus:not([readonly]),
input[type=text]:not(.browser-default):focus:not([readonly]),
input[type=password]:not(.browser-default):focus:not([readonly]),
input[type=email]:not(.browser-default):focus:not([readonly]),
input[type=tel]:not(.browser-default):focus:not([readonly]),
input[type=number]:not(.browser-default):focus:not([readonly]),
textarea.materialize-textarea:focus:not([readonly]) {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 62, 148, .1);
}

.input-field > label {
  color: var(--ink-soft);
}

.input-field input:focus + label,
.input-field textarea:focus + label {
  color: var(--primary) !important;
}

table,
.dataTables_wrapper {
  color: var(--ink);
}

table.striped > tbody > tr:nth-child(odd) {
  background: rgba(242, 235, 224, .45);
}

table th {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .35px;
  text-transform: uppercase;
}

table td {
  border-radius: 0;
  color: var(--ink);
  font-size: 13px;
}

/* PresenZ-style data pages */
.page-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.page-eyebrow {
  margin-bottom: 5px;
  color: var(--accent-dark);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
}

.page-intro h1 {
  margin: 0;
  color: var(--ink);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
}

.page-intro p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.55;
}

.page-primary-action {
  display: inline-flex;
  min-width: max-content;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.table-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.table-stat-card {
  padding: 15px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.table-stat-label {
  display: block;
  color: var(--primary);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .45px;
  text-transform: uppercase;
}

.table-stat-card.success .table-stat-label {
  color: var(--success);
}

.table-stat-card.muted .table-stat-label {
  color: var(--ink-faint);
}

.table-stat-card strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

.presenz-table-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.presenz-table-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.presenz-table-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
}

.presenz-table-heading p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11.5px;
}

.table-count {
  display: inline-flex;
  min-width: max-content;
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--accent-bg);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
}

.presenz-table-scroll {
  width: 100%;
  overflow-x: auto;
}

table.presenz-table,
table.dataTable.presenz-table {
  width: 100% !important;
  margin: 0 !important;
  border: 0;
  border-collapse: collapse;
  border-spacing: 0;
}

table.presenz-table th,
table.presenz-table td,
table.dataTable.presenz-table th,
table.dataTable.presenz-table td {
  box-sizing: border-box;
}

table.presenz-table thead,
table.dataTable.presenz-table thead {
  background: var(--paper-dark);
}

table.presenz-table thead th,
table.dataTable.presenz-table thead th {
  padding: 12px 15px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background-color: transparent;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  white-space: nowrap;
}

table.presenz-table tbody tr,
table.dataTable.presenz-table tbody tr,
table.dataTable.presenz-table tbody tr.odd,
table.dataTable.presenz-table tbody tr.even {
  border-bottom: 1px solid var(--border);
  background: #fff;
  transition: background .16s ease;
}

table.presenz-table tbody tr:nth-child(even),
table.dataTable.presenz-table tbody tr:nth-child(even) {
  background: rgba(250, 246, 240, .3);
}

table.presenz-table tbody tr:hover,
table.dataTable.presenz-table tbody tr:hover,
table.dataTable.presenz-table tbody tr.odd:hover,
table.dataTable.presenz-table tbody tr.even:hover {
  background: rgba(59, 62, 148, .045);
}

table.presenz-table tbody tr:last-child {
  border-bottom: 0;
}

table.presenz-table tbody td,
table.dataTable.presenz-table tbody td {
  padding: 12px 15px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12.5px;
  vertical-align: middle;
}

.table-number {
  width: 58px;
  color: var(--ink-faint) !important;
  text-align: center;
}

.table-user {
  display: flex;
  min-width: 180px;
  align-items: center;
  gap: 11px;
}

.table-avatar {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent-dark);
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-weight: 700;
}

.table-user-copy {
  min-width: 0;
}

.table-user-copy strong,
.table-user-copy span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-user-copy strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.table-user-copy span {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10.5px;
}

.table-phone,
.table-currency {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-role-badge,
.table-status {
  display: inline-flex;
  min-width: max-content;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 700;
}

.table-role-badge {
  background: rgba(59, 62, 148, .09);
  color: var(--primary);
}

.table-status.active {
  background: var(--success-bg);
  color: var(--success);
}

.table-status.inactive {
  background: var(--paper-dark);
  color: var(--ink-soft);
}

.table-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.table-actions-column {
  min-width: 132px;
}

.table-actions {
  min-width: 132px;
  white-space: nowrap;
}

.table-action {
  display: inline-flex;
  width: 31px;
  height: 31px;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}

.table-action:hover,
.table-action:focus {
  border-color: var(--primary);
  background: rgba(59, 62, 148, .06);
  color: var(--primary);
}

.table-action.success:hover,
.table-action.success:focus {
  border-color: var(--success);
  background: var(--success-bg);
  color: var(--success);
}

.table-action.warning:hover,
.table-action.warning:focus {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent-dark);
}

.table-action.danger:hover,
.table-action.danger:focus {
  border-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
}

.presenz-table-card .dataTables_wrapper {
  padding-bottom: 14px;
}

.presenz-table-card .dataTables_wrapper .dataTables_filter {
  float: none;
  padding: 14px 18px;
  text-align: right;
}

.presenz-table-card .dataTables_wrapper .dataTables_filter label {
  color: transparent;
  font-size: 0;
}

.presenz-table-card .dataTables_wrapper .dataTables_filter input {
  width: min(260px, 100%);
  height: 38px;
  margin: 0;
  padding: 0 13px 0 36px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  background-color: var(--paper);
  background-image: linear-gradient(transparent, transparent);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
}

.presenz-table-card .dataTables_wrapper .dataTables_filter input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 62, 148, .1);
}

.presenz-table-card .dataTables_wrapper .dataTables_info {
  padding: 16px 18px 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.presenz-table-card .dataTables_wrapper .dataTables_paginate {
  padding: 11px 18px 0;
}

.presenz-table-card .dataTables_wrapper .dataTables_paginate .paginate_button {
  min-width: 32px;
  height: 32px;
  margin-left: 4px;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-soft) !important;
  font-size: 11px;
  line-height: 16px;
}

.presenz-table-card .dataTables_wrapper .dataTables_paginate .paginate_button.current,
.presenz-table-card .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff !important;
}

.presenz-table-card .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  border-color: var(--primary);
  background: rgba(59, 62, 148, .07);
  color: var(--primary) !important;
}

.presenz-table-card table.dataTable.no-footer {
  border-bottom: 1px solid var(--border);
}

.modal {
  overflow: hidden;
}

.modal-overlay {
  background: rgba(26, 27, 58, .55);
}

.toast {
  border-radius: 10px;
  background: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
}

/* Mobile drawer */
.app-mobile-nav {
  top: 0;
  z-index: 1002;
  width: min(300px, 86vw);
  height: 100vh;
  height: 100dvh;
  padding-bottom: 12px;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--sidebar);
  color: #fff;
}

.app-mobile-nav li {
  line-height: normal;
}

.app-mobile-nav li > a.app-brand {
  display: flex;
  width: 100%;
  min-height: 82px;
  height: 82px;
  align-items: center;
  gap: 11px;
  padding: 16px 18px;
  line-height: normal;
}

.app-mobile-nav .app-brand-logo {
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.app-mobile-nav .app-brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
}

.app-mobile-nav li > a.app-nav-item {
  display: flex;
  height: auto;
  min-height: 42px;
  align-items: center;
  margin: 3px 14px;
  padding: 10px 14px;
  color: rgba(255, 255, 255, .68);
  line-height: 1.35;
}

.app-mobile-nav li > a.app-nav-item > i {
  margin: 0;
  color: inherit;
}

.app-mobile-nav .app-nav-label {
  padding: 13px 28px 5px;
}

.sidenav-overlay {
  z-index: 1001;
  background: rgba(26, 27, 58, .56);
}

/* Login */
body.auth-page {
  display: block;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--paper);
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, .95fr) minmax(500px, 1.05fr);
}

.auth-brand-panel {
  position: relative;
  display: flex;
  min-height: 100vh;
  align-items: center;
  overflow: hidden;
  padding: 72px;
  background: var(--sidebar);
  color: #fff;
}

.auth-brand-panel::before,
.auth-brand-panel::after {
  position: absolute;
  border: 2px solid rgba(200, 151, 92, .2);
  border-radius: 50%;
  content: '';
}

.auth-brand-panel::before {
  top: -160px;
  left: -190px;
  width: 520px;
  height: 520px;
}

.auth-brand-panel::after {
  right: -180px;
  bottom: -230px;
  width: 560px;
  height: 560px;
}

.auth-brand-content {
  position: relative;
  z-index: 1;
  max-width: 500px;
}

.auth-logo-wrap {
  width: 82px;
  height: 82px;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .18);
}

.auth-logo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-brand-content h1 {
  margin: 30px 0 12px;
  color: #fff;
  font-size: clamp(34px, 4vw, 54px);
  font-weight: 600;
  line-height: 1.08;
}

.auth-brand-content p {
  max-width: 430px;
  margin: 0;
  color: rgba(255, 255, 255, .6);
  font-size: 15px;
  line-height: 1.75;
}

.auth-node-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 34px;
  color: rgba(255, 255, 255, .42);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.auth-node-line::before {
  width: 38px;
  height: 2px;
  background: var(--accent);
  content: '';
}

.auth-form-panel {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 48px;
}

.auth-card {
  width: 100%;
  min-width: 0;
  max-width: 420px;
  padding: 42px 40px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(26, 27, 58, .08);
}

.auth-mobile-logo {
  display: none;
}

.auth-eyebrow {
  margin-bottom: 8px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.auth-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 29px;
  font-weight: 600;
}

.auth-subtitle {
  margin: 8px 0 30px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

.auth-field {
  margin-bottom: 20px;
}

.auth-field label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.auth-input-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
}

.auth-input-wrap i {
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 1;
  color: var(--ink-faint);
  font-size: 15px;
  transform: translateY(-50%);
}

.auth-input-wrap input[type=text],
.auth-input-wrap input[type=password] {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: 46px;
  margin: 0;
  padding: 0 14px 0 42px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}

.auth-input-wrap input[type=text]:focus,
.auth-input-wrap input[type=password]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 62, 148, .1);
}

.auth-submit {
  width: 100%;
  height: 46px;
  margin-top: 6px;
  border: 0;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(59, 62, 148, .28);
  transition: background .18s ease, transform .18s ease;
}

.auth-submit:hover,
.auth-submit:focus {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.auth-submit:disabled {
  cursor: wait;
  opacity: .65;
  transform: none;
}

.auth-footer {
  margin-top: 24px;
  color: var(--ink-faint);
  font-size: 11px;
  text-align: center;
}

@media only screen and (max-width: 992px) {
  .app-sidebar {
    display: none;
  }

  .app-topbar {
    left: 0;
  }

  .app-mobile-trigger {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
  }

  .app-sidebar-toggle {
    display: none;
  }

  .app-topbar-inner {
    padding: 0 18px;
  }

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

  .content {
    margin-left: 0 !important;
    padding: calc(var(--topbar-height) + 20px) 18px 28px;
  }

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

  .auth-brand-panel {
    display: none;
  }

  .auth-form-panel {
    padding: 28px 20px;
  }

  .auth-mobile-logo {
    display: block;
    width: 64px;
    height: 64px;
    margin-bottom: 22px;
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(59, 62, 148, .14);
  }

  .auth-mobile-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }
}

@media only screen and (max-width: 600px) {
  :root {
    --topbar-height: 64px;
  }

  .app-topbar-date,
  .app-user-copy {
    display: none;
  }

  .app-topbar-title strong {
    font-size: 17px;
  }

  .content {
    padding-right: 14px;
    padding-left: 14px;
  }

  .content .title,
  .content > .row:first-child .left {
    font-size: 21px;
  }

  .employee-attendance-section {
    max-width: none;
    margin-top: 18px;
  }

  .employee-attendance-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .employee-attendance-heading h2 {
    font-size: 19px;
  }

  .employee-attendance-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .employee-attendance-card {
    padding: 16px;
  }

  .employee-attendance-empty {
    min-height: 180px;
  }

  .page-intro {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .page-intro h1 {
    font-size: 24px;
  }

  .page-primary-action {
    width: 100%;
  }

  .table-stats {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .table-stat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
  }

  .table-stat-card strong {
    margin: 0;
    font-size: 22px;
  }

  .presenz-table-heading {
    align-items: flex-start;
    padding: 16px;
  }

  .presenz-table-heading p {
    display: none;
  }

  .presenz-table-card .dataTables_wrapper .dataTables_filter {
    padding: 12px;
  }

  .presenz-table-card .dataTables_wrapper .dataTables_filter input {
    width: 100%;
  }

  table.presenz-table thead,
  table.dataTable.presenz-table thead {
    display: none;
  }

  table.presenz-table,
  table.presenz-table tbody,
  table.presenz-table tr,
  table.presenz-table td,
  table.dataTable.presenz-table,
  table.dataTable.presenz-table tbody,
  table.dataTable.presenz-table tr,
  table.dataTable.presenz-table td {
    display: block;
    width: 100% !important;
  }

  table.presenz-table tbody,
  table.dataTable.presenz-table tbody {
    padding: 0 12px 2px;
  }

  table.presenz-table tbody tr,
  table.dataTable.presenz-table tbody tr,
  table.dataTable.presenz-table tbody tr.odd,
  table.dataTable.presenz-table tbody tr.even {
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
  }

  table.presenz-table tbody td,
  table.dataTable.presenz-table tbody td {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: right !important;
  }

  table.presenz-table tbody td:last-child,
  table.dataTable.presenz-table tbody td:last-child {
    border-bottom: 0;
  }

  table.presenz-table tbody td::before,
  table.dataTable.presenz-table tbody td::before {
    color: var(--ink-faint);
    content: attr(data-label);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .4px;
    text-align: left;
    text-transform: uppercase;
  }

  table.presenz-table .table-number,
  table.dataTable.presenz-table .table-number {
    display: none;
  }

  table.presenz-table td[data-label='User'],
  table.dataTable.presenz-table td[data-label='User'] {
    justify-content: flex-start;
    text-align: left !important;
  }

  table.presenz-table td[data-label='User']::before,
  table.dataTable.presenz-table td[data-label='User']::before {
    display: none;
  }

  .table-actions {
    justify-content: flex-end !important;
  }

  .presenz-table-card .dataTables_wrapper .dataTables_info,
  .presenz-table-card .dataTables_wrapper .dataTables_paginate {
    float: none;
    padding-right: 12px;
    padding-left: 12px;
    text-align: center;
  }

  .auth-form-panel {
    align-items: flex-start;
    padding: 32px 16px;
  }

  .auth-card {
    width: calc(100vw - 32px);
    max-width: none;
    padding: 30px 24px;
    border-radius: 18px;
  }

  .auth-card h2 {
    font-size: 26px;
  }

  .auth-input-wrap input[type=text],
  .auth-input-wrap input[type=password] {
    max-width: 100%;
  }
}
