/* ============================================================
   app.css — iOS-Style Design System
   Prefix: app-
   ============================================================
   TABLE OF CONTENTS
   1.  Reset & Base
   2.  Design Tokens
   3.  Typography
   4.  Layout Utilities
   5.  Flexbox
   6.  Grid
   7.  Spacing
   8.  Display & Visibility
   9.  Icons (Material Symbols)
   10. App Shell (Wrapper, Sidenav, Navbar, Tab Bar)
   11. Cards
   12. Buttons
   13. Forms & Inputs
   14. Toggle & Checkbox
   15. Select & Dropdown
   16. Badges & Pills
   17. Alerts & Banners
   18. Tables
   19. Lists
   20. Modal & Sheet
   21. Toast
   22. Progress & Loading
   23. Avatars
   24. Accordion
   25. Tabs (content)
   26. Section Header
   27. Info Box & Rows
   28. Schedule Items
   29. Story Bar
   30. Camera Modal
   31. Attendance Stats
   32. Slide to Check-out
   33. Empty State
   34. Animations
   35. JS Integration Hooks
   36. Responsive
   37. Dark Mode
   38. Safe Area
   ============================================================ */

/* ============================================================
   1. RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, 'Inter', 'SF Pro Text', 'Helvetica Neue', sans-serif;
    background-color: var(--app-bg);
    color: var(--app-label);
    line-height: 1.5;
    overflow-x: hidden;
    padding-bottom: var(--app-tab-bar-height);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video {
    max-width: 100%;
    display: block;
}

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

button {
    cursor: pointer;
    background: none;
    border: none;
}

a {
    color: var(--app-blue);
    text-decoration: none;
}

a:hover {
    /* text-decoration: underline; */
}

ul,
ol {
    list-style: none;
}

:focus-visible {
    outline: 2px solid var(--app-blue);
    outline-offset: 2px;
}

/* ============================================================
   2. DESIGN TOKENS
   ============================================================ */
:root {
    /* Backgrounds */
    --app-bg: #f2f2f6;
    --app-secondary-bg: #ffffff;
    --app-tertiary-bg: #e5e5ea;
    --app-quaternary-bg: #f9f9fb;

    /* Text */
    --app-label: #000000;
    --app-secondary-label: #3a3a3c;
    --app-tertiary-label: #8e8e93;
    --app-quaternary-label: #c7c7cc;

    /* Borders */
    --app-separator: #c6c6c8;
    --app-separator-opaque: #e5e5ea;

    /* Accents */
    --app-blue: #007aff;
    --app-green: #34c759;
    --app-red: #ff3b30;
    --app-orange: #ff9500;
    --app-teal: #5ac8fa;
    --app-yellow: #ffcc00;
    --app-purple: #af52de;
    --app-pink: #ff2d55;
    --app-indigo: #5856d6;

    /* Semantic */
    --app-success: var(--app-green);
    --app-info: var(--app-blue);
    --app-warning: var(--app-orange);
    --app-danger: var(--app-red);

    /* Translucent */
    --app-blur-light: rgba(255, 255, 255, 0.72);
    --app-blur-tab: rgba(255, 255, 255, 0.94);
    --app-overlay: rgba(0, 0, 0, 0.3);
    --app-overlay-strong: rgba(0, 0, 0, 0.5);

    /* Sizes */
    --app-tab-bar-height: 82px;
    --app-tab-bar-height-sm: 74px;
    --app-navbar-height: 56px;
    --app-gutter: 16px;

    /* Radius */
    --app-radius-sm: 8px;
    --app-radius-md: 12px;
    --app-radius-lg: 18px;
    --app-radius-xl: 24px;
    --app-radius-full: 9999px;

    /* Shadows */
    --app-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --app-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --app-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
    --app-shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.16);

    /* Motion */
    --app-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --app-ease-out: cubic-bezier(0, 0, 0.2, 1);
    --app-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --app-duration-fast: 150ms;
    --app-duration-base: 250ms;
    --app-duration-slow: 350ms;

    /* Z-index */
    --app-z-dropdown: 10;
    --app-z-sticky: 50;
    --app-z-navbar: 99;
    --app-z-tabbar: 100;
    --app-z-overlay: 999;
    --app-z-sidenav: 1000;
    --app-z-modal: 1100;
    --app-z-toast: 1200;
    --app-z-tooltip: 1300;
}

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
.app-text-display    { font-size: 34px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.2; }
.app-text-title-1    { font-size: 28px; font-weight: 700; letter-spacing: -0.4px; }
.app-text-title-2    { font-size: 22px; font-weight: 600; letter-spacing: -0.3px; }
.app-text-title-3    { font-size: 20px; font-weight: 600; }
.app-text-headline   { font-size: 17px; font-weight: 600; }
.app-text-body       { font-size: 16px; font-weight: 400; }
.app-text-callout    { font-size: 15px; font-weight: 400; }
.app-text-subhead    { font-size: 14px; font-weight: 400; }
.app-text-footnote   { font-size: 13px; font-weight: 400; }
.app-text-caption    { font-size: 12px; font-weight: 400; }
.app-text-caption-2  { font-size: 11px; font-weight: 400; }

.app-text-muted      { color: var(--app-secondary-label); }
.app-text-subtle     { color: var(--app-tertiary-label); }
.app-text-primary    { color: var(--app-blue); }
.app-text-success    { color: var(--app-green); }
.app-text-danger     { color: var(--app-red); }
.app-text-warning    { color: var(--app-orange); }

