/* CoreStruct global style */

:root{
  --brand:#0a1f33;        
  --bg:rgba(251, 253, 252);
  --text:#0f172a;
  --muted:#6b7280;
  --border:#e5e7eb;
  --white:#ffffff;
}

*{box-sizing:border-box}
html,body{
  margin:0;
  padding:0;
  background:var(--bg);
  color:var(--text);
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  min-height:100%;
  overflow-x:hidden;
}

.header{
  background:var(--white);
  border-bottom:1px solid var(--border);
  padding:14px 18px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.brand{
  font-weight:800;
  letter-spacing:.2px;
}

.brand .logoDot{
  color:var(--brand);
}

.nav a{
  color:var(--text);
  text-decoration:none;
  margin-right:14px;
  font-weight:600;
}

.nav a:hover{
  color:var(--brand);
}

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

.card{
  background:var(--white);
  border:1px solid var(--border);
  border-radius:12px;
  padding:16px;
}

h1{
  margin:0 0 10px 0;
  font-size:22px;
}

.table{
  width:100%;
  border-collapse:collapse;
  overflow:hidden;
  border-radius:10px;
}

/* allow flexible column sizing and wrapping for responsiveness */
.table { table-layout: auto; }
.table th, .table td { white-space: normal; word-break: normal; overflow-wrap: anywhere; }

/* clickable name cell */
.table td.clickable { cursor: pointer; }
.table td.clickable a.emp-link { color: inherit; text-decoration: none; display:block; padding:4px 0; }

/* icon-sized buttons */
.btn.sm { width:36px; padding:0; display:inline-flex; align-items:center; justify-content:center; }
.btn.sm a, .btn.sm span { line-height:1 }

.table th,
.table td{
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  text-align:left;
}

.table th{
  background:#f8fafc;
  font-weight:800;
  color:#334155;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:38px;
  padding:0 14px;
  border-radius:8px;
  border:1px solid var(--border);
  background:var(--white);
  cursor:pointer;
  font-weight:700;
}

.btn.primary{
  background:var(--brand);
  color:#fff;
  border:none;
}

.btn.danger{
  background:#ef4444;
  color:#fff;
  border:none;
}

.btn.danger:hover{
  background:#dc2626;
}

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

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

.col-12{grid-column:span 12}
.col-9{grid-column:span 9}
.col-6{grid-column:span 6}
.col-4{grid-column:span 4}
.col-3{grid-column:span 3}

@media(max-width:900px){
  .col-9,.col-6,.col-4,.col-3{grid-column:span 12}
}

/* Avatar preview removed — previews disabled (file still uploads). */

.field{
  display:flex;
  flex-direction:column;
}

.label{
  font-size:12px;
  color:var(--muted);
  margin-bottom:6px;
  font-weight:700;
}

.input,
.select,
.textarea{
  height:40px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  font-size:14px;
  appearance:none;
}

.textarea{
  height:auto;
  min-height:90px;
  resize:vertical;
}

.help{
  font-size:12px;
  color:var(--muted);
  margin-top:4px;
}

.error{
  color:#dc2626;
}

.footerNote{
  margin-top:12px;
  color:var(--muted);
  font-size:12px;
}

/* ==== CoreStruct Sidebar Layout ==== */
.layout{
  display:flex; min-height:100vh; min-height:100dvh;
}

/* Sidebar */
.sidebar{
  width:220px; flex:0 0 220px;
  position:fixed;
  left:0;
  top:0;
  height:100vh;
  height:100dvh;
  background:linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color:#e5e7eb;
  display:flex; flex-direction:column; gap:10px;
  transition:width .15s ease;
  box-shadow:2px 0 12px rgba(0,0,0,0.3);
  z-index:20;
}

.sidebar .brand{
  font-weight:800; letter-spacing:.2px; padding:16px 16px; 
  border-bottom:2px solid rgba(96,165,250,0.2);
  display:flex; align-items:center; gap:8px;
}

/* Menu Toggle Button - minimal design at top edge */
.sidebar .menu-toggle {
  position: absolute;
  right: -12px;
  top: 16px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(96, 165, 250, 0.15);
  border-radius: 50%;
  cursor: pointer;
  color: #64748b;
  transition: all 0.15s ease;
  z-index: 21;
  box-shadow: 1px 0 4px rgba(0, 0, 0, 0.2);
}

.sidebar .menu-toggle:hover {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.35);
}

.sidebar .menu-toggle:active {
  transform: scale(0.96);
}

.sidebar .menu-toggle svg {
  transition: transform 0.2s ease;
}

