:root {
    --bg: #f7f4ed;
    --bg-soft: #fff8ef;
    --panel: rgba(255, 255, 255, 0.88);
    --panel-strong: #ffffff;
    --border: rgba(33, 46, 61, 0.12);
    --text: #203044;
    --muted: #65758b;
    --accent: #ff7043;
    --accent-2: #14b8a6;
    --accent-3: #4f46e5;
    --success: #14866d;
    --warning: #b78300;
    --danger: #d34444;
    --shadow: 0 16px 48px rgba(35, 48, 64, 0.12);
    --radius: 20px;
    --radius-sm: 14px;
    --transition: 180ms ease;
    --font: "Segoe UI", "Trebuchet MS", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

body {
    position: relative;
}

a {
    color: var(--accent-3);
    text-decoration: none;
}

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

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

.app-bg,
.guest-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at top left, rgba(255, 180, 120, 0.26), transparent 30%),
        radial-gradient(circle at bottom right, rgba(88, 198, 176, 0.24), transparent 36%),
        linear-gradient(180deg, #fcf9f1 0%, #f5efe4 100%);
}

.app-shell {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 20px;
    background: linear-gradient(180deg, rgba(32, 48, 68, 0.96), rgba(28, 41, 57, 0.94));
    color: #f5f8fb;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 24px;
    background: linear-gradient(135deg, #ff7043, #ffb36c);
    color: #fff;
    box-shadow: 0 10px 30px rgba(255, 112, 67, 0.35);
    animation: floaty 3.6s ease-in-out infinite;
}

.brand-title {
    font-size: 18px;
    font-weight: 800;
}

.brand-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar__link {
    color: rgba(255, 255, 255, 0.78);
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    gap: 12px;
    align-items: center;
    transition: background var(--transition), transform var(--transition), color var(--transition);
}

.sidebar__link::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffb36c, #14b8a6);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.06);
}

.sidebar__link:hover,
.sidebar__link.is-active {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(4px);
    color: #fff;
}

.sidebar__footer {
    margin-top: auto;
    display: grid;
    gap: 14px;
}

.user-chip {
    padding: 16px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    display: grid;
    gap: 6px;
}

.user-chip span {
    color: rgba(255, 255, 255, 0.72);
    font-size: 13px;
    word-break: break-word;
}

.user-chip-link {
    color: inherit;
    text-decoration: none;
    transition: all var(--transition);
    border-radius: var(--radius-sm);
    display: block;
}