.app-text-center     { text-align: center; }
.app-text-left       { text-align: left; }
.app-text-right      { text-align: right; }
.app-text-truncate   { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-text-bold       { font-weight: 700; }
.app-text-semibold   { font-weight: 600; }
.app-text-medium     { font-weight: 500; }
.app-text-uppercase  { text-transform: uppercase; letter-spacing: 0.5px; }

/* ============================================================
   4. LAYOUT UTILITIES
   ============================================================ */
.app-container       { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 20px; }
.app-container-sm    { max-width: 640px; }
.app-container-md    { max-width: 960px; }
.app-container-lg    { max-width: 1200px; }

.app-w-full          { width: 100%; }
.app-h-full          { height: 100%; }
.app-min-h-screen    { min-height: 100vh; }

.app-relative        { position: relative; }
.app-absolute        { position: absolute; }
.app-fixed           { position: fixed; }
.app-sticky          { position: sticky; }

.app-overflow-hidden { overflow: hidden; }
.app-overflow-auto   { overflow: auto; }
.app-overflow-x-auto { overflow-x: auto; }
.app-overflow-y-auto { overflow-y: auto; }

/* ============================================================
   5. FLEXBOX
   ============================================================ */
.app-flex            { display: flex; }
.app-inline-flex     { display: inline-flex; }
.app-flex-col        { flex-direction: column; }
.app-flex-row        { flex-direction: row; }
.app-flex-wrap       { flex-wrap: wrap; }
.app-flex-nowrap     { flex-wrap: nowrap; }

.app-items-start     { align-items: flex-start; }
.app-items-center    { align-items: center; }
.app-items-end       { align-items: flex-end; }
.app-items-stretch   { align-items: stretch; }

.app-justify-start   { justify-content: flex-start; }
.app-justify-center  { justify-content: center; }
.app-justify-end     { justify-content: flex-end; }
.app-justify-between { justify-content: space-between; }
.app-justify-around  { justify-content: space-around; }
.app-justify-evenly  { justify-content: space-evenly; }

.app-flex-1          { flex: 1; }
.app-flex-auto       { flex: auto; }
.app-flex-none       { flex: none; }

.app-gap-1 { gap: 4px; }
.app-gap-2 { gap: 8px; }
.app-gap-3 { gap: 12px; }
.app-gap-4 { gap: 16px; }
.app-gap-5 { gap: 20px; }
.app-gap-6 { gap: 24px; }
.app-gap-8 { gap: 32px; }

/* ============================================================
   6. GRID
   ============================================================ */
.app-grid           { display: grid; }
.app-grid-cols-1    { grid-template-columns: repeat(1, 1fr); }
.app-grid-cols-2    { grid-template-columns: repeat(2, 1fr); }
.app-grid-cols-3    { grid-template-columns: repeat(3, 1fr); }
.app-grid-cols-4    { grid-template-columns: repeat(4, 1fr); }

.app-grid-auto-fit  { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.app-grid-auto-fill { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.app-col-span-2     { grid-column: span 2; }
.app-col-span-3     { grid-column: span 3; }
.app-col-span-full  { grid-column: 1 / -1; }

/* ----- Responsive 12-column grid ----- */
/* Breakpoints (min-width): sm 576px, md 768px, lg 992px, xl 1200px
   Usage: <div class="app-row">
            <div class="app-col-12 app-col-md-6 app-col-lg-4">...</div>
          </div>                                                    */
.app-row {
    display: flex;
    flex-wrap: wrap;
    margin-left: calc(var(--app-gutter) / -2);
    margin-right: calc(var(--app-gutter) / -2);
}

.app-row > * {
    padding-left: calc(var(--app-gutter) / 2);
    padding-right: calc(var(--app-gutter) / 2);
    max-width: 100%;
}

.app-row-gap-0  { --app-gutter: 0px; }
.app-row-gap-sm { --app-gutter: 8px; }
.app-row-gap-lg { --app-gutter: 24px; }

/* Column that splits the remaining space equally */
.app-col {
    flex: 1 0 0%;
    min-width: 0;
}

/* Column that sizes to its content */
.app-col-auto {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
}

/* Base (all viewports) */
.app-col-1 { flex: 0 0 auto; width: 8.3333%; }
.app-col-2 { flex: 0 0 auto; width: 16.6667%; }
.app-col-3 { flex: 0 0 auto; width: 25.0000%; }
.app-col-4 { flex: 0 0 auto; width: 33.3333%; }
.app-col-5 { flex: 0 0 auto; width: 41.6667%; }
.app-col-6 { flex: 0 0 auto; width: 50.0000%; }
.app-col-7 { flex: 0 0 auto; width: 58.3333%; }
.app-col-8 { flex: 0 0 auto; width: 66.6667%; }
.app-col-9 { flex: 0 0 auto; width: 75.0000%; }
.app-col-10 { flex: 0 0 auto; width: 83.3333%; }
.app-col-11 { flex: 0 0 auto; width: 91.6667%; }
.app-col-12 { flex: 0 0 auto; width: 100.0000%; }

/* sm and up */
@media (min-width: 576px) {
    .app-col-sm-1 { flex: 0 0 auto; width: 8.3333%; }
    .app-col-sm-2 { flex: 0 0 auto; width: 16.6667%; }
    .app-col-sm-3 { flex: 0 0 auto; width: 25.0000%; }
    .app-col-sm-4 { flex: 0 0 auto; width: 33.3333%; }
    .app-col-sm-5 { flex: 0 0 auto; width: 41.6667%; }
    .app-col-sm-6 { flex: 0 0 auto; width: 50.0000%; }
    .app-col-sm-7 { flex: 0 0 auto; width: 58.3333%; }
    .app-col-sm-8 { flex: 0 0 auto; width: 66.6667%; }
    .app-col-sm-9 { flex: 0 0 auto; width: 75.0000%; }
    .app-col-sm-10 { flex: 0 0 auto; width: 83.3333%; }
    .app-col-sm-11 { flex: 0 0 auto; width: 91.6667%; }
    .app-col-sm-12 { flex: 0 0 auto; width: 100.0000%; }
    .app-col-sm { flex: 1 0 0%; min-width: 0; }
    .app-col-sm-auto { flex: 0 0 auto; width: auto; }
}

/* md and up */
@media (min-width: 768px) {
    .app-col-md-1 { flex: 0 0 auto; width: 8.3333%; }
    .app-col-md-2 { flex: 0 0 auto; width: 16.6667%; }
    .app-col-md-3 { flex: 0 0 auto; width: 25.0000%; }
    .app-col-md-4 { flex: 0 0 auto; width: 33.3333%; }
    .app-col-md-5 { flex: 0 0 auto; width: 41.6667%; }
    .app-col-md-6 { flex: 0 0 auto; width: 50.0000%; }
    .app-col-md-7 { flex: 0 0 auto; width: 58.3333%; }
    .app-col-md-8 { flex: 0 0 auto; width: 66.6667%; }
    .app-col-md-9 { flex: 0 0 auto; width: 75.0000%; }
    .app-col-md-10 { flex: 0 0 auto; width: 83.3333%; }
    .app-col-md-11 { flex: 0 0 auto; width: 91.6667%; }
    .app-col-md-12 { flex: 0 0 auto; width: 100.0000%; }
    .app-col-md { flex: 1 0 0%; min-width: 0; }
    .app-col-md-auto { flex: 0 0 auto; width: auto; }
}

/* lg and up */
@media (min-width: 992px) {
    .app-col-lg-1 { flex: 0 0 auto; width: 8.3333%; }
    .app-col-lg-2 { flex: 0 0 auto; width: 16.6667%; }
    .app-col-lg-3 { flex: 0 0 auto; width: 25.0000%; }
    .app-col-lg-4 { flex: 0 0 auto; width: 33.3333%; }
    .app-col-lg-5 { flex: 0 0 auto; width: 41.6667%; }
    .app-col-lg-6 { flex: 0 0 auto; width: 50.0000%; }
    .app-col-lg-7 { flex: 0 0 auto; width: 58.3333%; }
    .app-col-lg-8 { flex: 0 0 auto; width: 66.6667%; }
    .app-col-lg-9 { flex: 0 0 auto; width: 75.0000%; }
    .app-col-lg-10 { flex: 0 0 auto; width: 83.3333%; }
    .app-col-lg-11 { flex: 0 0 auto; width: 91.6667%; }
    .app-col-lg-12 { flex: 0 0 auto; width: 100.0000%; }
    .app-col-lg { flex: 1 0 0%; min-width: 0; }
    .app-col-lg-auto { flex: 0 0 auto; width: auto; }
}

/* xl and up */
@media (min-width: 1200px) {
    .app-col-xl-1 { flex: 0 0 auto; width: 8.3333%; }
    .app-col-xl-2 { flex: 0 0 auto; width: 16.6667%; }
    .app-col-xl-3 { flex: 0 0 auto; width: 25.0000%; }
    .app-col-xl-4 { flex: 0 0 auto; width: 33.3333%; }
    .app-col-xl-5 { flex: 0 0 auto; width: 41.6667%; }
    .app-col-xl-6 { flex: 0 0 auto; width: 50.0000%; }
    .app-col-xl-7 { flex: 0 0 auto; width: 58.3333%; }
    .app-col-xl-8 { flex: 0 0 auto; width: 66.6667%; }
    .app-col-xl-9 { flex: 0 0 auto; width: 75.0000%; }
    .app-col-xl-10 { flex: 0 0 auto; width: 83.3333%; }
    .app-col-xl-11 { flex: 0 0 auto; width: 91.6667%; }
    .app-col-xl-12 { flex: 0 0 auto; width: 100.0000%; }
    .app-col-xl { flex: 1 0 0%; min-width: 0; }
    .app-col-xl-auto { flex: 0 0 auto; width: auto; }
}

/* Offsets (margin-left) */
.app-offset-0 { margin-left: 0.0000%; }
.app-offset-1 { margin-left: 8.3333%; }
.app-offset-2 { margin-left: 16.6667%; }
.app-offset-3 { margin-left: 25.0000%; }
.app-offset-4 { margin-left: 33.3333%; }
.app-offset-5 { margin-left: 41.6667%; }
.app-offset-6 { margin-left: 50.0000%; }
.app-offset-7 { margin-left: 58.3333%; }
.app-offset-8 { margin-left: 66.6667%; }
.app-offset-9 { margin-left: 75.0000%; }
.app-offset-10 { margin-left: 83.3333%; }
.app-offset-11 { margin-left: 91.6667%; }

@media (min-width: 576px) {
    .app-offset-sm-0 { margin-left: 0.0000%; }
    .app-offset-sm-1 { margin-left: 8.3333%; }
    .app-offset-sm-2 { margin-left: 16.6667%; }
    .app-offset-sm-3 { margin-left: 25.0000%; }
    .app-offset-sm-4 { margin-left: 33.3333%; }
    .app-offset-sm-5 { margin-left: 41.6667%; }
    .app-offset-sm-6 { margin-left: 50.0000%; }
    .app-offset-sm-7 { margin-left: 58.3333%; }
    .app-offset-sm-8 { margin-left: 66.6667%; }
    .app-offset-sm-9 { margin-left: 75.0000%; }
    .app-offset-sm-10 { margin-left: 83.3333%; }
    .app-offset-sm-11 { margin-left: 91.6667%; }
}

@media (min-width: 768px) {
    .app-offset-md-0 { margin-left: 0.0000%; }
    .app-offset-md-1 { margin-left: 8.3333%; }
    .app-offset-md-2 { margin-left: 16.6667%; }
    .app-offset-md-3 { margin-left: 25.0000%; }
    .app-offset-md-4 { margin-left: 33.3333%; }
    .app-offset-md-5 { margin-left: 41.6667%; }
    .app-offset-md-6 { margin-left: 50.0000%; }
    .app-offset-md-7 { margin-left: 58.3333%; }
    .app-offset-md-8 { margin-left: 66.6667%; }
    .app-offset-md-9 { margin-left: 75.0000%; }
    .app-offset-md-10 { margin-left: 83.3333%; }
    .app-offset-md-11 { margin-left: 91.6667%; }
}

@media (min-width: 992px) {
    .app-offset-lg-0 { margin-left: 0.0000%; }
    .app-offset-lg-1 { margin-left: 8.3333%; }
    .app-offset-lg-2 { margin-left: 16.6667%; }
    .app-offset-lg-3 { margin-left: 25.0000%; }
    .app-offset-lg-4 { margin-left: 33.3333%; }
    .app-offset-lg-5 { margin-left: 41.6667%; }
    .app-offset-lg-6 { margin-left: 50.0000%; }
    .app-offset-lg-7 { margin-left: 58.3333%; }
    .app-offset-lg-8 { margin-left: 66.6667%; }
    .app-offset-lg-9 { margin-left: 75.0000%; }
    .app-offset-lg-10 { margin-left: 83.3333%; }
    .app-offset-lg-11 { margin-left: 91.6667%; }
}

@media (min-width: 1200px) {
    .app-offset-xl-0 { margin-left: 0.0000%; }
    .app-offset-xl-1 { margin-left: 8.3333%; }
    .app-offset-xl-2 { margin-left: 16.6667%; }
    .app-offset-xl-3 { margin-left: 25.0000%; }
    .app-offset-xl-4 { margin-left: 33.3333%; }
    .app-offset-xl-5 { margin-left: 41.6667%; }
    .app-offset-xl-6 { margin-left: 50.0000%; }
    .app-offset-xl-7 { margin-left: 58.3333%; }
    .app-offset-xl-8 { margin-left: 66.6667%; }
    .app-offset-xl-9 { margin-left: 75.0000%; }
    .app-offset-xl-10 { margin-left: 83.3333%; }
    .app-offset-xl-11 { margin-left: 91.6667%; }
}


/* Grid 2 columns khusus dashboard */
.app-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 768px) {
    .app-grid-2 { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   7. SPACING
   ============================================================ */
.app-m-0 { margin: 0; }
.app-m-1 { margin: 4px; }
.app-m-2 { margin: 8px; }
.app-m-3 { margin: 12px; }
.app-m-4 { margin: 16px; }
.app-m-5 { margin: 20px; }
.app-m-6 { margin: 24px; }

.app-mt-0 { margin-top: 0; }    .app-mt-1 { margin-top: 4px; }
.app-mt-2 { margin-top: 8px; }  .app-mt-3 { margin-top: 12px; }
.app-mt-4 { margin-top: 16px; } .app-mt-6 { margin-top: 24px; }

.app-mb-0 { margin-bottom: 0; }    .app-mb-1 { margin-bottom: 4px; }
.app-mb-2 { margin-bottom: 8px; }  .app-mb-3 { margin-bottom: 12px; }
.app-mb-4 { margin-bottom: 16px; } .app-mb-6 { margin-bottom: 24px; }

.app-ml-auto { margin-left: auto; }
.app-mr-auto { margin-right: auto; }
.app-mx-auto { margin-left: auto; margin-right: auto; }

.app-p-0 { padding: 0; }
.app-p-1 { padding: 4px; }
.app-p-2 { padding: 8px; }
.app-p-3 { padding: 12px; }
.app-p-4 { padding: 16px; }
.app-p-5 { padding: 20px; }
.app-p-6 { padding: 24px; }

.app-px-2 { padding-left: 8px; padding-right: 8px; }
.app-px-3 { padding-left: 12px; padding-right: 12px; }
.app-px-4 { padding-left: 16px; padding-right: 16px; }
.app-py-2 { padding-top: 8px; padding-bottom: 8px; }
.app-py-3 { padding-top: 12px; padding-bottom: 12px; }
.app-py-4 { padding-top: 16px; padding-bottom: 16px; }

/* ============================================================
   8. DISPLAY & VISIBILITY
   ============================================================ */
.app-block         { display: block; }
.app-inline-block  { display: inline-block; }
.app-inline        { display: inline; }
.app-hidden        { display: none; }

.app-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   9. ICONS — Material Symbols
   ============================================================ */
.app-icon,
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
    font-size: 20px;
    vertical-align: middle;
    line-height: 1;
}

.app-icon-sm { font-size: 16px; }
.app-icon-lg { font-size: 24px; }
.app-icon-xl { font-size: 32px; }

/* ============================================================
   10. APP SHELL
   ============================================================ */

/* Wrapper */
.app-wrapper {
    display: flex;
    align-items: flex-start;
    min-height: 100vh;
    position: relative;
    /* clip, bukan hidden: overflow:hidden membuat wrapper jadi scroll container
       sehingga position:sticky pada sidenav ikut bergerak saat scroll */
    overflow-x: clip;
}

/* Sidenav */
.app-sidenav {
    width: 280px;
    background: var(--app-secondary-bg);
    backdrop-filter: blur(20px);
    border-right: 0.5px solid var(--app-separator);
    position: sticky;
    height: 100vh;
    top: 0;
    overflow-y: auto;
    z-index: 200;
    align-self: flex-start;
    transition: transform var(--app-duration-slow) var(--app-ease-standard);
}

.app-sidenav::-webkit-scrollbar { width: 4px; }
.app-sidenav::-webkit-scrollbar-thumb {
    background: var(--app-tertiary-label);
    border-radius: 20px;
}

.app-sidenav-header {
    padding: 20px;
    border-bottom: 0.5px solid var(--app-separator);
    margin-bottom: 8px;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-logo-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--app-green), #2ea345);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--app-shadow-sm);
}

.app-logo-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.app-logo-text h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--app-label);
}