.sidebar.collapsed .menu-toggle svg {
  transform: rotate(180deg);
}

.sidebar .brand img{ width:28px; height:28px; }
.sidebar .brand-text{ font-size:14px; }
.sidebar .brand .logoDot{ color:#60a5fa; font-weight:900; } /* lighter blue accent */

.sidebar nav{ 
  padding:12px 8px; display:flex; flex-direction:column; gap:6px; 
  flex:1; overflow-y:auto;
}
.sidebar-nav-bottom{
  padding:8px;
  border-top:1px solid rgba(255,255,255,0.08);
}
.sidebar a{
  color:#cbd5e1; text-decoration:none; font-weight:600; font-size:14px;
  padding:10px 12px; border-radius:8px; display:flex; gap:10px; align-items:center;
  transition:all .2s ease;
  border-left:3px solid transparent;
  position:relative;
}
.sidebar a:hover{ 
  background:rgba(96,165,250,0.1);
  color:#60a5fa;
  padding-left:16px;
}
.sidebar a.active{ 
  background:rgba(96,165,250,0.2);
  border-left-color:#60a5fa;
  color:#93c5fd;
}
.sidebar a .icon{ 
  font-size:18px; width:24px; height:24px; display:flex; align-items:center; justify-content:center;
  transition:transform .2s ease;
}
.sidebar a:hover .icon{ transform:scale(1.1); }

/* Sidebar user area */
.sidebar-user{
  margin-top:auto;
  padding:12px 12px 16px;
  border-top:1px solid rgba(255,255,255,0.08);
  background:linear-gradient(180deg, rgba(15,23,42,0.15), rgba(15,23,42,0));
}
.sidebar-user-card{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px;
  border-radius:12px;
  background:rgba(255,255,255,0.04);
  border:1px solid rgba(255,255,255,0.06);
}
.sidebar-user-avatar{
  width:36px;
  height:36px;
  border-radius:10px;
  background:linear-gradient(135deg, rgba(96,165,250,0.25), rgba(37,99,235,0.25));
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:16px;
}
.sidebar-user-text{
  min-width:0;
}
.sidebar-user-name{
  font-size:13px;
  font-weight:700;
  color:#e2e8f0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.sidebar-user-role{
  font-size:11px;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:#93c5fd;
}
.sidebar-logout{
  margin-top:10px;
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:9px 12px;
  border-radius:10px;
  border:1px solid rgba(96,165,250,0.35);
  background:rgba(96,165,250,0.18);
  color:#e2e8f0;
  font-weight:700;
  cursor:pointer;
  transition:background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.sidebar-logout:hover{
  background:rgba(96,165,250,0.3);
  box-shadow:0 6px 18px rgba(15,23,42,0.35);
  transform:translateY(-1px);
}
.sidebar-logout:active{
  transform:translateY(0);
}
.sidebar.collapsed .sidebar-user-text{
  display:none;
}
.sidebar.collapsed .sidebar-logout{
  justify-content:center;
}

/* Sidebar polish: smooth animations and responsive behavior */
.sidebar nav { animation: slideInLeft 0.3s ease-out; }
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Main area */
.main{
  flex:1; display:flex; flex-direction:column; gap:12px;
  margin-left:220px;
  min-width:0;
  padding: 0 24px 24px;
  transition:margin-left .15s ease;
}
.sidebar.collapsed{ width:72px; flex-basis:72px; }
.sidebar.collapsed .brand{ justify-content:center; padding:16px 8px; }
.sidebar.collapsed .brand-text,
.sidebar.collapsed .text{ display:none; }
.sidebar.collapsed nav a{ justify-content:center; padding:10px 6px; }
.sidebar.collapsed nav a:hover{ padding-left:6px; }
.sidebar.collapsed ~ .main{ margin-left:72px; }
.topbar{
  background:var(--white); border-bottom:1px solid var(--border);
  padding:16px; display:flex; align-items:center; justify-content:space-between; gap:16px;
  height: 62px; box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.topbar > div:last-child {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}
#topbarActions,
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  min-height: 44px;
}
#userDisplay {
  display: flex;
  align-items: center;
}
/* back button in topbar (consistent placement) */
.topbar .back-btn { margin-left:8px; }
.content{ max-width:none; width:100%; margin:0; padding:16px; }
.content > *{ min-width:0; }

.mobile-menu-toggle{
  display:none;
  position:fixed;
  top:14px;
  left:14px;
  z-index:31;
  width:44px;
  height:44px;
  padding:0;
  border:none;
  border-radius:12px;
  background:#0f172a;
  box-shadow:0 10px 24px rgba(15,23,42,0.28);
  align-items:center;
  justify-content:center;
  gap:4px;
  flex-direction:column;
  cursor:pointer;
}

.mobile-menu-toggle span{
  width:18px;
  height:2px;
  border-radius:999px;
  background:#f8fafc;
}

.sidebar-backdrop{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(2, 6, 23, 0.45);
  z-index:25;
}

/* Tables/cards reuse your existing .card, .table etc. */

/* Mobile */
@media (max-width: 900px){
  .sidebar{ position:fixed; z-index:30; height:100vh; height:100dvh; left:0; top:0; transform:translateX(-100%); }
  .sidebar.open{ transform:translateX(0); }
  .sidebar .menu-toggle{ display:none; }
  .main{ margin-left:0; }
  .sidebar.collapsed ~ .main{ margin-left:0; }
  .main{ padding:0 14px 20px; }
  .topbar{
    min-height:62px;
    height:auto;
    padding:14px 14px 14px 66px;
    align-items:flex-start;
    flex-wrap:wrap;
  }
  .topbar > div:last-child{
    width:100%;
    justify-content:flex-start;
    margin-left:0;
  }
  #topbarActions,
  .topbar-actions{
    width:100%;
    justify-content:flex-start;
    margin-left:0;
  }
  .content{ padding:14px 0; }
  .mobile-menu-toggle{ display:flex; }
  .sidebar-backdrop[hidden]{ display:none; }
  .sidebar-backdrop:not([hidden]){ display:block; }
  body.sidebar-open{ overflow:hidden; }
}

/* Utility */
.icon{width:20px; display:inline-flex; justify-content:center;}
.text{white-space:nowrap;}

/* ===== Toolbar (below header) ===== */
.toolbar {
  display:flex; gap:10px; align-items:center; flex-wrap:wrap;
  margin: 0 0 10px 0;
}
.toolbar .input, .toolbar .select { height:36px; }

/* Search input with icon */
.search-wrap { position:relative; }
.search-wrap .search-icon {
  position:absolute; left:10px; top:50%; transform:translateY(-50%);
  color:#64748b; font-size:14px;
}
.search-wrap .input { padding-left:30px; }

/* ===== Table responsiveness ===== */
.table-wrap { width:100%; overflow:auto; border-radius:10px; }
.table-wrap, .card { -webkit-overflow-scrolling:touch; }
.table-wrap .table { min-width: 680px; }
@media (max-width: 640px){
  .table th:nth-child(3), .table td:nth-child(3), /* Gender */
  .table th:nth-child(5), .table td:nth-child(5), /* Position */
  .table th:nth-child(7), .table td:nth-child(7)  /* Status */
  { display:none; }
}

/* ===== Modal (View Employee) ===== */
.modal-backdrop {
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.35);
  z-index:50;
  padding:16px;
  overflow-y:auto;
}
.modal {
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  max-width:720px;
  width:min(100%, 980px);
  margin:auto;
  padding:16px;
  max-height:calc(100dvh - 32px);
  overflow:auto;
}
.modal-head { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.modal-head h2 { margin:0; line-height:1.25; overflow-wrap:anywhere; }
.modal-actions { display:flex; gap:8px; justify-content:flex-end; margin-top:14px; flex-wrap:wrap; }
.modal-actions .btn,
.modal-actions a.btn { min-width:120px; }

@media (max-width: 700px){
  .modal-backdrop { padding:10px; }
  .modal { width:100%; padding:14px; border-radius:10px; max-height:calc(100dvh - 20px); }
  .modal-head { align-items:flex-start; }
  .modal-actions { justify-content:stretch; }
  .modal-actions .btn,
  .modal-actions a.btn {
    width:100%;
    min-width:0;
    flex:1 1 100%;
  }
}

/* ===== Toast ===== */
.toast-wrap {
  position:fixed; right:16px; bottom:16px; z-index:60; display:flex; flex-direction:column; gap:8px;
}
.toast {
  background:#0f2b46; color:#fff; padding:10px 12px; border-radius:10px;
  box-shadow:0 8px 20px rgba(2,6,23,.15);
  display:flex; align-items:center; gap:8px; min-width:220px;
}
.toast.success { background:#10b981; }  /* green */
.toast.error   { background:#ef4444; }  /* red */

/* ===== Sidebar brand with logo (keep logo when collapsed) ===== */
.brand { display:flex; align-items:center; gap:8px; }
.brand-logo { height:28px; width:auto; }
.brand-text { font-weight:800; letter-spacing:.2px; }
.sidebar.collapsed .brand-text { display:none; }  /* collapse text only */

/* ===== Dashboard KPI cards ===== */
.kpi-grid { display:grid; gap:12px; grid-template-columns:repeat(12,1fr); }
.kpi { background:#fff; border:1px solid var(--border); border-radius:12px; padding:14px; }
.kpi .label { font-size:12px; color:var(--muted); }
.kpi .value { font-size:24px; font-weight:800; margin-top:4px; }
.kpi .sub { font-size:12px; color:#64748b; margin-top:2px; }

/* 4-up on desktop, 1-up on mobile */
.kpi-col-3 { grid-column: span 3; }
@media (max-width: 900px){ .kpi-col-3 { grid-column: span 12; } }

/* ===== Section headers ===== */
.section-head { display:flex; justify-content:space-between; align-items:center; margin:14px 0 8px; }
.section-head h2 { margin:0; font-size:18px; }
.section-actions { display:flex; gap:8px; }

/* ===== Chips (status) ===== */
.chip { display:inline-flex; align-items:center; justify-content:center; height:26px; padding:0 12px; border-radius:999px; font-size:12px; font-weight:700; white-space:nowrap; }
.chip.green { background:#dcfce7; color:#166534; border:1px solid #86efac; }
.chip.gray { background:#f3f4f6; color:#374151; border:1px solid #d1d5db; }
.chip.amber { background:#fef3c7; color:#92400e; border:1px solid #fcd34d; }
.chip.red { background:#fee2e2; color:#991b1b; border:1px solid #fca5a5; }

/* ===== Table wrap (already present but ensure) ===== */
.table-wrap { width:100%; overflow:auto; border-radius:10px; }

/* ===== Sticky table header (for scrollable tables) ===== */
.sticky-table{border-collapse:separate;border-spacing:0;overflow:visible}
.sticky-table thead th{position:sticky;top:0;z-index:2;background:#f8fafc;box-shadow:0 1px 0 #e5e7eb}
.table-scroll{max-height:60vh;overflow-y:auto;border:1px solid #e5e7eb;border-radius:10px}
/* Pagination bar */
.pg-bar{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;font-size:13px;color:#334155;border-top:1px solid #e5e7eb;background:#fafafa;flex-shrink:0;gap:12px;flex-wrap:wrap}
.pg-info{font-size:13px;color:#64748b}
.pg-buttons{display:flex;gap:4px}
.pg-buttons button{min-width:32px;height:32px;padding:0 8px;border:1px solid #e5e7eb;border-radius:6px;background:#fff;cursor:pointer;font-weight:600;font-size:13px}
.pg-buttons button:hover:not(:disabled){background:#f1f5f9}
.pg-buttons button.active{background:#0a1f33;color:#fff;border-color:#0a1f33}
.pg-buttons button:disabled{opacity:.4;cursor:not-allowed}
.pg-size{height:30px;border:1px solid #e5e7eb;border-radius:6px;padding:0 6px;font-size:13px}

/* ===== Toolbar link style (remove underline for buttons/links) ===== */
a.btn, a.btn:link, a.btn:visited, a.btn:hover, a.btn:focus { text-decoration: none; }

/* ===== Notification Center ===== */
.notification-center {
  position: fixed;
  top: 70px !important;
  right: 20px !important;
  z-index: 9999 !important;
  display: flex !important;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  pointer-events: auto;
  left: auto !important;
  bottom: auto !important;
}

/* Notification Bell Button */
.notification-bell-btn {
  position: relative;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 20px;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
  min-width: 44px;
  height: 44px;
  flex: 0 0 auto;
  line-height: 1;
}

.notification-bell-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.bell-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #dc2626;
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}

.notification {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--white);
  border-left: 4px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.3s ease-out;
  max-height: 120px;
  overflow: hidden;
}

.notification-dismissing {
  animation: slideOut 0.3s ease-out forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

.notification-icon {
  font-size: 24px;
  flex-shrink: 0;
  min-width: 32px;
  text-align: center;
}

.notification-content {
  flex: 1;
  min-width: 0;
}

.notification-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
  word-break: break-word;
}

.notification-message {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
  word-break: break-word;
}

.notification-link {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notification-link a {
  color: var(--brand);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.notification-link a:hover {
  text-decoration: underline;
}

.notification-action-btn {
  border: 1px solid var(--brand);
  background: var(--white);
  color: var(--brand);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  cursor: pointer;
}

.notification-action-btn:hover {
  background: color-mix(in srgb, var(--brand) 8%, #ffffff);
}

.notification-persistent {
  max-height: none;
}

.notification-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  min-width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s;
}

.notification-close:hover {
  color: var(--text);
}

/* Notification Type Variants */
.notification-absent {
  border-left-color: #dc2626;
  background: #fef2f2;
}

.notification-absent .notification-title {
  color: #7f1d1d;
}

.notification-late {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.notification-late .notification-title {
  color: #78350f;
}

.notification-undertime {
  border-left-color: #3b82f6;
  background: #eff6ff;
}

.notification-undertime .notification-title {
  color: #1e3a8a;
}

.notification-warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.notification-warning .notification-title {
  color: #92400e;
}

.notification-success {
  border-left-color: #10b981;
  background: #f0fdf4;
}

.notification-success .notification-title {
  color: #166534;
}

.notification-error {
  border-left-color: #ef4444;
  background: #fef2f2;
}

.notification-error .notification-title {
  color: #7f1d1d;
}

.notification-info {
  border-left-color: #3b82f6;
  background: #eff6ff;
}

.notification-info .notification-title {
  color: #1e3a8a;
}

/* Responsive */
@media (max-width: 640px) {
  .notification-center {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .notification {
    max-height: none;
  }
}

/* ===== Notification Log Panel ===== */
.notification-log-panel {
  position: fixed;
  top: 70px;
  right: 20px;
  width: min(520px, calc(100vw - 40px));
  max-height: min(72vh, 720px);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
  z-index: 9998;
  display: none;
  flex-direction: column;
  transform: translateY(-14px);
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  overflow: hidden;
}

.notification-log-panel.panel-open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.notification-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 14px 12px 16px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.98));
  gap: 12px;
}

.notification-log-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: .01em;
}

.notification-log-header > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.notification-log-clear {
  height: 32px;
  padding: 0 12px;
  border: 1px solid #d1d9e6;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
}

.notification-log-clear:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.notification-log-close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #d1d9e6;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  color: #64748b;
  transition: background-color 0.2s, color 0.2s, transform 0.2s, border-color 0.2s;
}

.notification-log-close:hover {
  color: #0f172a;
  background: #f8fafc;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.notification-log-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 8px;
}

.notification-log-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 12px;
  width: 100%;
  padding: 12px 12px 12px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.notification-log-item-button {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.notification-log-item:hover {
  background-color: #f8fbff;
  border-color: #cfe1ff;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.notification-log-item:focus-visible,
.notification-log-clear:focus-visible,
.notification-log-close:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}

.notification-log-icon {
  font-size: 20px;
  flex-shrink: 0;
  min-width: 28px;
  text-align: center;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #eff6ff;
}

.notification-log-details {
  flex: 1;
  min-width: 0;
}

.notification-log-title {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 2px;
  word-break: break-word;
}

.notification-log-message {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
  word-break: break-word;
}

.notification-log-time {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
}

.notification-log-empty {
  padding: 18px 16px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

#notificationHistoryDetailBody {
  display: grid;
  gap: 10px;
  padding-top: 2px;
  color: #0f172a;
}

#notificationHistoryDetailBody a {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
}

#notificationHistoryDetailBody a:hover {
  text-decoration: underline;
}

/* Log item type variants */
.notification-log-absent .notification-log-title {
  color: #7f1d1d;
}

.notification-log-late .notification-log-title {
  color: #78350f;
}

.notification-log-undertime .notification-log-title {
  color: #1e3a8a;
}

.notification-log-success .notification-log-title {
  color: #166534;
}

.notification-log-error .notification-log-title {
  color: #7f1d1d;
}

.notification-log-info .notification-log-title {
  color: #1e3a8a;
}

.notification-log-warning .notification-log-title {
  color: #92400e;
}

.absence-action-modal {
  max-width: 540px;
}

.absence-action-body {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.absence-action-summary {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
}

.absence-action-warning {
  border: 1px solid #fed7aa;
  background: #ffedd5;
  color: #9a3412;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.35;
}

.absence-action-field {
  display: grid;
  gap: 6px;
}

/* Responsive log panel */
@media (max-width: 640px) {
  .notification-log-panel {
    top: 70px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: 62vh;
  }

  .notification-log-header {
    padding: 12px;
  }

  .notification-log-content {
    padding: 8px;
  }

  .notification-log-item {
    grid-template-columns: 30px 1fr;
    gap: 10px;
  }
}