.user-chip-link:hover .user-chip {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.main-content {
    min-width: 0;
    padding: 24px;
    display: grid;
    gap: 22px;
}

.topbar {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
}

.topbar__identity,
.topbar__actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.page-title {
    margin: 0;
    font-size: clamp(28px, 5vw, 36px);
    line-height: 1.1;
}

.page-subtitle {
    margin: 8px 0 0;
    color: var(--muted);
}

.nav-toggle {
    display: none;
    border: 0;
    background: var(--panel-strong);
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: var(--shadow);
}

.mobile-logout-form {
    display: none;
}

.topbar__logout {
    padding: 10px 14px;
    border-radius: 14px;
}

.panel {
    background: var(--panel);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 22px;
    overflow: hidden;
}

.panel--compact {
    padding: 18px;
}

.panel--nested {
    background: rgba(255, 255, 255, 0.76);
    box-shadow: none;
}

.panel--chat {
    min-height: 620px;
}

.panel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.panel__header--responsive {
    flex-wrap: wrap;
}

.panel__header h2,
.panel__header h3 {
    margin: 0;
}

.panel__footer {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid rgba(32, 48, 68, 0.08);
}

.grid {
    display: grid;
    gap: 18px;
}

.grid--stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid--two-chat {
    grid-template-columns: minmax(0, 1.8fr) minmax(320px, 0.9fr);
}

.stat-card {
    padding: 22px;
    border-radius: 22px;
    color: #173046;
    box-shadow: var(--shadow);
    display: grid;
    gap: 12px;
    min-height: 120px;
    animation: riseIn 420ms ease both;
}

.stat-card span {
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stat-card strong {
    font-size: clamp(28px, 4vw, 38px);
}

.stat-card--peach { background: linear-gradient(135deg, #ffd0b9, #fff1d7); }
.stat-card--mint { background: linear-gradient(135deg, #b6f0df, #e4fff6); }
.stat-card--blue { background: linear-gradient(135deg, #c6d4ff, #e8efff); }
.stat-card--yellow { background: linear-gradient(135deg, #ffe08c, #fff3cf); }
.stat-card--green { background: linear-gradient(135deg, #bdf3d3, #effff5); }
.stat-card--danger { background: linear-gradient(135deg, #ffb3ad, #ffe0d6); }

.chip-list,
.action-list,
.record-card__actions,
.record-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.action-list--wrap {
    justify-content: flex-end;
}

.chip {
    border-radius: 999px;
    padding: 10px 14px;
    background: rgba(79, 70, 229, 0.1);
    color: var(--accent-3);
    font-weight: 700;
}

.btn {
    appearance: none;
    border: 0;
    border-radius: 16px;
    padding: 12px 18px;
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 700;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #ff9f68);
    color: #fff;
    box-shadow: 0 10px 28px rgba(255, 112, 67, 0.3);
}

.btn-outline {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-danger {
    background: linear-gradient(135deg, #ec6464, #d34444);
    color: #fff;
}

.btn-text {
    background: transparent;
    color: var(--accent-3);
    padding-inline: 0;
}

.btn-block {
    width: 100%;
}

.field,
.inline-form,
.stack-md,
.stack-lg,
.stack-sm {
    display: grid;
    gap: 8px;
}

.stack-sm { gap: 6px; }
.stack-md { gap: 12px; }
.stack-lg { gap: 18px; }

.field label {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
}

.field input,
.field textarea,
.field select,
.inline-form input,
.inline-form select {
    width: 100%;
    border-radius: 14px;
    border: 1px solid rgba(32, 48, 68, 0.15);
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 14px;
    color: var(--text);
}

.field textarea {
    resize: vertical;
}

.form-grid,
.filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.field--full {
    grid-column: 1 / -1;
}

.filter-actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}

.table-wrap {
    width: 100%;
    overflow: auto hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.data-table th,
.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(32, 48, 68, 0.08);
    text-align: left;
    vertical-align: top;
}

.data-table th {
    background: rgba(255, 255, 255, 0.7);
    position: sticky;
    top: 0;
}

.responsive-cards {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.record-card,
.detail-card {
    border-radius: 20px;
    border: 1px solid rgba(32, 48, 68, 0.08);
    background: rgba(255, 255, 255, 0.8);
    padding: 18px;
    display: grid;
    gap: 12px;
}

.record-card__top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.record-card h3,
.detail-card strong {
    margin: 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.detail-card span {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.badge-muted { background: rgba(117, 133, 158, 0.15); color: #4e5f76; }
.badge-warning { background: rgba(255, 183, 0, 0.18); color: #8f6a00; }
.badge-success { background: rgba(20, 134, 109, 0.15); color: #0d7059; }
.badge-primary { background: rgba(79, 70, 229, 0.12); color: #473ed9; }
.badge-danger { background: rgba(211, 68, 68, 0.14); color: #b02d2d; }
.badge-secondary { background: rgba(32, 48, 68, 0.12); color: #203044; }

.empty-state,
.helper-text {
    color: var(--muted);
}

.timeline {
    display: grid;
    gap: 14px;
}

.timeline__item {
    border-left: 4px solid rgba(255, 112, 67, 0.45);
    background: rgba(255, 255, 255, 0.72);
    border-radius: 0 18px 18px 0;
    padding: 14px 16px;
}

.timeline__header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.chat-window {
    display: grid;
    gap: 14px;
    max-height: 720px;
    overflow-y: auto;
    padding-right: 4px;
}

.chat-bubble {
    max-width: min(100%, 680px);
    padding: 16px 18px;
    border-radius: 24px 24px 24px 6px;
    background: #fff;
    border: 1px solid rgba(32, 48, 68, 0.08);
    box-shadow: var(--shadow);
}

.chat-bubble--self {
    margin-left: auto;
    border-radius: 24px 24px 6px 24px;
    background: linear-gradient(135deg, #fff4ed, #fff);
}

.chat-bubble__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
}

.chat-image-link img {
    margin-top: 10px;
    border-radius: 18px;
    max-height: 280px;
    object-fit: cover;
}

.system-card {
    background: rgba(20, 184, 166, 0.08);
    border: 1px solid rgba(20, 184, 166, 0.16);
    border-radius: 18px;
    padding: 14px;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
}

.modal[hidden] {
    display: none;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(9, 16, 24, 0.48);
    backdrop-filter: blur(4px);
}

.modal__panel {
    position: relative;
    width: min(680px, calc(100vw - 28px));
    max-height: calc(100vh - 30px);
    overflow: auto;
    background: #fff;
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 22px;
}

.modal__panel--large {
    width: min(940px, calc(100vw - 28px));
}

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.icon-btn {
    border: 0;
    background: rgba(32, 48, 68, 0.08);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    cursor: pointer;
}

.log-entry {
    border-bottom: 1px solid rgba(32, 48, 68, 0.08);
    padding: 14px 0;
}

.log-entry__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-size: 13px;
}

.log-entry__json {
    margin-top: 10px;
    padding: 12px;
    border-radius: 16px;
    background: #f7f7fa;
    overflow: auto;
    font-size: 12px;
}

.material-search {
    position: relative;
}

.suggestion-list {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 6px);
    z-index: 5;
    display: none;
    background: #fff;
    border-radius: 16px;
    border: 1px solid rgba(32, 48, 68, 0.08);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.suggestion-list.is-open {
    display: block;
}

.suggestion-item {
    padding: 10px 12px;
    cursor: pointer;
}

.suggestion-item:hover {
    background: rgba(79, 70, 229, 0.08);
}

.material-request-list {
    display: grid;
    gap: 16px;
}

.material-request-item {
    border-radius: 20px;
    border: 1px solid rgba(32, 48, 68, 0.1);
    background: rgba(255, 255, 255, 0.9);
    padding: 16px;
    display: grid;
    gap: 14px;
}

.material-request-item__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.material-request-item__title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.material-request-item__grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(120px, 0.7fr) minmax(170px, 0.9fr);
    gap: 14px;
    align-items: start;
}

.material-request-item__field {
    margin: 0;
}

.material-request-item__field--material {
    min-width: 0;
}

.material-request-item .btn-text {
    padding: 6px 0;
}

.login-card {
    width: min(960px, calc(100vw - 32px));
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    align-items: stretch;
    gap: 24px;
    padding: 26px;
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow: var(--shadow);
}

.login-card__intro {
    border-radius: 24px;
    padding: 28px;
    background:
        radial-gradient(circle at top left, rgba(255, 112, 67, 0.28), transparent 34%),
        radial-gradient(circle at bottom right, rgba(20, 184, 166, 0.24), transparent 38%),
        linear-gradient(135deg, #203044, #2e425b);
    color: #fff;
    display: grid;
    align-content: center;
    gap: 16px;
}

.login-card__intro h1 {
    margin: 0;
    font-size: clamp(34px, 4vw, 48px);
}

.login-card__intro p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
}

.login-card__links {
    grid-column: 1 / -1;
    text-align: center;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-weight: 700;
}

.guest-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
}

.guest-main {
    width: 100%;
    display: grid;
    gap: 14px;
    justify-items: center;
}

.flash-stack {
    display: grid;
    gap: 10px;
}

.mobile-footer-nav {
    display: none;
}

.flash-stack--guest {
    width: min(960px, calc(100vw - 32px));
}

.flash {
    border-radius: 16px;
    padding: 12px 16px;
    font-weight: 700;
    border: 1px solid transparent;
}

.flash--success {
    background: rgba(20, 134, 109, 0.12);
    color: var(--success);
}

.flash--danger {
    background: rgba(211, 68, 68, 0.12);
    color: var(--danger);
}

.flash--info {
    background: rgba(79, 70, 229, 0.12);
    color: var(--accent-3);
}

.inline-form {
    grid-template-columns: minmax(0, 1fr) 160px;
    align-items: center;
    gap: 12px;
}

.inline-grid,
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.record-card p,
.timeline__item p {
    margin: 0;
}

/* ============================================
   GROUPED REPORT STYLES - DESKTOP & MOBILE
   ============================================ */

/* Desktop Grouped Report Table */
.grouped-report-table-wrapper {
    width: 100%;
    overflow: auto hidden;
}

.grouped-report-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.grouped-report-table th,
.grouped-report-table td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(32, 48, 68, 0.08);
    text-align: left;
    vertical-align: top;
}

.grouped-report-table th {
    background: rgba(255, 255, 255, 0.7);
    position: sticky;
    top: 0;
    font-weight: 700;
}

.req-row {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.5);
    transition: background var(--transition), box-shadow var(--transition);
}

.req-row:hover {
    background: rgba(79, 70, 229, 0.08);
}

.req-row.expanded {
    background: rgba(255, 112, 67, 0.05);
    font-weight: 600;
}

.expand-cell {
    width: 40px;
    text-align: center;
    padding: 14px 8px !important;
}

.chevron {
    display: inline-block;
    transition: transform var(--transition);
    font-size: 12px;
    color: var(--accent);
}

.req-row.expanded .chevron {
    transform: rotate(90deg);
}

.req-items-row {
    background: rgba(255, 255, 255, 0.3);
}

.req-items-row td {
    padding: 0 !important;
    border: none !important;
}

.items-container {
    padding: 16px;
}

.nested-items-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    overflow: hidden;
}

.nested-items-table th,
.nested-items-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(32, 48, 68, 0.1);
    text-align: left;
    font-size: 13px;
}

.nested-items-table th {
    background: rgba(79, 70, 229, 0.08);
    font-weight: 700;
    color: var(--text);
}

.nested-items-table tbody tr:last-child td {
    border-bottom: none;
}

.nested-items-table tbody tr:hover {
    background: rgba(255, 112, 67, 0.04);
}

/* Mobile Cards View */
.mobile-report-cards {
    display: none;
}

.req-card {
    border-radius: 18px;
    border: 1px solid rgba(32, 48, 68, 0.1);
    background: rgba(255, 255, 255, 0.95);
    padding: 16px;
    display: grid;
    gap: 14px;
    box-shadow: 0 4px 16px rgba(35, 48, 64, 0.1);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.card-req-no {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}

.card-date {
    font-size: 12px;
    color: var(--muted);
}

.card-info {
    display: grid;
    gap: 8px;
    padding: 12px 0;
    border-top: 1px solid rgba(32, 48, 68, 0.08);
    border-bottom: 1px solid rgba(32, 48, 68, 0.08);
}

.info-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}

.info-label {
    color: var(--muted);
    font-weight: 600;
    flex: 0 0 120px;
}

.info-value {
    color: var(--text);
    font-weight: 500;
    flex: 1;
    text-align: right;
}

.card-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    background: rgba(79, 70, 229, 0.05);
    padding: 12px;
    border-radius: 12px;
}

.summary-item {
    display: grid;
    gap: 4px;
}

.summary-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.summary-value {
    font-size: 14px;
    font-weight: 800;
    color: var(--accent-3);
}

.card-items-toggle {
    padding: 0;
}

.items-toggle-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(32, 48, 68, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--text);
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    transition: background var(--transition), border-color var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.items-toggle-btn:hover {
    background: rgba(79, 70, 229, 0.08);
    border-color: rgba(79, 70, 229, 0.2);
}

.toggle-icon {
    display: inline-block;
    transition: transform var(--transition);
    font-size: 12px;
}

.card-items {
    padding: 0;
    transition: max-height var(--transition), opacity var(--transition), padding var(--transition);
}

.card-items.open {
    padding: 12px 0;
}

.items-list {
    display: grid;
    gap: 10px;
}

.item-entry {
    border-left: 4px solid rgba(255, 112, 67, 0.3);
    background: rgba(255, 255, 255, 0.8);
    border-radius: 0 12px 12px 0;
    padding: 10px 12px;
    display: grid;
    gap: 6px;
}

.item-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.item-details {
    display: grid;
    gap: 4px;
    font-size: 12px;
}

.item-detail {
    color: var(--muted);
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.item-detail strong {
    color: var(--text);
}

.item-status {
    font-size: 11px;
    color: var(--muted);
}

.badge--sm {
    padding: 4px 8px;
    font-size: 10px;
}

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

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

@media (max-width: 1200px) {
    .grid--stats,
    .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .grid--two,
    .grid--two-chat,
    .login-card,
    .form-grid,
    .filter-grid,
    .detail-grid,
    .material-request-item__grid {
        grid-template-columns: 1fr;
    }

    /* Hide desktop grouped table, show mobile cards */
    .grouped-report-table-wrapper {
        display: none;
    }

    .mobile-report-cards {
        display: grid;
        gap: 14px;
    }

    .grid--stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 12px;
    }

    .stat-card {
        padding: 16px 12px;
        border-radius: 16px;
        gap: 8px;
        min-height: 92px;
    }

    .stat-card span {
        font-size: 11px;
        letter-spacing: 0.05em;
    }

    .stat-card strong {
        font-size: clamp(18px, 3vw, 24px);
        line-height: 1;
    }

    .main-content {
        padding: 18px 18px 112px;
        gap: 18px;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 20;
        padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
        border-radius: 18px;
        border: 1px solid rgba(32, 48, 68, 0.08);
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(14px);
        box-shadow: 0 12px 34px rgba(35, 48, 64, 0.1);
    }

    .topbar__identity {
        min-width: 0;
        flex: 1;
    }

    .page-subtitle {
        display: none;
    }

    .page-title {
        font-size: clamp(22px, 4.5vw, 28px);
    }

    .nav-toggle {
        display: none;
    }

    .mobile-logout-form {
        display: block;
    }

    .mobile-footer-nav {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 22;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
        background: linear-gradient(180deg, rgba(247, 244, 237, 0.08), rgba(247, 244, 237, 0.92) 24%, rgba(247, 244, 237, 0.98) 100%);
        backdrop-filter: blur(12px);
    }

    .mobile-footer-nav__track {
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding: 8px;
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.94);
        border: 1px solid rgba(32, 48, 68, 0.08);
        box-shadow: 0 16px 34px rgba(35, 48, 64, 0.12);
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .mobile-footer-nav__track::-webkit-scrollbar {
        display: none;
    }

    .mobile-footer-nav__link {
        flex: 0 0 auto;
        min-width: 84px;
        display: grid;
        justify-items: center;
        gap: 6px;
        padding: 10px 12px;
        border-radius: 16px;
        color: var(--muted);
        text-align: center;
        font-size: 11px;
        font-weight: 700;
        line-height: 1.15;
        transition: background var(--transition), color var(--transition), transform var(--transition);
    }

    .mobile-footer-nav__link.is-active {
        background: rgba(79, 70, 229, 0.12);
        color: var(--accent-3);
    }

    .mobile-footer-nav__dot {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: linear-gradient(135deg, #ffb36c, #14b8a6);
        box-shadow: 0 0 0 5px rgba(20, 184, 166, 0.08);
    }
}

/* ============================================
   PROFILE PAGE STYLES
   ============================================ */

.profile-container {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    gap: 24px;
}

.profile-header {
    background: var(--panel-strong);
    border-radius: var(--radius);
    padding: 32px 28px;
    display: flex;
    align-items: center;
    gap: 24px;
    box-shadow: var(--shadow);
}

.profile-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    font-weight: 800;
    flex-shrink: 0;
}

.profile-header-info h1 {
    margin: 0;
    font-size: 24px;
    color: var(--text);
}

.profile-email {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.profile-role {
    margin: 8px 0 0;
    color: var(--accent);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.profile-section {
    background: var(--panel-strong);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow);
}

.profile-section--info {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), rgba(20, 184, 166, 0.05));
}

.section-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border);
}

.section-header h2 {
    margin: 0 0 4px;
    font-size: 20px;
    color: var(--text);
}

.section-subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

.profile-form {
    display: grid;
    gap: 18px;
}

.form-group {
    display: grid;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.form-control {
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 112, 67, 0.1);
}

.form-control--disabled {
    background: rgba(32, 48, 68, 0.04);
    color: var(--muted);
    cursor: not-allowed;
}

.form-control--disabled:focus {
    border-color: var(--border);
    box-shadow: none;
}

.form-text {
    font-size: 12px;
    color: var(--muted);
}

.btn {
    padding: 11px 16px;
    border: 0;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #ff9f68);
    color: white;
    box-shadow: 0 10px 28px rgba(255, 112, 67, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(255, 112, 67, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-block {
    width: 100%;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    width: fit-content;
}

.badge-success {
    background: rgba(20, 134, 109, 0.1);
    color: var(--success);
}

.badge-danger {
    background: rgba(211, 68, 68, 0.1);
    color: var(--danger);
}

/* Tablet */
@media (max-width: 980px) {
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Mobile */
@media (max-width: 680px) {
    .main-content {
        padding: 14px 14px 108px;
    }

    .panel {
        padding: 16px;
        border-radius: 18px;
    }

    .grid--stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .stat-card {
        padding: 12px 10px;
        border-radius: 14px;
        min-height: 82px;
    }

    .stat-card span {
        font-size: 10px;
        letter-spacing: 0.04em;
    }

    .stat-card strong {
        font-size: clamp(16px, 5vw, 20px);
    }

    .record-card__top,
    .timeline__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .table-wrap {
        overflow: visible;
    }

    .data-table {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        min-width: auto;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .data-table tr {
        display: grid;
        gap: 16px;
        padding: 14px;
        background: var(--panel);
        border-radius: 12px;
        border: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }

    .data-table td {
        border: none;
        padding: 0;
        display: grid;
        grid-template-columns: 100px 1fr;
        gap: 8px;
        align-items: center;
    }

    .data-table td::before {
        font-weight: 600;
        font-size: 12px;
        color: var(--muted);
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .data-table td:nth-child(1)::before { content: "Material"; }
    .data-table td:nth-child(2)::before { content: "Requested"; }
    .data-table td:nth-child(3)::before { content: "Revised"; }
    .data-table td:nth-child(4)::before { content: "Issued"; }
    .data-table td:nth-child(5)::before { content: "Rejected"; }
    .data-table td:nth-child(6)::before { content: "Status"; }
    .data-table td:nth-child(7)::before { content: "Action"; }

    .inline-form {
        grid-template-columns: 1fr;
    }

    .topbar {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding-inline: 12px;
        border-radius: 16px;
    }

    .material-request-list {
        gap: 12px;
    }

    .material-request-item {
        padding: 14px;
        border-radius: 16px;
        gap: 12px;
    }

    .material-request-item__head {
        align-items: flex-start;
    }

    .material-request-item__grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 12px;
    }

    .material-request-item__field--material {
        grid-column: 1 / -1;
    }

    .topbar__identity,
    .topbar__actions {
        gap: 10px;
    }

    .topbar__logout {
        padding: 9px 12px;
        font-size: 12px;
    }

    .mobile-footer-nav {
        padding-inline: 10px;
    }

    .mobile-footer-nav__track {
        gap: 8px;
        padding: 7px;
        border-radius: 18px;
    }

    .mobile-footer-nav__link {
        min-width: 78px;
        padding: 9px 10px;
        font-size: 10px;
    }

    .material-request-item__grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .material-request-item__head {
        flex-direction: column;
        align-items: flex-start;
    }

    .profile-container {
        gap: 16px;
    }

    .profile-header {
        padding: 20px 16px;
        gap: 16px;
    }

    .profile-avatar {
        width: 70px;
        height: 70px;
        font-size: 32px;
    }

    .profile-header-info h1 {
        font-size: 18px;
    }

    .profile-section {
        padding: 20px 16px;
    }

    .section-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .section-header h2 {
        font-size: 18px;
    }

    .profile-form {
        gap: 14px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .btn-lg {
        padding: 12px 18px;
        font-size: 14px;
    }
}