.app-logo-text p {
    font-size: 11px;
    color: var(--app-secondary-label);
}

/* Sidenav nav */
.app-nav {
    list-style: none;
    padding: 0 12px;
}

.app-nav-item {
    margin-bottom: 4px;
}

.app-nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    color: var(--app-label);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    font-size: 16px;
    transition: all var(--app-duration-fast) var(--app-ease-standard);
}

.app-nav-link .material-symbols-outlined {
    width: 24px;
    font-size: 20px;
    color: var(--app-blue);
}

.app-nav-link:hover {
    background: rgba(0, 122, 255, 0.08);
    text-decoration: none;
}

.app-nav-item.active .app-nav-link {
    background: var(--app-blue);
    color: white;
}

.app-nav-item.active .app-nav-link .material-symbols-outlined {
    color: white;
}

.app-nav-divider {
    height: 0.5px;
    background: var(--app-separator);
    margin: 12px 0;
}

.app-nav-section-title {
    padding: 12px 14px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--app-tertiary-label);
}

.app-nav-badge {
    margin-left: auto;
    background: var(--app-red);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--app-radius-full);
    min-width: 20px;
    text-align: center;
}

/* Sidenav overlay */
.app-sidenav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--app-overlay);
    z-index: var(--app-z-overlay);
    opacity: 0;
    transition: opacity var(--app-duration-base) var(--app-ease-standard);
}

.app-sidenav-overlay.active {
    display: block;
    opacity: 1;
}

/* Main content */
.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--app-bg);
}

/* Navbar */
.app-navbar {
    background: var(--app-blur-light);
    backdrop-filter: blur(20px);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0.5px solid var(--app-separator);
    position: sticky;
    top: 0;
    z-index: var(--app-z-navbar);
}

.app-menu-toggle {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--app-blue);
    display: none;
    padding: 8px;
    border-radius: 8px;
    transition: background var(--app-duration-fast);
}

.app-menu-toggle:active {
    background: rgba(0, 122, 255, 0.1);
}

.app-page-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.app-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-user-name {
    font-weight: 500;
    font-size: 14px;
    color: var(--app-label);
}

.app-logout-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 59, 48, 0.1);
    padding: 8px 16px;
    border-radius: var(--app-radius-full);
    text-decoration: none;
    transition: all var(--app-duration-fast);
}

.app-logout-btn:active {
    background: rgba(255, 59, 48, 0.2);
    transform: scale(0.96);
}

.app-logout-btn .material-symbols-outlined {
    font-size: 20px;
    color: var(--app-red);
}

.app-logout-btn span {
    font-weight: 600;
    font-size: 14px;
    color: var(--app-red);
}

/* Content area */
.app-content {
    flex: 1;
    padding: 20px;
    /* max-width: 1400px; */
    width: 100%;
    /* margin: 0 auto; */
}

/* Tab Bar (bottom nav) */
.app-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--app-blur-tab);
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    border-top: 0.5px solid rgba(0, 0, 0, 0.08);
    z-index: var(--app-z-tabbar);
    padding: 8px 12px 12px;
}

.app-tab-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: 4px;
}

.app-tab-item {
    flex: 1;
    text-align: center;
    max-width: 120px;
}

.app-tab-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 8px 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    width: 100%;
    transition: opacity var(--app-duration-fast);
}

.app-tab-link .material-symbols-outlined {
    font-size: 22px;
    color: var(--app-tertiary-label);
    margin-bottom: 2px;
    transition: color var(--app-duration-fast);
}

.app-tab-link .app-tab-label {
    font-size: 10px;
    font-weight: 500;
    color: var(--app-tertiary-label);
    margin-top: 2px;
    transition: color var(--app-duration-fast);
}

.app-tab-item.active .app-tab-link .material-symbols-outlined,
.app-tab-item.active .app-tab-link .app-tab-label {
    color: var(--app-blue);
}

.app-tab-item.active .app-tab-link .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.app-tab-link:active {
    opacity: 0.5;
}

/* ============================================================
   11. CARDS
   ============================================================ */
.app-card {
    background: var(--app-secondary-bg);
    border-radius: var(--app-radius-lg);
    padding: 20px;
    border: 0.5px solid var(--app-separator);
    transition: transform var(--app-duration-fast), box-shadow var(--app-duration-fast);
    margin-bottom: 16px;
}

.app-card h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 0.5px solid var(--app-separator);
}

.app-card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--app-label);
}

.app-card-subtitle {
    font-size: 13px;
    color: var(--app-secondary-label);
    margin-top: 2px;
}

.app-card-body { padding: 0; }

.app-card-footer {
    padding-top: 16px;
    margin-top: 16px;
    border-top: 0.5px solid var(--app-separator);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.app-card-flat {
    background: var(--app-secondary-bg);
    border: none;
    box-shadow: none;
}

.app-card-elevated {
    border: none;
    box-shadow: var(--app-shadow-md);
}

.app-card-interactive {
    cursor: pointer;
}

.app-card-interactive:hover {
    box-shadow: var(--app-shadow-md);
    transform: translateY(-2px);
}

.app-card-accent {
    border-left: 4px solid var(--app-blue);
}

/* Stat cards */
.app-stat-card {
    background: var(--app-secondary-bg);
    border-radius: var(--app-radius-lg);
    padding: 20px;
    border: 0.5px solid var(--app-separator);
    transition: all var(--app-duration-fast);
}

.app-stat-card:active {
    transform: scale(0.98);
}

.app-stat-number {
    font-size: 34px;
    font-weight: 700;
    margin-top: 4px;
    line-height: 1.1;
}

.app-stat-label {
    font-size: 13px;
    color: var(--app-secondary-label);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 500;
}

.app-stat-icon {
    font-size: 32px;
    color: var(--app-green);
}

/* ============================================================
   12. BUTTONS
   ============================================================ */
.app-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--app-radius-md);
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--app-duration-fast) var(--app-ease-standard);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}

.app-btn:active {
    transform: scale(0.96);
}

.app-btn:disabled,
.app-btn.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Variants */
.app-btn-primary   { background: var(--app-blue); color: white; }
.app-btn-primary:hover { background: #0066d6; }

.app-btn-success   { background: var(--app-green); color: white; }
.app-btn-danger    { background: var(--app-red); color: white; }
.app-btn-warning   { background: var(--app-orange); color: white; }

.app-btn-secondary {
    background: var(--app-tertiary-bg);
    color: var(--app-label);
}
.app-btn-secondary:hover { background: #d8d8dd; }

.app-btn-ghost {
    background: transparent;
    color: var(--app-blue);
}
.app-btn-ghost:hover { background: rgba(0, 122, 255, 0.08); }

.app-btn-outline {
    background: transparent;
    color: var(--app-blue);
    border: 1.5px solid var(--app-blue);
}
.app-btn-outline:hover { background: rgba(0, 122, 255, 0.08); }

/* Sizes */
.app-btn-sm {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: var(--app-radius-sm);
}

.app-btn-lg {
    padding: 14px 28px;
    font-size: 17px;
    border-radius: var(--app-radius-lg);
}

.app-btn-icon {
    padding: 10px;
    width: 40px;
    height: 40px;
    border-radius: var(--app-radius-full);
}

.app-btn-block { width: 100%; }

/* Loading state */
.app-btn.is-loading {
    pointer-events: none;
    position: relative;
    color: transparent !important;
}

.app-btn.is-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin: -9px 0 0 -9px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: app-spin 0.7s linear infinite;
    opacity: 0.9;
}

.app-btn-primary.is-loading::after,
.app-btn-success.is-loading::after,
.app-btn-danger.is-loading::after,
.app-btn-warning.is-loading::after {
    border-color: white;
    border-top-color: transparent;
}

/* Button group */
.app-btn-group {
    display: inline-flex;
    border-radius: var(--app-radius-md);
    overflow: hidden;
    border: 1px solid var(--app-separator);
}

.app-btn-group .app-btn {
    border-radius: 0;
    border-right: 1px solid var(--app-separator);
}

.app-btn-group .app-btn:last-child {
    border-right: none;
}

/* ============================================================
   13. FORMS & INPUTS
   ============================================================ */
.app-form-group {
    margin-bottom: 16px;
}

.app-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--app-secondary-label);
    margin-bottom: 6px;
}

.app-label .app-required {
    color: var(--app-red);
}

