/* =============================================================
   DOODLY — Enterprise Audit Trail (audit.css). Prefix: .aud-
   Token-driven; admin surface.
   ============================================================= */
.aud { display: flex; flex-direction: column; gap: 4px; }
.aud-tabbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.aud-headbtns { display: inline-flex; align-items: center; gap: 8px; }

/* dashboard stats */
.aud-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.aud-stat { text-align: left; border: 1px solid var(--line, #e7ece9); background: var(--surface, #fff); border-radius: 14px; padding: 13px 15px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: transform .12s, box-shadow .12s, border-color .12s; }
.aud-stat:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 61, 46, .1); border-color: var(--leaf, #1FAE66); }
.aud-stat.warn { border-color: #f0c36d; background: #fffdf6; }
.aud-stat b { font-family: var(--font-display, "Fraunces", serif); font-size: 1.7rem; color: var(--forest, #0F3D2E); line-height: 1; }
.aud-stat span { font-size: .75rem; color: var(--ink-3, #6b7b73); }

.aud .exp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 820px) { .aud .exp-grid2 { grid-template-columns: 1fr; } }

/* alerts */
.aud-alert { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line, #e7ece9); border-left-width: 4px; background: var(--surface, #fff); border-radius: 12px; padding: 9px 12px; margin-bottom: 8px; cursor: pointer; }
.aud-alert:hover { background: var(--mint-soft, #E4F6EC); }
.aud-alert.tone-red { border-left-color: #d9534f; } .aud-alert.tone-amber { border-left-color: var(--gold, #C99A2E); } .aud-alert.tone-blue { border-left-color: #3b82c4; }
.aa-ic { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--mint-soft, #E4F6EC); }
.aud-alert b { font-size: .85rem; display: block; } .aud-alert span span { font-size: .74rem; color: var(--ink-3, #6b7b73); }
.aud-mods { display: flex; flex-direction: column; gap: 4px; }
.aud-modrow { display: flex; justify-content: space-between; font-size: .85rem; padding: 5px 0; border-bottom: 1px dashed var(--line, #e7ece9); }
.aud-modrow b { color: var(--forest, #0F3D2E); }

/* filters */
.aud-filters { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.aud-q { width: 100%; }
.aud-flrow { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.aud-fl { display: flex; flex-direction: column; gap: 3px; }
.aud-fl > span { font-size: .72rem; font-weight: 600; color: var(--ink-3, #6b7b73); }
.aud-flactions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.aud-exp { margin-left: auto; display: inline-flex; gap: 4px; }

/* table */
.aud-tbl td { vertical-align: top; font-size: .84rem; }
.aud-row { cursor: pointer; }
.aud-row:hover td { background: var(--mint-soft, #E4F6EC); }
.aud-when { white-space: nowrap; }
.aud-old { color: #b85c5c; text-decoration: line-through; }
.aud-new { color: var(--leaf-600, #178a52); font-weight: 600; }

/* pager */
.aud-pager { display: flex; align-items: center; gap: 10px; justify-content: center; margin-top: 12px; }
.aud-pager span { font-size: .82rem; color: var(--ink-3, #6b7b73); }
.aud-per { width: auto; padding: 4px 8px; }

/* timeline */
.aud-tlhead { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin: 12px 0; }
.aud-tlsum { display: flex; gap: 6px; flex-wrap: wrap; }
.aud-tlchip { font-size: .74rem; background: var(--mint-soft, #E4F6EC); color: var(--forest, #0F3D2E); border-radius: 999px; padding: 4px 10px; }
.aud-tlhead .btn { margin-left: auto; }
.aud-timeline { display: flex; flex-direction: column; gap: 14px; }
.aud-tldh { font-weight: 700; font-size: .82rem; color: var(--ink-2, #3c4a43); margin-bottom: 6px; position: sticky; top: 0; }
.aud-tlitem { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line, #e7ece9); border-radius: 12px; padding: 9px 12px; margin-bottom: 6px; cursor: pointer; background: var(--surface, #fff); }
.aud-tlitem:hover { background: var(--mint-soft, #E4F6EC); }
.aud-tlic { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 8px; background: var(--mint-soft, #E4F6EC); }
.aud-tltx { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.aud-tlsub { font-size: .75rem; color: var(--ink-3, #6b7b73); }
.aud-tlt { white-space: nowrap; font-size: .76rem; color: var(--ink-3, #6b7b73); display: flex; align-items: center; gap: 6px; }

/* record modal */
.aud-ov { position: fixed; inset: 0; background: rgba(15, 30, 24, .45); backdrop-filter: blur(2px); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 18px; animation: aud-fade .15s; }
@keyframes aud-fade { from { opacity: 0; } }
.aud-modal { background: var(--surface, #fff); border-radius: 18px; width: min(560px, 100%); max-height: 86vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .3); animation: aud-pop .18s; }
@keyframes aud-pop { from { transform: translateY(12px) scale(.98); opacity: 0; } }
.aud-mh { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line, #e7ece9); }
.aud-mh h3 { font-family: var(--font-display, "Fraunces", serif); color: var(--forest, #0F3D2E); margin: 0; font-size: 1.1rem; }
.aud-x { border: none; background: var(--mint-soft, #E4F6EC); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.aud-mb { padding: 8px 18px; overflow: auto; }
.aud-dr { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px dashed var(--line, #e7ece9); font-size: .85rem; }
.aud-dr > span { color: var(--ink-3, #6b7b73); flex: none; }
.aud-dr > b { text-align: right; word-break: break-word; }
.aud-change b { font-weight: 400; }
.aud-mf { display: flex; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line, #e7ece9); }

@media (max-width: 700px) {
  .aud-tabbar { flex-direction: column; align-items: stretch; }
  .aud-stats { grid-template-columns: repeat(2, 1fr); }
  .aud-exp { margin-left: 0; }
  .aud-tlhead .btn { margin-left: 0; }
}
@media print { .aud-tabbar, .aud-filters, .aud-pager, .exp-tabs, .aud-headbtns, .aud-exp { display: none !important; } }