.app-hint {
    font-size: 12px;
    color: var(--app-tertiary-label);
    margin-top: 4px;
}

.app-error {
    font-size: 12px;
    color: var(--app-red);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.app-input,
.app-textarea,
.app-select {
    width: 100%;
    padding: 12px 14px;
    background: var(--app-secondary-bg);
    border: 1px solid var(--app-separator);
    border-radius: var(--app-radius-md);
    font-size: 16px;
    color: var(--app-label);
    transition: border-color var(--app-duration-fast), box-shadow var(--app-duration-fast);
    -webkit-appearance: none;
    appearance: none;
}

.app-input::placeholder,
.app-textarea::placeholder {
    color: var(--app-tertiary-label);
}

.app-input:focus,
.app-textarea:focus,
.app-select:focus {
    outline: none;
    border-color: var(--app-blue);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.12);
}

.app-input:disabled,
.app-textarea:disabled,
.app-select:disabled {
    background: var(--app-tertiary-bg);
    color: var(--app-tertiary-label);
    cursor: not-allowed;
}

.app-input.is-valid {
    border-color: var(--app-green);
}
.app-input.is-valid:focus {
    box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.12);
}

.app-input.is-invalid {
    border-color: var(--app-red);
}
.app-input.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.12);
}

.app-textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* Input group */
.app-input-group {
    position: relative;
}

.app-input-group .app-input {
    padding-left: 42px;
}

.app-input-group .app-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--app-tertiary-label);
    font-size: 20px;
    pointer-events: none;
}

/* Search field */
.app-search {
    position: relative;
}

.app-search .app-input {
    padding-left: 40px;
    background: var(--app-tertiary-bg);
    border-color: transparent;
    border-radius: var(--app-radius-full);
}

.app-search::before {
    content: '🔍';
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: 0.5;
    pointer-events: none;
}

/* ============================================================
   14. TOGGLE & CHECKBOX
   ============================================================ */
.app-switch {
    position: relative;
    display: inline-block;
    width: 51px;
    height: 31px;
    flex-shrink: 0;
}

.app-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.app-switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--app-tertiary-bg);
    border-radius: var(--app-radius-full);
    transition: background var(--app-duration-base);
}

.app-switch-slider::before {
    content: '';
    position: absolute;
    height: 27px;
    width: 27px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: transform var(--app-duration-base) var(--app-ease-spring);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.app-switch input:checked + .app-switch-slider {
    background: var(--app-green);
}

.app-switch input:checked + .app-switch-slider::before {
    transform: translateX(20px);
}

.app-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 15px;
}

.app-checkbox input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.app-checkbox-mark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--app-separator);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--app-duration-fast);
    flex-shrink: 0;
}

.app-checkbox input:checked + .app-checkbox-mark {
    background: var(--app-blue);
    border-color: var(--app-blue);
}

.app-checkbox input:checked + .app-checkbox-mark::after {
    content: '';
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -2px);
}

.app-radio {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 15px;
}

.app-radio input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.app-radio-mark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--app-separator);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--app-duration-fast);
    flex-shrink: 0;
}

.app-radio input:checked + .app-radio-mark {
    border-color: var(--app-blue);
}

.app-radio input:checked + .app-radio-mark::after {
    content: '';
    width: 12px;
    height: 12px;
    background: var(--app-blue);
    border-radius: 50%;
}

/* ============================================================
   15. SELECT & DROPDOWN
   ============================================================ */
.app-select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
    cursor: pointer;
}

.app-dropdown {
    position: relative;
    display: inline-block;
}

.app-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 200px;
    background: var(--app-secondary-bg);
    border: 0.5px solid var(--app-separator);
    border-radius: var(--app-radius-md);
    box-shadow: var(--app-shadow-lg);
    padding: 6px;
    z-index: var(--app-z-dropdown);
    opacity: 0;
    transform: translateY(-8px) scale(0.96);
    pointer-events: none;
    transition: all var(--app-duration-fast) var(--app-ease-out);
    visibility: hidden;
}

.app-dropdown.open .app-dropdown-menu {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    visibility: visible;
}

.app-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--app-radius-sm);
    font-size: 14px;
    color: var(--app-label);
    cursor: pointer;
    transition: background var(--app-duration-fast);
    text-decoration: none;
}

.app-dropdown-item:hover {
    background: rgba(0, 122, 255, 0.08);
    text-decoration: none;
}

.app-dropdown-item.is-danger {
    color: var(--app-red);
}
.app-dropdown-item.is-danger:hover {
    background: rgba(255, 59, 48, 0.08);
}

.app-dropdown-divider {
    height: 0.5px;
    background: var(--app-separator);
    margin: 6px 0;
}

/* ============================================================
   16. BADGES & PILLS
   ============================================================ */
.app-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--app-radius-full);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.app-badge-primary { background: rgba(0, 122, 255, 0.12); color: var(--app-blue); }
.app-badge-success { background: rgba(52, 199, 89, 0.12); color: var(--app-green); }
.app-badge-danger  { background: rgba(255, 59, 48, 0.12); color: var(--app-red); }
.app-badge-warning { background: rgba(255, 149, 0, 0.14); color: var(--app-orange); }
.app-badge-info    { background: rgba(90, 200, 250, 0.14); color: #0a84ff; }
.app-badge-purple  { background: rgba(175, 82, 222, 0.12); color: var(--app-purple); }
.app-badge-gray    { background: var(--app-tertiary-bg); color: var(--app-secondary-label); }

.app-badge-solid { color: white; }
.app-badge-solid.app-badge-primary { background: var(--app-blue); }
.app-badge-solid.app-badge-success { background: var(--app-green); }
.app-badge-solid.app-badge-danger  { background: var(--app-red); }
.app-badge-solid.app-badge-warning { background: var(--app-orange); }

.app-badge-dot::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

/* ============================================================
   17. ALERTS & BANNERS
   ============================================================ */
.app-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--app-radius-md);
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid transparent;
    margin-bottom: 16px;
}

.app-alert-icon {
    flex-shrink: 0;
    font-size: 20px;
    line-height: 1;
}

.app-alert-content { flex: 1; }

.app-alert-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.app-alert-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: currentColor;
    opacity: 0.6;
    padding: 0 4px;
}

.app-alert-close:hover { opacity: 1; }

.app-alert-info {
    background: rgba(0, 122, 255, 0.08);
    color: #0055b3;
    border-color: rgba(0, 122, 255, 0.2);
}
.app-alert-success {
    background: rgba(52, 199, 89, 0.1);
    color: #1a7a2e;
    border-color: rgba(52, 199, 89, 0.25);
}
.app-alert-warning {
    background: rgba(255, 149, 0, 0.1);
    color: #a35a00;
    border-color: rgba(255, 149, 0, 0.25);
}
.app-alert-danger {
    background: rgba(255, 59, 48, 0.08);
    color: #a5150e;
    border-color: rgba(255, 59, 48, 0.22);
}

/* ============================================================
   18. TABLES
   ============================================================ */
.app-table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--app-radius-lg);
    background: var(--app-secondary-bg);
    border: 0.5px solid var(--app-separator);
}

.app-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.app-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--app-quaternary-bg);
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--app-secondary-label);
    border-bottom: 0.5px solid var(--app-separator);
    white-space: nowrap;
}

.app-table td {
    padding: 14px 16px;
    border-bottom: 0.5px solid var(--app-separator);
    color: var(--app-label);
    vertical-align: middle;
}

.app-table tbody tr:last-child td { border-bottom: none; }
.app-table tbody tr { transition: background var(--app-duration-fast); }
.app-table tbody tr:hover { background: rgba(0, 122, 255, 0.04); }

.app-table-striped tbody tr:nth-child(odd) {
    background: var(--app-quaternary-bg);
}

.app-table-compact th,
.app-table-compact td { padding: 8px 12px; }

/* Sortable header */
.app-table th.is-sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 32px;
}

.app-table th.is-sortable::after {
    content: '⇅';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.3;
    font-size: 12px;
}

.app-table th.is-sortable.is-asc::after {
    content: '↑';
    opacity: 1;
    color: var(--app-blue);
}

.app-table th.is-sortable.is-desc::after {
    content: '↓';
    opacity: 1;
    color: var(--app-blue);
}

/* ============================================================
   19. LISTS
   ============================================================ */
.app-list {
    background: var(--app-secondary-bg);
    border-radius: var(--app-radius-lg);
    border: 0.5px solid var(--app-separator);
    overflow: hidden;
}

.app-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-bottom: 0.5px solid var(--app-separator);
    transition: background var(--app-duration-fast);
    color: var(--app-label);
    text-decoration: none;
}

.app-list-item:last-child { border-bottom: none; }

.app-list-item:hover {
    background: rgba(0, 122, 255, 0.04);
    text-decoration: none;
}

.app-list-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--app-radius-md);
    background: var(--app-tertiary-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--app-blue);
    font-size: 20px;
}

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

.app-list-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--app-label);
}

.app-list-subtitle {
    font-size: 13px;
    color: var(--app-secondary-label);
    margin-top: 2px;
}

.app-list-meta {
    font-size: 13px;
    color: var(--app-tertiary-label);
    flex-shrink: 0;
}

.app-list-chevron {
    color: var(--app-tertiary-label);
    font-size: 20px;
    flex-shrink: 0;
}

/* ============================================================
   20. MODAL & SHEET
   ============================================================ */
.app-modal-backdrop {
    position: fixed;
    inset: 0;
    background: var(--app-overlay-strong);
    z-index: var(--app-z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--app-duration-base) var(--app-ease-standard);
    visibility: hidden;
}

.app-modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.app-modal {
    background: var(--app-secondary-bg);
    border-radius: var(--app-radius-xl);
    max-width: 500px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--app-shadow-xl);
    transform: scale(0.94);
    transition: transform var(--app-duration-base) var(--app-ease-spring);
}

.app-modal-backdrop.active .app-modal {
    transform: scale(1);
}

.app-modal-sm { max-width: 320px; }
.app-modal-md { max-width: 500px; }
.app-modal-lg { max-width: 640px; }

.app-modal-header {
    padding: 20px 22px;
    border-bottom: 0.5px solid var(--app-separator);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-modal-title {
    font-size: 18px;
    font-weight: 700;
}

.app-modal-close {
    background: var(--app-tertiary-bg);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    color: var(--app-secondary-label);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background var(--app-duration-fast);
}

.app-modal-close:hover {
    background: #d8d8dd;
}

.app-modal-body {
    padding: 22px;
    font-size: 15px;
    line-height: 1.6;
}

.app-modal-footer {
    padding: 16px 22px;
    border-top: 0.5px solid var(--app-separator);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Confirm/Alert variant (dipakai IOS.confirm/alert) */
.app-confirm .app-modal {
    max-width: 340px;
    text-align: center;
}

.app-confirm .app-modal-body {
    padding: 24px 22px 12px;
}

.app-confirm .app-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.app-confirm .app-modal-icon.is-danger  { background: rgba(255, 59, 48, 0.12); color: var(--app-red); }
.app-confirm .app-modal-icon.is-warning { background: rgba(255, 149, 0, 0.14); color: var(--app-orange); }
.app-confirm .app-modal-icon.is-info    { background: rgba(0, 122, 255, 0.12); color: var(--app-blue); }
.app-confirm .app-modal-icon.is-success { background: rgba(52, 199, 89, 0.12); color: var(--app-green); }

.app-confirm .app-modal-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
}

.app-confirm .app-modal-message {
    font-size: 14px;
    color: var(--app-secondary-label);
    line-height: 1.5;
}

.app-confirm .app-modal-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 16px 22px 22px;
    border-top: none;
}

.app-confirm .app-modal-footer .app-btn {
    width: 100%;
}

/* Bottom sheet */
.app-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: var(--app-overlay);
    z-index: var(--app-z-modal);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--app-duration-base);
    visibility: hidden;
}

.app-sheet-backdrop.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.app-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--app-secondary-bg);
    border-radius: var(--app-radius-xl) var(--app-radius-xl) 0 0;
    padding: 12px 20px 24px;
    z-index: calc(var(--app-z-modal) + 1);
    transform: translateY(100%);
    transition: transform var(--app-duration-slow) var(--app-ease-standard);
    max-height: 85vh;
    overflow-y: auto;
    visibility: hidden;
}

.app-sheet.active {
    transform: translateY(0);
    visibility: visible;
}

.app-sheet-handle {
    width: 40px;
    height: 5px;
    background: var(--app-separator);
    border-radius: var(--app-radius-full);
    margin: 0 auto 16px;
}

/* ============================================================
   21. TOAST
   ============================================================ */
.app-toast-container {
    position: fixed;
    bottom: calc(var(--app-tab-bar-height) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--app-z-toast);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    width: calc(100% - 32px);
    max-width: 400px;
}

.app-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(30, 30, 32, 0.96);
    color: white;
    border-radius: var(--app-radius-md);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--app-shadow-lg);
    backdrop-filter: blur(20px);
    pointer-events: auto;
    animation: app-toast-in var(--app-duration-base) var(--app-ease-out);
}

.app-toast.is-success { background: rgba(26, 122, 46, 0.96); }
.app-toast.is-danger  { background: rgba(165, 21, 14, 0.96); }
.app-toast.is-warning { background: rgba(163, 90, 0, 0.96); }

.app-toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.app-toast.is-out {
    animation: app-toast-out var(--app-duration-base) var(--app-ease-standard) forwards;
}

@keyframes app-toast-in {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes app-toast-out {
    to { opacity: 0; transform: translateY(20px) scale(0.96); }
}

/* ============================================================
   22. PROGRESS & LOADING
   ============================================================ */
.app-progress {
    width: 100%;
    height: 8px;
    background: var(--app-tertiary-bg);
    border-radius: var(--app-radius-full);
    overflow: hidden;
}

.app-progress-bar {
    height: 100%;
    background: var(--app-blue);
    border-radius: var(--app-radius-full);
    transition: width var(--app-duration-slow) var(--app-ease-standard);
}

.app-progress-bar.is-success { background: var(--app-green); }
.app-progress-bar.is-warning { background: var(--app-orange); }
.app-progress-bar.is-danger  { background: var(--app-red); }

.app-progress-sm { height: 4px; }
.app-progress-lg { height: 12px; }

/* Top progress bar (auto by IOS.progress) */
.app-top-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--app-blue);
    width: 0%;
    z-index: 9999;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(0, 122, 255, 0.6);
    pointer-events: none;
}

/* Spinner */
.app-spinner {
    width: 24px;
    height: 24px;
    border: 2.5px solid var(--app-tertiary-bg);
    border-top-color: var(--app-blue);
    border-radius: 50%;
    animation: app-spin 0.8s linear infinite;
}

.app-spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.app-spinner-lg { width: 40px; height: 40px; border-width: 3px; }

@keyframes app-spin {
    to { transform: rotate(360deg); }
}

/* Skeleton */
.app-skeleton {
    background: linear-gradient(
        90deg,
        var(--app-tertiary-bg) 0%,
        #f0f0f5 50%,
        var(--app-tertiary-bg) 100%
    );
    background-size: 200% 100%;
    border-radius: var(--app-radius-sm);
    animation: app-skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes app-skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Loading overlay (untuk IOS.loading) */
.app-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: var(--app-z-toast);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--app-duration-base);
    visibility: hidden;
}

.app-loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

.app-loading-box {
    background: var(--app-secondary-bg);
    padding: 24px 28px;
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    min-width: 140px;
}

.app-loading-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--app-secondary-label);
}

/* ============================================================
   23. AVATARS
   ============================================================ */
.app-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--app-blue);
    color: white;
    font-weight: 600;
    font-size: 15px;
    overflow: hidden;
    flex-shrink: 0;
    text-transform: uppercase;
}

.app-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.app-avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.app-avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.app-avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.app-avatar-xl { width: 80px; height: 80px; font-size: 28px; }

.app-avatar-group {
    display: flex;
}

.app-avatar-group .app-avatar {
    margin-left: -10px;
    border: 2px solid var(--app-secondary-bg);
}

.app-avatar-group .app-avatar:first-child {
    margin-left: 0;
}

/* ============================================================
   24. ACCORDION
   ============================================================ */
.app-accordion {
    background: var(--app-secondary-bg);
    border-radius: var(--app-radius-lg);
    border: 0.5px solid var(--app-separator);
    overflow: hidden;
}

.app-accordion-item {
    border-bottom: 0.5px solid var(--app-separator);
}

.app-accordion-item:last-child { border-bottom: none; }

.app-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    cursor: pointer;
    font-weight: 500;
    font-size: 15px;
    color: var(--app-label);
    background: transparent;
    width: 100%;
    text-align: left;
    transition: background var(--app-duration-fast);
}

.app-accordion-header:hover {
    background: rgba(0, 122, 255, 0.04);
}

.app-accordion-chevron {
    color: var(--app-tertiary-label);
    font-size: 20px;
    transition: transform var(--app-duration-base);
}

.app-accordion-item.open .app-accordion-chevron {
    transform: rotate(180deg);
}

.app-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--app-duration-slow) var(--app-ease-standard);
}

.app-accordion-content {
    padding: 0 18px 18px;
    color: var(--app-secondary-label);
    font-size: 14px;
    line-height: 1.6;
}

/* ============================================================
   25. TABS (content)
   ============================================================ */
.app-tabs {
    display: flex;
    border-bottom: 0.5px solid var(--app-separator);
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.app-tabs::-webkit-scrollbar { display: none; }

.app-tab {
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 500;
    color: var(--app-secondary-label);
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color var(--app-duration-fast);
}

.app-tab::after {
    content: '';
    position: absolute;
    bottom: -0.5px;
    left: 12px;
    right: 12px;
    height: 2px;
    background: transparent;
    border-radius: var(--app-radius-full);
    transition: background var(--app-duration-fast);
}

.app-tab.active {
    color: var(--app-blue);
    font-weight: 600;
}

.app-tab.active::after {
    background: var(--app-blue);
}

.app-tab:hover { color: var(--app-label); }

.app-tab-panel {
    display: none;
    padding: 20px 0;
}

.app-tab-panel.active {
    display: block;
    animation: app-fade-in var(--app-duration-base) var(--app-ease-out);
}

/* ============================================================
   26. SECTION HEADER
   ============================================================ */
.app-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 4px 12px 4px;
}

.app-section-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--app-label);
}

.app-section-title .material-symbols-outlined {
    color: var(--app-blue);
    font-size: 22px;
}

.app-section-link {
    font-size: 13px;
    color: var(--app-blue);
    text-decoration: none;
}

.app-section-link:hover {
    text-decoration: underline;
}

/* ============================================================
   27. INFO BOX & ROWS
   ============================================================ */
.app-info-box {
    background: #f8f8fc;
    border-radius: var(--app-radius-md);
    padding: 4px 16px;
    margin-bottom: 16px;
}

.app-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 0.5px solid #e5e5ea;
    gap: 8px;
}

.app-info-row:last-child { border-bottom: none; }

.app-info-row .app-info-label {
    color: var(--app-tertiary-label);
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-info-row .app-info-value {
    color: var(--app-label);
    font-weight: 600;
}

.app-info-row .app-info-value.is-highlight { color: var(--app-blue); }
.app-info-row .app-info-value.is-success   { color: var(--app-green); }
.app-info-row .app-info-value.is-warning   { color: var(--app-orange); }

/* Duration counter */
.app-duration {
    font-size: 22px;
    font-weight: 700;
    color: var(--app-blue);
    font-variant-numeric: tabular-nums;
    background: rgba(0, 122, 255, 0.08);
    padding: 6px 16px;
    border-radius: var(--app-radius-md);
    text-align: center;
    display: inline-block;
}

.app-duration.is-done {
    color: var(--app-tertiary-label);
    background: rgba(142, 142, 147, 0.1);
}

/* ============================================================
   28. SCHEDULE ITEMS
   ============================================================ */
.app-schedule-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 0.5px solid var(--app-separator);
    gap: 12px;
}

.app-schedule-item:last-child { border-bottom: none; }

.app-schedule-time {
    min-width: 75px;
    font-size: 12px;
    font-weight: 600;
    color: var(--app-blue);
    line-height: 1.3;
}

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

.app-schedule-mapel {
    font-size: 14px;
    font-weight: 600;
    color: var(--app-label);
}

.app-schedule-class {
    font-size: 11px;
    color: var(--app-tertiary-label);
    margin-top: 2px;
}

.app-schedule-guru {
    font-size: 12px;
    color: var(--app-secondary-label);
    margin-top: 1px;
}

.app-schedule-item.is-ongoing {
    background-color: rgba(52, 199, 89, 0.08);
    border-left: 4px solid var(--app-green);
}

.app-schedule-item.is-expired {
    background-color: rgba(142, 142, 147, 0.05);
    opacity: 0.65;
}

.app-schedule-item.is-expired .app-schedule-time,
.app-schedule-item.is-expired .app-schedule-mapel {
    color: var(--app-tertiary-label);
}

/* Kelas panel (dropdown-based) */
.app-kelas-panel { display: none; }
.app-kelas-panel.active { display: block; }

/* ============================================================
   29. STORY BAR (IG-like)
   ============================================================ */
.app-story-section {
      margin-bottom: 24px;
      max-width: 100%;
       overflow: hidden;
}

.app-story-container {
     display: flex;
   gap: 14px;
   overflow-x: auto;
   overflow-y: hidden;
   padding: 8px 4px;
   max-width: 100%;       /* ← KUNCI */
   width: 100%;
   -webkit-overflow-scrolling: touch;
   scroll-behavior: smooth;
   scrollbar-width: none;

}

.app-story-container::-webkit-scrollbar { display: none; }

.app-story-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 72px;
    flex-shrink: 0;
    cursor: pointer;
    text-align: center;
}

.app-story-avatar-wrapper {
    position: relative;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(45deg, #007aff, #34c759);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.app-story-item:active .app-story-avatar-wrapper {
    transform: scale(0.93);
}

.app-story-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--app-secondary-bg);
}

.app-story-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--app-label);
    margin-top: 6px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-story-avatar-wrapper.is-add {
    background: #e5e5ea;
    padding: 0;
}

.app-story-avatar-wrapper.is-add .app-story-camera-icon {
    font-size: 30px;
    color: var(--app-blue);
    font-weight: 400;
}

/* ============================================================
   30. CAMERA MODAL
   ============================================================ */
.app-camera {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 99999;
    display: none;
    flex-direction: column;
}

.app-camera.active { display: flex; }

.app-camera-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.app-camera-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px 16px;
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), rgba(0,0,0,0));
    z-index: 10;
    color: #fff;
}

.app-camera-close {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--app-duration-fast);
}

.app-camera-close:active { transform: scale(0.9); }

.app-camera-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.app-camera-spacer { width: 40px; }

.app-camera-bottombar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 32px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0));
    z-index: 10;
}

.app-camera-side-btn {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--app-duration-fast);
}

.app-camera-side-btn:active { transform: scale(0.9); }
.app-camera-side-btn .material-symbols-outlined { font-size: 24px; }

.app-camera-placeholder {
    visibility: hidden;
    pointer-events: none;
}

.app-camera-capture {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}

.app-camera-capture:active { transform: scale(0.92); }

.app-camera-shutter-ring {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 4px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(6px);
}

.app-camera-shutter-inner {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s ease;
}

.app-camera-capture:active .app-camera-shutter-inner {
    transform: scale(0.85);
}

.app-camera-preview {
    position: absolute;
    inset: 0;
    background: #000;
    display: none;
    flex-direction: column;
    z-index: 20;
}

.app-camera-preview.active { display: flex; }

.app-camera-preview img {
    flex: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.app-camera-preview-actions {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 24px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    display: flex;
    justify-content: space-between;
    gap: 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0));
}

.app-camera-action {
    flex: 1;
    padding: 14px 20px;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all var(--app-duration-fast);
}

.app-camera-action:active { transform: scale(0.96); }

.app-camera-action.is-retake {
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
}

.app-camera-action.is-use {
    background: var(--app-blue);
    color: #fff;
}

.app-camera-loading {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    z-index: 30;
}

.app-camera-loading.active { display: flex; }

/* ============================================================
   31. ATTENDANCE STATS
   ============================================================ */
.app-attendance {
    padding: 16px;
}

.app-attendance-stats {
    display: flex;
    justify-content: space-between;
    text-align: center;
}

.app-attendance-stat span:first-child {
    font-size: 11px;
    color: var(--app-tertiary-label);
    display: block;
}

.app-attendance-stat span:last-child {
    font-size: 15px;
    font-weight: 600;
    color: var(--app-label);
    display: block;
    margin-top: 2px;
}

/* ============================================================
   32. SLIDE TO CHECK-OUT
   ============================================================ */
.app-slide-checkout {
    position: relative;
    width: 100%;
    height: 56px;
    background: #ffe5e5;
    border-radius: 28px;
    padding: 4px;
    display: flex;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-x;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.app-slide-checkout-text {
    position: absolute;
    width: 100%;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--app-red);
    pointer-events: none;
    left: 0;
    letter-spacing: 0.3px;
    transition: opacity 0.2s ease;
}

.app-slide-checkout-handle {
    width: 48px;
    height: 48px;
    background: var(--app-red);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: grab;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(255, 59, 48, 0.4);
    transition: transform 0.1s ease-out;
}

.app-slide-checkout-handle:active { cursor: grabbing; }

.app-slide-checkout.is-disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* ============================================================
   33. EMPTY STATE
   ============================================================ */
.app-empty {
    padding: 48px 24px;
    text-align: center;
    color: var(--app-secondary-label);
    animation: app-fade-in var(--app-duration-slow) var(--app-ease-out);
}

.app-empty-icon {
    font-size: 56px;
    color: var(--app-tertiary-label);
    margin-bottom: 16px;
    opacity: 0.6;
}

.app-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--app-label);
    margin-bottom: 6px;
}

.app-empty-text {
    font-size: 14px;
    margin-bottom: 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ============================================================
   34. ANIMATIONS
   ============================================================ */
@keyframes app-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes app-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

@keyframes app-slide-down {
    from { transform: translateY(-20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

@keyframes app-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

@keyframes app-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

.app-animate-fade       { animation: app-fade-in var(--app-duration-base) var(--app-ease-out); }
.app-animate-slide-up   { animation: app-slide-up var(--app-duration-base) var(--app-ease-out); }
.app-animate-slide-down { animation: app-slide-down var(--app-duration-base) var(--app-ease-out); }
.app-animate-pulse      { animation: app-pulse 2s ease-in-out infinite; }
.app-animate-bounce     { animation: app-bounce 1s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   35. JS INTEGRATION HOOKS
   State classes yang dikendalikan index.js
   ============================================================ */

/* Global scroll lock */
body.app-no-scroll { overflow: hidden; }

/* Dropdown visibility */
.app-dropdown-menu {
    visibility: hidden;
}

.app-dropdown.open .app-dropdown-menu {
    visibility: visible;
}

/* Modal visibility */
.app-modal-backdrop {
    visibility: hidden;
}

.app-modal-backdrop.active {
    visibility: visible;
}

/* Sheet visibility */
.app-sheet-backdrop,
.app-sheet {
    visibility: hidden;
}

.app-sheet-backdrop.active,
.app-sheet.active {
    visibility: visible;
}

/* Sidenav animation */
.app-sidenav {
      flex-shrink: 0;
    will-change: transform;
     width: 280px;
}

.app-sidenav-overlay {
    will-change: opacity;
}

/* Pagination */
.app-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 16px 0;
    flex-wrap: wrap;
}

.app-pagination-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--app-radius-sm);
    background: transparent;
    border: none;
    color: var(--app-label);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--app-duration-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.app-pagination-btn:hover:not(:disabled) {
    background: rgba(0, 122, 255, 0.08);
}

.app-pagination-btn.active {
    background: var(--app-blue);
    color: white;
}

.app-pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Bulk actions bar */
.app-bulk-actions {
    position: fixed;
    bottom: calc(var(--app-tab-bar-height) + 16px);
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: rgba(30, 30, 32, 0.96);
    color: white;
    padding: 10px 16px;
    border-radius: var(--app-radius-full);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--app-shadow-lg);
    backdrop-filter: blur(20px);
    z-index: var(--app-z-toast);
    opacity: 0;
    transition: all var(--app-duration-base) var(--app-ease-spring);
}

.app-bulk-actions.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ============================================================
   36. RESPONSIVE
   ============================================================ */

/* Small phones */
@media (max-width: 480px) {
    body {
        padding-bottom: var(--app-tab-bar-height-sm);
    }

    .app-tab-bar {
        padding: 6px 8px 10px;
    }

    .app-tab-link .material-symbols-outlined { font-size: 20px; }
    .app-tab-link .app-tab-label { font-size: 9px; }

    .app-grid-cols-2,
    .app-grid-cols-3,
    .app-grid-cols-4 {
        grid-template-columns: 1fr;
    }

    .app-page-title { font-size: 22px; }
}

/* Tablets & phones */
@media (max-width: 768px) {
    .app-sidenav {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        z-index: var(--app-z-sidenav);
        height: 100vh;
    }

    .app-sidenav.open {
        transform: translateX(0);
    }

    .app-menu-toggle { display: block; }

    .app-content { padding: 16px; }

    .app-user-name { display: none; }
    .app-logout-btn span { display: none; }
    .app-logout-btn { padding: 8px; }

    .app-grid-cols-3,
    .app-grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .app-modal { max-width: 90%; }

    .app-toast-container {
        bottom: calc(var(--app-tab-bar-height-sm) + 12px);
        left: 16px;
        right: 16px;
        transform: none;
        width: auto;
    }
}

/* Desktop */
@media (min-width: 769px) {
    .app-tab-bar { display: none; }
    .app-menu-toggle { display: none; }
    .app-sidenav-overlay { display: none; }
    body { padding-bottom: 0; }

    .app-mobile-only { display: none; }
}

/* Print */
@media print {
    .app-sidenav,
    .app-navbar,
    .app-tab-bar,
    .app-sidenav-overlay,
    .app-toast-container,
    .app-menu-toggle {
        display: none !important;
    }

    body {
        padding: 0;
        background: white;
    }

    .app-card,
    .app-stat-card {
        border: 1px solid #ccc;
        box-shadow: none;
        break-inside: avoid;
    }
}

/* ============================================================
   37. DARK MODE
   ============================================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --app-bg: #000000;
        --app-secondary-bg: #1c1c1e;
        --app-tertiary-bg: #2c2c2e;
        --app-quaternary-bg: #1a1a1c;

        --app-label: #ffffff;
        --app-secondary-label: #ebebf5;
        --app-tertiary-label: #8e8e93;
        --app-quaternary-label: #48484a;

        --app-separator: #38383a;
        --app-separator-opaque: #2c2c2e;

        --app-blue: #0a84ff;
        --app-green: #30d158;
        --app-red: #ff453a;
        --app-orange: #ff9f0a;

        --app-blur-light: rgba(28, 28, 30, 0.72);
        --app-blur-tab: rgba(28, 28, 30, 0.94);
        --app-overlay: rgba(0, 0, 0, 0.5);

        --app-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
        --app-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
        --app-shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
        --app-shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.6);
    }

    .app-navbar {
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    .app-tab-bar {
        border-top-color: rgba(255, 255, 255, 0.08);
    }

    .app-info-box {
        background: #1a1a1c;
    }

    .app-info-row {
        border-bottom-color: #2c2c2e;
    }
}

/* Manual dark mode */
.app-dark {
    --app-bg: #000000;
    --app-secondary-bg: #1c1c1e;
    --app-tertiary-bg: #2c2c2e;
    --app-label: #ffffff;
    --app-secondary-label: #ebebf5;
    --app-separator: #38383a;
    --app-blur-light: rgba(28, 28, 30, 0.72);
    --app-blur-tab: rgba(28, 28, 30, 0.94);
}

/* ============================================================
   38. SAFE AREA
   ============================================================ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: calc(var(--app-tab-bar-height) + env(safe-area-inset-bottom));
    }

    .app-sidenav {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .app-tab-bar {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    .app-toast-container {
        bottom: calc(var(--app-tab-bar-height) + env(safe-area-inset-bottom) + 16px);
    }

    .app-bulk-actions {
        bottom: calc(var(--app-tab-bar-height) + env(safe-area-inset-bottom) + 16px);
    }

    .app-camera-bottombar,
    .app-camera-preview-actions {
        padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    }
}
/* ============================================================
   40. STORY MODAL (viewer)
   ============================================================ */
.app-story-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    visibility: hidden;
}

.app-story-modal.active {
    display: flex;
    visibility: visible;
}

.app-story-modal-content {
    position: relative;
    width: 100%;
    max-width: 450px;
    height: 100%;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    background: #000;
}

@media (min-width: 576px) {
    .app-story-modal-content {
        border-radius: 16px;
        height: 85vh;
    }
}

.app-story-modal-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 16px 10px 16px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), rgba(0,0,0,0));
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
    color: #fff;
}

.app-story-modal-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.app-story-modal-meta { flex: 1; }

.app-story-modal-name {
    font-size: 14px;
    font-weight: 600;
}

.app-story-modal-time {
    font-size: 11px;
    color: #ccc;
}

.app-story-modal-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-story-modal-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-story-modal-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ============================================================
   41. HEADER / SHELL UTILITY
   Class yang dipakai header.php / footer.php
   ============================================================ */

/* Navbar height sudah di token */
:root {
    --app-navbar-height: 56px;
}

/* Body padding bottom default (biar tidak ketiban tab bar) */
body {
    padding-bottom: var(--app-tab-bar-height);
}

.app-content,
.app-dashboard-main {
    min-width: 0;          /* ← KUNCI */
}
/* Dashboard main content (alias .app-content) */
.app-dashboard-main {
    flex: 1;
    padding: 20px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .app-dashboard-main {
        padding: 16px;
    }
}

/* Stats grid (khusus dashboard) */
.app-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* Dashboard sections (2 kolom konten) */
.app-dashboard-sections {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .app-dashboard-sections {
        grid-template-columns: 1fr;
    }
}

/* Activity list (legacy, mungkin masih dipakai) */
.app-activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.app-activity-list li {
    padding: 12px 0;
    border-bottom: 0.5px solid var(--app-separator);
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-activity-list li:last-child {
    border-bottom: none;
}

/* Jadwal table (legacy) */
.app-jadwal-table {
    width: 100%;
    border-collapse: collapse;
}

.app-jadwal-table th,
.app-jadwal-table td {
    padding: 10px 0;
    border-bottom: 0.5px solid var(--app-separator);
    text-align: left;
}

/* Footer (madrasah) */
.app-footer {
    background: var(--app-secondary-bg);
    border-top: 0.5px solid var(--app-separator);
    padding: 20px 24px;
    text-align: center;
    font-size: 12px;
    color: var(--app-secondary-label);
    margin-top: auto;
}

.app-footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.app-footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.app-footer-links a {
    color: var(--app-blue);
    font-size: 12px;
}

/* Sembunyikan tab bar di desktop */
@media (min-width: 769px) {
    .app-tab-bar {
        display: none !important;
    }

    body {
        padding-bottom: 0 !important;
    }
}

/* Tab bar show di mobile */
@media (max-width: 768px) {
    .app-tab-bar {
        display: block;
    }

    body {
        padding-bottom: var(--app-tab-bar-height) !important;
    }
}

@media (max-width: 480px) {
    body {
        padding-bottom: var(--app-tab-bar-height-sm) !important;
    }
}

/* Stats card (dari header lama) */
.app-stat-card .app-stat-number {
    font-size: 34px;
    font-weight: 700;
    margin-top: 4px;
}

.app-stat-card .app-stat-icon {
    font-size: 32px;
    color: var(--app-green);
}

/* Tab bar (bottom nav) - sudah ada di app.css, tapi kalau perlu override */
.app-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--app-blur-tab);
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    border-top: 0.5px solid rgba(0, 0, 0, 0.08);
    z-index: var(--app-z-tabbar);
    padding: 8px 12px 12px;
}

@media (min-width: 769px) {
    .app-tab-bar {
        max-width: 500px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 28px 28px 0 0;
    }
}

@media (max-width: 480px) {
    .app-tab-bar {
        padding: 6px 8px 10px;
    }
}

/* ============================================================
   42. FOOTER & TAB BAR EXTRAS
   ============================================================ */

/* Menu toggle tab (tombol menu di tab bar) */
.app-menu-toggle-tab {
    /* sama seperti app-tab-link, tapi button */
    background: transparent;
    border: none;
    font-family: inherit;
    cursor: pointer;
}

/* Tab bar: pastikan semua item align */
.app-tab-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.app-tab-item {
    /* sudah ada di app.css, pastikan li tidak punya bullet */
    list-style: none;
}

/* Footer links */
.app-footer-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.app-footer-links a {
    color: var(--app-blue);
    font-size: 12px;
    text-decoration: none;
}

.app-footer-links a:hover {
    text-decoration: underline;
}

/* Sembunyikan tab bar di desktop */
@media (min-width: 769px) {
    .app-tab-bar {
        display: none !important;
    }
}

/* ============================================================
   43. PRESENSI PAGE — Card List
   ============================================================ */

/* Card body dengan border-bottom (pemisah dalam card) */
.app-card-body + .app-card-body {
    border-top: 0.5px solid var(--app-separator);
}

/* Schedule list wrapper */
.app-schedule-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Block button (full width) */
.app-btn-block {
    width: 100%;
}

/* Badge yang konsisten */
.app-badge-primary {
    background: rgba(0, 122, 255, 0.12);
    color: var(--app-blue);
}

.app-badge-success {
    background: rgba(52, 199, 89, 0.12);
    color: var(--app-green);
}

/* ============================================================
   44. INFAL — Schedule Grid
   ============================================================ */

/* Grid untuk kartu jadwal */
.app-grid-schedule {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

/* List item (link dengan chevron) */
.app-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 0.5px solid var(--app-separator);
    text-decoration: none;
    color: var(--app-label);
    transition: background 0.15s;
    cursor: pointer;
}

.app-list-item:last-child {
    border-bottom: none;
}

.app-list-item:active {
    background: #f5f5f7;
}

/* Text colors (pakai app-text-*) */
.app-text-uppercase {
    text-transform: uppercase;
}

/* ============================================================
   45. FILE UPLOAD
   ============================================================ */
.app-file-upload {
    border: 1px dashed var(--app-separator);
    border-radius: var(--app-radius-md);
    padding: 12px;
    text-align: center;
    background: rgba(0, 122, 255, 0.02);
    transition: all var(--app-duration-fast);
}

.app-file-upload:hover {
    border-color: var(--app-blue);
    background: rgba(0, 122, 255, 0.04);
}

.app-file-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--app-blue);
    color: white;
    padding: 8px 16px;
    border-radius: var(--app-radius-full);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--app-duration-fast);
}

.app-file-label:active {
    background: #005fc1;
    transform: scale(0.97);
}

.app-file-name {
    font-size: 11px;
    color: var(--app-tertiary-label);
    margin-top: 8px;
}
/* ============================================================
   46. JADWAL — Today Schedule
   ============================================================ */

/* Row schedule: time badge + detail */
.app-schedule-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 0.5px solid var(--app-separator);
}

.app-schedule-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.app-schedule-row:first-child {
    padding-top: 0;
}

/* Time badge */
.app-badge-time {
    min-width: 70px;
    justify-content: center;
    text-align: center;
    padding: 4px 10px;
    border-radius: var(--app-radius-full);
    font-size: 13px;
    font-weight: 600;
}

/* ============================================================
   47. RIWAYAT PRESENSI — Student List Item
   ============================================================ */
.app-student-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 0.5px solid var(--app-separator);
    gap: 8px;
    flex-wrap: wrap;
}

.app-student-item:last-child {
    border-bottom: none;
}

.app-student-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--app-duration-fast);
}

.app-student-avatar.is-hadir     { background: rgba(52, 199, 89, 0.15);  color: var(--app-green); }
.app-student-avatar.is-sakit     { background: rgba(255, 149, 0, 0.15);  color: var(--app-orange); }
.app-student-avatar.is-izin      { background: rgba(255, 149, 0, 0.15);  color: var(--app-orange); }
.app-student-avatar.is-absen     { background: rgba(255, 59, 48, 0.15);  color: var(--app-red); }
.app-student-avatar.is-terlambat { background: rgba(0, 122, 255, 0.15);  color: var(--app-blue); }

.app-student-avatar .material-symbols-outlined {
    font-size: 18px;
}

.app-student-select {
    width: 85px;
    padding: 6px;
    font-size: 11px;
    height: 32px;
}

.app-student-note {
    flex: 1;
    min-width: 100px;
    padding: 6px;
    font-size: 11px;
    height: 32px;
}

/* Italic utility */
.app-text-italic {
    font-style: italic;
}
/* ============================================================
   47. STUDENT LIST ITEM (untuk daftar hadir)
   ============================================================ */
.app-student-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 0.5px solid var(--app-separator);
    transition: background var(--app-duration-fast);
}

.app-student-item:last-child {
    border-bottom: none;
}

.app-student-item:hover {
    background: rgba(0, 122, 255, 0.02);
}

/* Avatar dengan status warna */
.app-student-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--app-duration-base);
}

.app-student-avatar .material-symbols-outlined {
    font-size: 20px;
}

.app-student-avatar.is-hadir     { background: rgba(52, 199, 89, 0.15);  color: var(--app-green); }
.app-student-avatar.is-sakit     { background: rgba(255, 149, 0, 0.15);  color: var(--app-orange); }
.app-student-avatar.is-izin      { background: rgba(255, 149, 0, 0.15);  color: var(--app-orange); }
.app-student-avatar.is-absen     { background: rgba(255, 59, 48, 0.15);  color: var(--app-red); }
.app-student-avatar.is-terlambat { background: rgba(0, 122, 255, 0.15);  color: var(--app-blue); }

/* Info (nama + status) */
.app-student-info {
    flex: 1;
    min-width: 0;
}

/* Actions (select + note) */
.app-student-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.app-student-select {
    width: 90px;
    height: 34px;
    padding: 6px 8px;
    font-size: 12px;
    border-radius: var(--app-radius-sm);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 14px;
    padding-right: 24px;
    appearance: none;
}

.app-student-note {
    width: 100px;
    height: 34px;
    padding: 6px 8px;
    font-size: 12px;
    border-radius: var(--app-radius-sm);
}

/* Responsive: mobile, item jadi 2 baris */
@media (max-width: 480px) {
    .app-student-item {
        flex-wrap: wrap;
    }

    .app-student-info {
        flex: 1;
    }

    .app-student-actions {
        width: 100%;
        margin-top: 4px;
    }

    .app-student-select {
        flex: 1;
        width: auto;
    }

    .app-student-note {
        flex: 2;
        width: auto;
    }
}
/* ============================================================
   48. BUTTON & BADGE EXTRAS
   ============================================================ */

/* Button sizes */
.app-btn-sm {
    height: 32px;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: var(--app-radius-sm);
}

.app-btn-lg {
    height: 50px;
    padding: 14px 24px;
    font-size: 15px;
}

/* Badge variants yang dipakai di walikelas */
.app-badge-warning {
    background: rgba(255, 149, 0, 0.12);
    color: var(--app-orange);
}

.app-badge-danger {
    background: rgba(255, 59, 48, 0.12);
    color: var(--app-red);
}

/* Flex column utility */
.app-flex-col {
    flex-direction: column;
}

/* ============================================================
   50. SISWA — Class Grid & Student Card
   ============================================================ */

/* Grid untuk kartu kelas */
.app-class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.app-class-card {
    background: var(--app-secondary-bg);
    border-radius: var(--app-radius-md);
    border: 0.5px solid var(--app-separator);
    padding: 16px 8px;
    text-align: center;
    text-decoration: none;
    transition: all var(--app-duration-fast);
    display: block;
}

.app-class-card:active {
    transform: scale(0.96);
    background: var(--app-tertiary-bg);
}

.app-class-card h6 {
    font-size: 16px;
    font-weight: 600;
    color: var(--app-label);
    margin: 0;
}

/* Grid untuk kartu siswa */
.app-student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.app-student-card {
    background: var(--app-secondary-bg);
    border-radius: var(--app-radius-md);
    border: 0.5px solid var(--app-separator);
    overflow: hidden;
    text-align: center;
    transition: all var(--app-duration-fast);
}

.app-student-card:active {
    transform: scale(0.96);
}

.app-student-photo {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: var(--app-tertiary-bg);
    display: block;
}

.app-student-info {
    padding: 10px 8px;
    border-top: 0.5px solid var(--app-separator);
}

.app-student-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--app-label);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================================
   51. TAB & LIST — DISABLED STATE
   ============================================================ */

.app-list-item.is-disabled {
    pointer-events: none;
    opacity: 0.5;
}

/* Icon kecil di dalam badge */
.app-badge .material-symbols-outlined {
    font-size: 12px;
    vertical-align: middle;
    margin-right: 2px;
}

/* Tabs style improvement */
.app-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ============================================================
   52. CAMERA — Full Screen Portrait
   ============================================================ */

.app-camera {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    flex-direction: column;
    background: #000;
    color: #fff;
}

.app-camera.active {
    display: flex;
}

/* Follow light/dark mode */
@media (prefers-color-scheme: light) {
    .app-camera {
        background: #fff;
        color: #000;
    }
}

/* ----- Topbar ----- */
.app-camera-topbar {
    position: relative;
    padding: 16px;
    padding-top: calc(16px + env(safe-area-inset-top, 0px));
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    z-index: 10;
}

.app-camera-close {
    width: 40px;
    height: 40px;
    background: rgba(120, 120, 128, 0.2);
    border: none;
    border-radius: 50%;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}

.app-camera-close:active {
    transform: scale(0.9);
}

.app-camera-title {
    font-size: 15px;
    font-weight: 600;
}

.app-camera-spacer { width: 40px; }

/* ----- Stage (area kamera) ----- */
.app-camera-stage {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
}

@media (prefers-color-scheme: light) {
    .app-camera-stage {
        background: #1a1a1a; /* tetap hitam biar kontras */
    }
}

/* Viewfinder (WebcamJS target) */
.app-camera-viewfinder {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Force video biar full width (bukan 1/4) */
.app-camera-viewfinder video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

/* Override inline style WebcamJS */
.app-camera-viewfinder > div {
    width: 100% !important;
    height: 100% !important;
}

/* ----- Controls (tombol jepret) ----- */
.app-camera-controls {
    flex-shrink: 0;
    padding: 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
}

/* Tombol jepret bulat */
.app-camera-shutter {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.app-camera-shutter:active {
    transform: scale(0.92);
}

.app-camera-shutter-ring {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    border: 4px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    transition: all 0.15s;
}

.app-camera-shutter-dot {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: currentColor;
    transition: transform 0.15s;
}

.app-camera-shutter:active .app-camera-shutter-dot {
    transform: scale(0.85);
}
/* ============================================================
   52. CAMERA — Video 1/4 Layar
   ============================================================ */

.app-camera {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    flex-direction: column;
    background: #000;
    color: #fff;
}

.app-camera.active { display: flex; }

@media (prefers-color-scheme: light) {
    .app-camera {
        background: #fff;
        color: #000;
    }
}

/* ----- Topbar (kecil, biar tidak makan tempat) ----- */
.app-camera-topbar {
    flex-shrink: 0;
    height: 56px;
    padding: 0 16px;
    padding-top: env(safe-area-inset-top, 0px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: calc(56px + env(safe-area-inset-top, 0px));
}

.app-camera-close {
    width: 36px;
    height: 36px;
    background: rgba(120, 120, 128, 0.2);
    border: none;
    border-radius: 50%;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-camera-close:active { transform: scale(0.9); }

.app-camera-title {
    font-size: 15px;
    font-weight: 600;
}

.app-camera-spacer { width: 36px; }

/* ============================================================
   A. KAMERA — 1/4 LAYAR (25vh)
   ============================================================ */
.app-camera-stage {
    flex-shrink: 0;
    position: relative;
    width: 100%;
    height: 25vh;                  /* ← KUNCI: 1/4 dari tinggi layar */
    background: #000;
    overflow: hidden;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.15);
}

@media (prefers-color-scheme: light) {
    .app-camera-stage {
        border-bottom-color: rgba(0, 0, 0, 0.1);
    }
}

.app-camera-viewfinder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.app-camera-viewfinder video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

.app-camera-viewfinder > div {
    width: 100% !important;
    height: 100% !important;
}

/* Timestamp overlay di video */
.app-camera-timestamp {
    position: absolute;
    left: 14px;
    bottom: 10px;
    z-index: 5;
    pointer-events: none;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
    line-height: 1.3;
}

.app-camera-ts-class {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.app-camera-ts-time {
    font-size: 12px;
    font-weight: 600;
    color: #ff9500;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   B + C. AREA KOSONG (3/4 layar) + TOMBOL JEPRET
   ============================================================ */
.app-camera-controls {
    flex: 1;                        /* ← ambil sisa 3/4 layar */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

/* Tombol jepret bulat */
.app-camera-shutter {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.app-camera-shutter:active { transform: scale(0.92); }

.app-camera-shutter-ring {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    border: 4px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.app-camera-shutter-dot {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: currentColor;
    transition: transform 0.15s;
}

.app-camera-shutter:active .app-camera-shutter-dot {
    transform: scale(0.85);
}

/* ============================================================
   53. PWA INSTALL BANNER
   ============================================================ */
.app-pwa-banner {
    display: none;
    position: fixed;
    bottom: calc(var(--app-tab-bar-height) + 16px);
    left: 16px;
    right: 16px;
    max-width: 400px;
    margin: 0 auto;
    padding: 14px 16px;
    border: 0.5px solid var(--app-separator);
    border-radius: var(--app-card-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    align-items: center;
    gap: 12px;
    z-index: 9998;
    animation: pwaBannerSlide 0.3s ease-out;
}

.app-pwa-banner.show {
    display: flex;
}

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

.app-pwa-banner .material-symbols-outlined {
    font-size: 28px;
    color: var(--app-blue);
    flex-shrink: 0;
}

.app-pwa-banner-text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: var(--app-secondary-label);
    line-height: 1.3;
}

.app-pwa-banner-text strong {
    color: var(--app-label);
    display: block;
    font-size: 14px;
    margin-bottom: 2px;
}

.app-pwa-banner-btn {
    padding: 8px 16px;
    background: var(--app-blue);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.app-pwa-banner-btn:active {
    background: #005fc1;
    transform: scale(0.97);
}

/* Sembunyikan banner di desktop (karena tab bar hilang) */
@media (min-width: 769px) {
    .app-pwa-banner {
        bottom: 16px;
    }
}

.app-struktur-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
gap: 12px;
}

.app-struktur-card {
margin-bottom: 0;
padding: 20px 14px;
text-align: center;
}

/* Kepala Madrasah menonjol — full width di mobile, lebih tinggi di desktop */
.app-struktur-kepala {
grid-column: 1 / -1;
border: 2px solid var(--app-green);
background: linear-gradient(180deg, rgba(52,199,89,0.06), var(--app-secondary-bg));
}
.app-walikelas-slider {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px 4px 12px;
    scrollbar-width: none;
}
.app-walikelas-slider::-webkit-scrollbar { display: none; }

.app-walikelas-card {
    flex: 0 0 auto;
    width: 180px;
    scroll-snap-align: start;
    margin-bottom: 0;
    padding: 18px 14px;
}
