/* Qawim — minimalist green + white theme, mobile-first */

:root {
    --qw-green:        #2E7D32;
    --qw-green-light:  #66BB6A;
    --qw-green-tint:   #E8F5E9;
    --qw-white:        #FFFFFF;
    --qw-text:         #1B1B1B;
    --qw-muted:        #6B7280;
    --qw-border:       #E5E7EB;
    --qw-red:          #C62828;
    --qw-red-tint:     #FDECEA;
    --qw-amber-tint:   #FFF8E1;
    --qw-radius:       8px;
    --qw-shadow:       0 1px 2px rgba(0,0,0,0.04);
    --qw-max-width:    1200px;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--qw-white);
    color: var(--qw-text);
    font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Sticky-footer layout: header + main + footer in a flex column at full viewport height */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.qw-nav    { flex-shrink: 0; }
.qw-footer { flex-shrink: 0; }

h1, h2, h3, h4 { color: var(--qw-text); font-weight: 600; margin: 0 0 12px; }
h1 { font-size: 24px; }
h2 { font-size: 20px; margin-top: 24px; }
h3 { font-size: 16px; }
p  { margin: 0 0 12px; }
a  { color: var(--qw-green); text-decoration: none; }
a:hover { text-decoration: underline; }

.qw-muted { color: var(--qw-muted); }

/* ----- Navbar ----- */
.qw-nav {
    background: var(--qw-white);
    border-bottom: 1px solid var(--qw-border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.qw-nav-inner {
    max-width: var(--qw-max-width);
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.qw-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--qw-text);
}
.qw-brand:hover { text-decoration: none; }
.qw-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}
.qw-brand-name { font-weight: 600; }
.qw-brand-sub {
    font-size: 12px;
    font-weight: 400;
    color: var(--qw-muted);
}
.qw-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--qw-radius);
    background: var(--qw-green);
    color: var(--qw-white);
    font-weight: 700;
}
.qw-nav-links { display: flex; gap: 16px; align-items: center; }
.qw-nav-links a:not(.qw-btn) { color: var(--qw-text); }
.qw-nav-links a:not(.qw-btn):hover { color: var(--qw-green); text-decoration: none; }
.qw-nav-page-link {
    padding: 6px 4px;
    border-bottom: 2px solid transparent;
    font-weight: 500;
}
.qw-nav-active {
    color: var(--qw-green) !important;
    border-bottom-color: var(--qw-green);
}

/* ----- Avatar dropdown ----- */
.qw-avatar-menu { position: relative; }
.qw-avatar-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--qw-border);
    background: var(--qw-green);
    color: var(--qw-white);
    cursor: pointer;
    padding: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 150ms ease;
}
.qw-avatar-btn:hover { border-color: var(--qw-green); }
.qw-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.qw-avatar-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--qw-white);
    border: 1px solid var(--qw-border);
    border-radius: var(--qw-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 160px;
    z-index: 200;
    overflow: hidden;
}
.qw-avatar-dropdown a {
    display: block;
    padding: 10px 16px;
    color: var(--qw-text);
    font-weight: 500;
}
.qw-avatar-dropdown a:hover { background: #F3F4F6; text-decoration: none; }
.qw-avatar-menu.qw-open .qw-avatar-dropdown { display: block; }

/* ----- Main container ----- */
.qw-main {
    max-width: var(--qw-max-width);
    width: 100%;
    margin: 0 auto;
    padding: 16px;
    flex: 1 0 auto;
}

/* ----- Buttons ----- */
.qw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--qw-radius);
    border: 1px solid transparent;
    font-size: 14px;
    white-space: nowrap;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
    background: transparent;
    color: var(--qw-text);
}
.qw-btn:hover { text-decoration: none; }
.qw-btn-primary {
    background: var(--qw-green);
    color: var(--qw-white);
    border-color: var(--qw-green);
}
.qw-btn-primary:hover { background: #256428; border-color: #256428; color: var(--qw-white); }
.qw-btn-secondary {
    background: var(--qw-muted);
    color: var(--qw-white);
    border-color: var(--qw-muted);
}
.qw-btn-secondary:hover { background: #555; }
.qw-btn-destructive {
    background: var(--qw-red);
    color: var(--qw-white);
    border-color: var(--qw-red);
}
.qw-btn-destructive:hover { background: #B71C1C; }
.qw-btn-block { display: flex; width: 100%; }
.qw-btn-lg { padding: 14px 20px; font-size: 16px; }
.qw-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ----- Cards ----- */
.qw-card {
    background: var(--qw-white);
    border: 1px solid var(--qw-border);
    border-radius: var(--qw-radius);
    padding: 16px;
    box-shadow: var(--qw-shadow);
    margin-bottom: 16px;
}

/* ----- Forms ----- */
.qw-field { margin-bottom: 16px; }
.qw-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}
.qw-field input[type=text],
.qw-field input[type=email],
.qw-field input[type=password],
.qw-field input[type=number],
.qw-field input[type=tel],
.qw-field input[type=time],
.qw-field input[type=file],
.qw-field textarea,
.qw-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--qw-border);
    border-radius: var(--qw-radius);
    background: var(--qw-white);
    color: var(--qw-text);
    font: inherit;
    transition: border-color 150ms ease;
}
.qw-field input:focus,
.qw-field textarea:focus,
.qw-field select:focus {
    outline: none;
    border-color: var(--qw-green);
}
.qw-required { color: var(--qw-red); }
.qw-help {
    font-size: 12px;
    color: var(--qw-muted);
    margin-top: 4px;
}
.qw-input-group { position: relative; display: flex; align-items: center; }
.qw-input-prefix {
    position: absolute;
    left: 12px;
    color: var(--qw-muted);
    pointer-events: none;
}
.qw-input-group input { padding-left: 36px; }

.qw-days { display: flex; flex-wrap: wrap; gap: 8px; }
.qw-day {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--qw-border);
    border-radius: 9999px;
    background: var(--qw-white);
    cursor: pointer;
    font-weight: 500;
}
.qw-day input { accent-color: var(--qw-green); }

.qw-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    cursor: pointer;
}
.qw-checkbox input { accent-color: var(--qw-green); margin-top: 3px; }

.qw-photo-preview { margin-top: 8px; }
.qw-photo-preview img {
    width: 120px;
    aspect-ratio: 3 / 4;
    object-fit: contain;
    border-radius: var(--qw-radius);
    border: 1px solid var(--qw-border);
    background: var(--qw-green-tint);
}

.qw-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* ----- Flash messages ----- */
.qw-flash {
    padding: 12px 16px;
    border-radius: var(--qw-radius);
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.qw-flash-success { background: var(--qw-green-tint); color: var(--qw-green); border-color: var(--qw-green); }
.qw-flash-error   { background: var(--qw-red-tint); color: var(--qw-red); border-color: var(--qw-red); }
.qw-flash ul { margin: 0; padding-left: 20px; }

/* ----- Auth pages ----- */
.qw-auth {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}
.qw-auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--qw-white);
    border: 1px solid var(--qw-border);
    border-radius: var(--qw-radius);
    padding: 32px 24px;
    box-shadow: var(--qw-shadow);
}
.qw-auth-alt { text-align: center; margin-top: 16px; }

/* ----- Guru Dashboard ----- */
.qw-profile-card .qw-profile-top {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-direction: column;
}
.qw-profile-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--qw-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--qw-muted);
    background: var(--qw-green-tint);
}
.qw-profile-photo-empty { background: var(--qw-green-tint); }
.qw-profile-info h2 { margin: 0; }
.qw-profile-actions {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.qw-profile-actions .qw-btn {
    min-width: 140px;
    text-align: center;
}

.qw-packages { display: grid; grid-template-columns: 1fr; gap: 16px; }
.qw-package-summary { list-style: none; padding: 0; margin: 0 0 12px; }
.qw-package-summary li { padding: 4px 0; }
.qw-package-actions { display: flex; gap: 8px; }
.qw-dashboard-footer { margin-top: 32px; text-align: center; }

/* ----- Badges ----- */
.qw-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--qw-border);
    background: var(--qw-white);
}
.qw-badge-ok      { background: var(--qw-green-tint); color: var(--qw-green); border-color: var(--qw-green); }
.qw-badge-pending { background: var(--qw-amber-tint); color: #B08600; border-color: #E0B000; }
.qw-badge-reject  { background: var(--qw-red-tint); color: var(--qw-red); border-color: var(--qw-red); }
.qw-badge-muted   { background: #F3F4F6; color: var(--qw-muted); }
.qw-reject-reason { color: var(--qw-red); font-size: 13px; margin-top: 4px; }

/* ----- Admin tabs and tables ----- */
.qw-admin-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--qw-border);
    margin-bottom: 16px;
}
.qw-admin-tabs a {
    flex: 1;
    padding: 10px 14px;
    color: var(--qw-muted);
    font-weight: 600;
    text-align: center;
    border-bottom: 2px solid transparent;
}
.qw-admin-tabs a:hover { color: var(--qw-text); text-decoration: none; }
.qw-admin-tabs a.active {
    color: var(--qw-green);
    border-bottom-color: var(--qw-green);
}

.qw-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--qw-white);
    border: 1px solid var(--qw-border);
    border-radius: var(--qw-radius);
    overflow: hidden;
}
.qw-table th, .qw-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--qw-border);
    vertical-align: top;
}
.qw-table th {
    background: #F9FAFB;
    font-weight: 600;
    color: var(--qw-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.qw-table tr:last-child td { border-bottom: none; }

.qw-inline-form { display: inline-block; margin-right: 4px; }
.qw-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--qw-radius);
    border: 1px solid var(--qw-border);
    background: var(--qw-white);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}
.qw-icon-approve { color: var(--qw-green); border-color: var(--qw-green); }
.qw-icon-approve:hover { background: var(--qw-green-tint); }
.qw-icon-reject  { color: var(--qw-red); border-color: var(--qw-red); }
.qw-icon-reject:hover  { background: var(--qw-red-tint); }

.qw-row-actions { white-space: nowrap; }
.qw-row-actions button { margin-right: 4px; padding: 6px 10px; border: 1px solid transparent; border-radius: var(--qw-radius); cursor: pointer; font-size: 13px; font-weight: 500; color: var(--qw-white); }
.qw-act-move { background: #1565C0; border-color: #1565C0; }
.qw-act-move:hover { background: #0D47A1; }
.qw-act-toggle { background: #F57C00; border-color: #F57C00; }
.qw-act-toggle:hover { background: #E65100; }
.qw-act-delete { background: var(--qw-red); border-color: var(--qw-red); }
.qw-act-delete:hover { background: #B71C1C; }

.qw-pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 16px;
}
.qw-pagination a {
    padding: 6px 12px;
    border: 1px solid var(--qw-border);
    border-radius: var(--qw-radius);
    color: var(--qw-text);
}
.qw-pagination a:hover { background: var(--qw-green-tint); text-decoration: none; }
.qw-page-current {
    background: var(--qw-green);
    color: var(--qw-white) !important;
    border-color: var(--qw-green);
}
.qw-page-disabled {
    padding: 6px 12px;
    border: 1px solid var(--qw-border);
    border-radius: var(--qw-radius);
    color: var(--qw-muted);
    cursor: default;
    opacity: 0.6;
}
.qw-page-ellipsis {
    padding: 6px 4px;
    color: var(--qw-muted);
}

/* ----- Review page ----- */
.qw-kv { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.qw-kv th, .qw-kv td { padding: 8px 12px; border-bottom: 1px solid var(--qw-border); text-align: left; vertical-align: top; }
.qw-kv th { width: 35%; color: var(--qw-muted); font-weight: 600; }
.qw-kv tr.qw-changed { background: var(--qw-amber-tint); }
.qw-review-photo { max-width: 200px; border-radius: var(--qw-radius); border: 1px solid var(--qw-border); }
.qw-review-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.qw-review-actions input[type=text] { padding: 8px 12px; border: 1px solid var(--qw-border); border-radius: var(--qw-radius); min-width: 240px; }

/* ----- Admin dashboard stats ----- */
.qw-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 24px 0 32px;
}
.qw-stat-card {
    background: var(--qw-white);
    border: 1px solid var(--qw-border);
    border-radius: var(--qw-radius);
    padding: 20px;
    box-shadow: var(--qw-shadow);
}
.qw-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--qw-green);
    line-height: 1.1;
}
.qw-stat-label {
    color: var(--qw-muted);
    font-size: 13px;
    margin-top: 6px;
}

/* ----- Admin dashboard recent activity ----- */
.qw-recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.qw-recent-header h2 { margin: 0; }
.qw-recent-header a { font-size: 13px; }
.qw-recent-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.qw-recent-list li {
    border-bottom: 1px solid var(--qw-border);
}
.qw-recent-list li:last-child { border-bottom: none; }
.qw-recent-list li a {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1.2fr auto;
    gap: 12px;
    padding: 12px 0;
    align-items: center;
    color: var(--qw-text);
}
.qw-recent-list li a:hover { text-decoration: none; background: #F9FAFB; }
.qw-recent-name { font-weight: 600; }
.qw-recent-type, .qw-recent-time { color: var(--qw-muted); font-size: 13px; }

@media (max-width: 639px) {
    .qw-recent-list li a {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "name badge"
            "type time";
        row-gap: 2px;
    }
    .qw-recent-name { grid-area: name; }
    .qw-recent-type { grid-area: type; }
    .qw-recent-time { grid-area: time; text-align: right; }
    .qw-recent-list li a .qw-badge { grid-area: badge; justify-self: end; }
}

/* ----- Form builder ----- */
.qw-field-builder { max-width: 600px; }
.qw-flags { display: flex; gap: 16px; flex-wrap: wrap; }
.qw-flags label { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.qw-settings { max-width: 720px; }
.qw-fb-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.qw-fb-header h1 { margin: 0; }

/* ----- Modal (native <dialog>) ----- */
dialog.qw-modal {
    width: 100%;
    max-width: 520px;
    border: 1px solid var(--qw-border);
    border-radius: var(--qw-radius);
    padding: 0;
    background: var(--qw-white);
    color: var(--qw-text);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
dialog.qw-modal::backdrop {
    background: rgba(0, 0, 0, 0.4);
}
.qw-modal-form {
    padding: 24px;
    max-height: 80vh;
    overflow-y: auto;
}
.qw-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -24px -24px 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--qw-border);
}
.qw-modal-header h2 { margin: 0; font-size: 18px; }
.qw-modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--qw-muted);
    padding: 4px 8px;
}
.qw-modal-close:hover { color: var(--qw-text); }
.qw-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin: 24px -24px -24px;
    padding: 16px 24px;
    border-top: 1px solid var(--qw-border);
}

.qw-confirm-box { text-align: center; }
.qw-confirm-box .qw-modal-header { justify-content: center; }
.qw-confirm-box p { margin: 16px 0; font-size: 15px; }
.qw-confirm-box .qw-modal-footer { justify-content: center; margin: 16px -24px -24px; }

.qw-terms-modal[open] { max-width: 640px; display: flex; flex-direction: column; max-height: 85vh; padding: 0; }
.qw-terms-header {
    background: var(--qw-green);
    color: var(--qw-white);
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}
.qw-terms-modal .qw-modal-form { flex: 1 1 auto; overflow-y: auto; }
.qw-terms-footer {
    display: flex;
    justify-content: center;
    padding: 16px 24px;
    border-top: 1px solid var(--qw-border);
    flex-shrink: 0;
}
.qw-terms-body { font-size: 14px; line-height: 1.8; }
.qw-terms-body h2 { font-size: 17px; margin: 20px 0 8px; }
.qw-terms-body h3 { font-size: 15px; margin: 16px 0 6px; }
.qw-terms-body hr { border: none; border-top: 1px solid var(--qw-border); margin: 16px 0; }
.qw-terms-body p { margin: 0 0 10px; }

/* ----- Confirm / destructive cards ----- */
.qw-confirm {
    display: flex;
    justify-content: center;
    padding: 40px 0;
}
.qw-confirm-card {
    width: 100%;
    max-width: 480px;
    padding: 32px;
}
.qw-confirm-destructive { border-color: var(--qw-red); }
.qw-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ----- Browse / public index ----- */
.qw-browse {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}
.qw-filters { order: 1; }
.qw-results { order: 2; }
.qw-filters h3 { border-bottom: 1px solid var(--qw-border); padding-bottom: 8px; }
.qw-filters form button { margin-right: 8px; }

.qw-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
}
.qw-package-item { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.qw-package-item > .qw-btn-block { margin-top: auto; }
.qw-package-item.qw-card { padding: 12px; gap: 6px; }
.qw-card-photo {
    display: block;
    width: auto;
    max-width: 100%;
    height: 220px;
    margin-left: auto;
    margin-right: auto;
    align-self: center;
    object-fit: contain;
    border-radius: var(--qw-radius);
    background: var(--qw-green-tint);
}
.qw-card-photo-empty {
    background: var(--qw-green-tint);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--qw-muted);
}
@media (min-width: 768px) {
    .qw-package-item.qw-card { padding: 16px; gap: 8px; }
    .qw-card-photo {
        width: 100%;
        height: auto;
        align-self: stretch;
        aspect-ratio: 1 / 1;
    }
}
.qw-card-mini .qw-card-photo {
    height: 70px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    background: transparent;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    align-self: center;
}
.qw-card-mini .qw-card-photo-empty { width: 70px; }
.qw-card-kelas { font-weight: 600; margin: 0; }
.qw-card-meta { list-style: none; padding: 0; margin: 0; color: var(--qw-muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; }
.qw-card-meta li::after { content: " · "; }
.qw-card-meta li:last-child::after { content: ""; }
.qw-card-price { font-weight: 700; color: var(--qw-green); margin: 4px 0; }

.qw-suggestion-section { margin-top: 32px; }
.qw-suggestion-form { max-width: 520px; }

/* ----- Detail ----- */
.qw-detail { max-width: 720px; margin: 0 auto; }
.qw-back { display: inline-block; margin-bottom: 16px; color: var(--qw-muted); }
.qw-detail-header { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.qw-detail-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--qw-border);
    background: var(--qw-green-tint);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: var(--qw-muted);
}
.qw-detail-photo-empty { background: var(--qw-green-tint); }
.qw-perihal { color: var(--qw-muted); }
.qw-detail-actions { display: flex; gap: 12px; justify-content: space-between; margin-top: 24px; flex-wrap: wrap; }

/* ----- Footer ----- */
.qw-footer {
    border-top: 1px solid var(--qw-border);
    padding: 24px 16px;
    margin-top: 48px;
    color: var(--qw-muted);
    text-align: center;
    font-size: 13px;
}
.qw-footer-inner { max-width: var(--qw-max-width); margin: 0 auto; }

/* ----- Hero (landing) ----- */
.qw-hero {
    text-align: center;
    padding: 48px 24px;
    background: var(--qw-green-tint);
    border-radius: 16px;
    border: 1px solid var(--qw-border);
}
.qw-hero h1 {
    font-size: 28px;
    margin-bottom: 16px;
    line-height: 1.25;
}
.qw-hero p.qw-hero-tagline {
    color: var(--qw-muted);
    font-size: 16px;
    max-width: 560px;
    margin: 0 auto 28px;
}
.qw-hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ----- Featured section (landing) ----- */
.qw-featured { margin-top: 56px; margin-bottom: 32px; }
.qw-featured h2 { margin-bottom: 20px; }
.qw-featured-footer { text-align: center; margin-top: 24px; }

/* ----- About page ----- */
.qw-about { max-width: 720px; margin: 0 auto; }
.qw-about h2 { margin-top: 24px; }
.qw-about ol { padding-left: 20px; }
.qw-about li { margin-bottom: 6px; }

/* ----- Cadangan page ----- */
.qw-cadangan { max-width: 560px; margin: 0 auto; }

/* ============================================================
   Admin shell — top bar + left sidebar + content
   ============================================================ */
.qw-admin-body { background: #F9FAFB; }
.qw-admin-topbar {
    background: var(--qw-white);
    border-bottom: 1px solid var(--qw-border);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}
.qw-admin-topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    max-width: none;
    position: relative;
}
.qw-admin-center-label {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 600;
    color: var(--qw-muted);
}
.qw-brand-name-short { display: none; }
.qw-admin-logout {
    display: inline-block;
    padding: 6px 14px;
    background: var(--qw-red);
    color: var(--qw-white);
    font-weight: 600;
    border-radius: var(--qw-radius);
}
.qw-admin-logout:hover { background: #B71C1C; color: var(--qw-white); text-decoration: none; }
.qw-admin-topbar-actions { display: flex; gap: 8px; align-items: center; }
.qw-admin-home {
    display: inline-block;
    padding: 6px 14px;
    border: 2px solid var(--qw-green);
    color: var(--qw-green);
    background: transparent;
    font-weight: 600;
    border-radius: var(--qw-radius);
    font-size: 14px;
}
.qw-admin-home:hover { background: var(--qw-green); color: var(--qw-white); text-decoration: none; }

.qw-admin-layout {
    display: grid;
    grid-template-columns: 1fr;       /* mobile: single column */
    flex: 1 0 auto;
    width: 100%;
}
.qw-admin-sidebar {
    display: none;                    /* hidden on mobile, bottom nav is used instead */
    background: var(--qw-white);
    border-right: 1px solid var(--qw-border);
    padding: 16px 0;
}
.qw-admin-sidebar nav {
    display: flex;
    flex-direction: column;
}
.qw-admin-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--qw-text);
    font-weight: 600;
    border-left: 3px solid transparent;
    transition: background-color 150ms ease, color 150ms ease, border-left-color 150ms ease;
}
.qw-admin-sidebar-link:hover {
    background: #F3F4F6;
    text-decoration: none;
}
.qw-admin-sidebar-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    font-size: 18px;
    color: var(--qw-muted);
}
.qw-admin-sidebar-active {
    background: var(--qw-green-tint);
    color: var(--qw-green) !important;
    border-left-color: var(--qw-green);
}
.qw-admin-sidebar-active .qw-admin-sidebar-icon { color: var(--qw-green); }

.qw-admin-content {
    background: var(--qw-white);
    padding: 24px 20px;
    min-width: 0;                     /* prevents grid blowout from wide tables */
}

/* ----- Bottom navigation (mobile only) ----- */
.qw-bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    background: var(--qw-white);
    border-top: 1px solid var(--qw-border);
    z-index: 200;
}
.qw-bottom-nav-inner {
    display: flex;
    height: 100%;
    max-width: var(--qw-max-width);
    margin: 0 auto;
}
.qw-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: var(--qw-muted);
    font-size: 11px;
    font-weight: 500;
    padding: 6px 4px;
    border-top: 2px solid transparent;
}
.qw-bottom-nav-item:hover { text-decoration: none; color: var(--qw-text); }
.qw-bottom-nav-item .qw-bn-icon {
    font-size: 18px;
    line-height: 1;
}
.qw-bottom-nav-item.qw-nav-active {
    color: var(--qw-green) !important;
    border-top-color: var(--qw-green);
}

/* ============================================================
   Desktop breakpoint — 1024px and above
   ============================================================ */
@media (min-width: 1024px) {
    .qw-main { padding: 24px; }

    .qw-profile-card .qw-profile-top { flex-direction: row; }
    .qw-profile-photo { width: 120px; height: 120px; font-size: 36px; }

    .qw-packages { grid-template-columns: 1fr 1fr; }

    .qw-browse {
        grid-template-columns: 260px 1fr;
    }
    .qw-filters {
        order: unset;
        position: sticky;
        top: 72px;
        align-self: start;
    }
    .qw-results { order: unset; }
    .qw-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .qw-form-page, .qw-settings, .qw-field-builder { max-width: 720px; }
}

/* ============================================================
   Tablet breakpoint — 768px to 1023px
   ============================================================ */
@media (min-width: 768px) and (max-width: 1023px) {
    .qw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .qw-packages { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Mobile breakpoint — below 768px (bottom nav appears)
   ============================================================ */
@media (max-width: 767px) {
    /* Hide full brand text on admin mobile — show short "Qawim" instead */
    .qw-admin-body .qw-brand-name { display: none; }
    .qw-admin-body .qw-brand-name-short { display: inline; position: static; transform: none; }
    .qw-admin-center-label { display: none; }

    /* Hide tab counts on mobile to save space */
    .qw-tab-count { display: none; }

    /* Top header on mobile shows brand + login only */
    .qw-nav-page-link { display: none; }

    /* Bottom navigation surfaces */
    .qw-bottom-nav { display: block; }

    /* Push body content above the bottom bar */
    body { padding-bottom: 64px; }
    .qw-footer { margin-bottom: 64px; }

    /* Hero tighter on mobile */
    .qw-hero { padding: 40px 20px; border-radius: 12px; }
    .qw-hero h1 { font-size: 28px; }
    .qw-featured { margin-top: 40px; }

    /* Form Builder table -> card stack on mobile */
    .qw-fb-table,
    .qw-fb-table thead,
    .qw-fb-table tbody,
    .qw-fb-table tr,
    .qw-fb-table td {
        display: block;
        width: 100%;
    }
    .qw-fb-table { border: none; }
    .qw-fb-table thead { display: none; }
    .qw-fb-table tbody { padding: 0; }
    .qw-fb-table tr {
        background: var(--qw-white);
        border: 1px solid var(--qw-border);
        border-radius: var(--qw-radius);
        padding: 16px;
        margin-bottom: 12px;
        box-shadow: var(--qw-shadow);
    }
    .qw-fb-table td {
        border: none;
        padding: 4px 0;
        text-align: left;
    }
    .qw-fb-hide-mobile { display: none !important; }
    .qw-fb-table td.qw-fb-title {
        font-size: 16px;
        font-weight: 700;
        padding: 0 0 8px;
        border-bottom: 1px solid var(--qw-border);
        margin-bottom: 8px;
    }
    .qw-fb-table td:not(.qw-fb-title):not(.qw-row-actions):not(.qw-fb-block) {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
    }
    .qw-fb-table td:not(.qw-fb-title):not(.qw-row-actions):not(.qw-fb-block)::before,
    .qw-fb-table td.qw-fb-block::before {
        content: attr(data-label);
        color: var(--qw-muted);
        font-size: 11px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    /* Block variant: label on top, value below — good for long multi-line content like Cadangan messages */
    .qw-fb-table td.qw-fb-block {
        display: block;
        padding: 8px 0;
    }
    .qw-fb-table td.qw-fb-block::before {
        display: block;
        margin-bottom: 4px;
    }
    .qw-fb-table td.qw-row-actions {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid var(--qw-border);
        display: flex;
        justify-content: center;
        gap: 4px;
        flex-wrap: nowrap;
    }
    .qw-fb-table td.qw-row-actions button { padding: 6px 8px; font-size: 12px; }
}

/* ============================================================
   Desktop breakpoint — bigger hero
   ============================================================ */
@media (min-width: 1024px) {
    .qw-hero { padding: 88px 32px; }
    .qw-hero h1 { font-size: 40px; }
    .qw-hero p.qw-hero-tagline { font-size: 17px; }
}

/* ============================================================
   Desktop breakpoint — admin sidebar surfaces (>=768px)
   ============================================================ */
@media (min-width: 768px) {
    .qw-admin-layout {
        grid-template-columns: 220px 1fr;
    }
    .qw-admin-sidebar {
        display: block;
        position: sticky;
        top: 57px;                    /* sit just below the topbar */
        align-self: start;
        height: calc(100vh - 57px);
        overflow-y: auto;
    }
    .qw-admin-content {
        padding: 32px;
    }
    /* Hide the admin/guru bottom nav on desktop — sidebar takes over */
    .qw-bottom-nav-admin,
    .qw-bottom-nav-guru { display: none !important; }
}

/* ----- Package carousel (teacher detail page) ----- */
.qw-pkg-indicator { text-align: center; margin: 8px 0 16px; }
.qw-pkg-carousel {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0;
}
.qw-pkg-slides { flex: 1; min-width: 0; }
.qw-pkg-slide { display: none; }
.qw-pkg-slide.is-active { display: block; }
.qw-pkg-prev,
.qw-pkg-next {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--qw-green);
    background: var(--qw-green);
    color: var(--qw-white);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.qw-pkg-prev:hover:not(:disabled),
.qw-pkg-next:hover:not(:disabled) { filter: brightness(0.92); }
.qw-pkg-prev:disabled,
.qw-pkg-next:disabled { opacity: 0.4; cursor: not-allowed; }
.qw-pkg-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
    margin-bottom: 16px;
}
.qw-pkg-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: var(--qw-border);
    cursor: pointer;
    padding: 0;
}
.qw-pkg-dot:hover { background: var(--qw-muted); }
.qw-pkg-dot.is-active { background: var(--qw-green); }

@media (max-width: 767px) {
    .qw-pkg-carousel {
        flex-direction: column;
        gap: 0;
    }
    .qw-pkg-carousel .qw-pkg-prev,
    .qw-pkg-carousel .qw-pkg-next {
        /* hide arrows on mobile — dots handle navigation */
        display: none;
    }
}

/* ----- Mini pakej carousel (landing page per-teacher card) ----- */
.qw-mini-carousel {
    position: relative;
    width: 100%;
}
.qw-mini-slides {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 0;
    scrollbar-width: none;
}
.qw-mini-slides::-webkit-scrollbar { display: none; }
.qw-mini-slide {
    flex-shrink: 0;
    width: 100%;
    scroll-snap-align: start;
    box-sizing: border-box;
    padding: 8px 4px;
}
.qw-mini-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 8px 0;
}
.qw-mini-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: var(--qw-border);
    cursor: pointer;
    padding: 0;
    transition: background 0.15s;
}
.qw-mini-dot:hover { background: var(--qw-muted); }
.qw-mini-dot.is-active { background: var(--qw-green); }

/* Pakej image on Cari Guru card (replaces kelas list when set) */
.qw-card-pakej-image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: contain;
    border-radius: var(--qw-radius);
    margin: 4px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.qw-card-pakej-image-empty {
    background: var(--qw-soft, #f4f6f5);
}

/* Pakej image on the package detail carousel slide (above qw-kv table) */
.qw-pkg-slide-image {
    display: block;
    max-width: 100%;
    max-height: 280px;
    margin: 0 auto 16px;
    border-radius: var(--qw-radius);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Honeypot — hidden to humans, visible to auto-fill bots */
.qw-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* ----- Overlay modal (iframe-based, used by admin View-as-Guru) ----- */
/* Prefixed qw-overlay-* to avoid colliding with the existing .qw-modal
   rules that target native <dialog class="qw-modal"> elements. */
.qw-overlay {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.qw-overlay.is-open { display: flex; }
.qw-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}
.qw-overlay-frame {
    position: relative;
    background: var(--qw-white);
    width: 90vw;
    height: 90vh;
    border-radius: var(--qw-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.qw-overlay-head {
    padding: 12px 16px;
    border-bottom: 1px solid var(--qw-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    background: var(--qw-white);
}
.qw-overlay-close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--qw-muted);
    padding: 0 4px;
}
.qw-overlay-close:hover { color: var(--qw-text); }
.qw-overlay-body {
    flex: 1;
    overflow: hidden;
}
.qw-overlay-body iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Nav items disabled in admin view-as-guru mode */
.qw-nav-disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* View-mode banner shown inside the impersonated dashboard */
.qw-view-mode-banner {
    background: var(--qw-amber-tint);
    padding: 8px 12px;
    text-align: center;
    font-size: 13px;
    color: var(--qw-muted);
    border-bottom: 1px solid var(--qw-border);
}

@media (max-width: 767px) {
    .qw-overlay-frame {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
}

/* ----- Pakej image hover overlay + click-to-zoom lightbox ----- */
.qw-img-zoom {
    position: relative;
    display: block;
    cursor: zoom-in;
    border-radius: var(--qw-radius);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}
.qw-img-zoom > img { display: block; }
.qw-img-zoom::after {
    content: "🔍 " attr(data-zoom-label);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: 0;
    transition: opacity 0.18s ease;
    pointer-events: none;
}
.qw-img-zoom:hover::after,
.qw-img-zoom:focus-within::after { opacity: 1; }

/* Touch devices: no hover overlay; tap opens directly. */
@media (hover: none) {
    .qw-img-zoom { cursor: pointer; }
    .qw-img-zoom::after { display: none; }
}

.qw-lightbox {
    border: 0;
    padding: 0;
    background: transparent;
    max-width: none;
    max-height: none;
    width: 100%;
    height: 100%;
    margin: 0;
    color: #fff;
}
.qw-lightbox::backdrop { background: rgba(0, 0, 0, 0.85); }
.qw-lightbox[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}
.qw-lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    border-radius: 6px;
}
.qw-lightbox-close {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.92);
    color: #111;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.qw-lightbox-close:hover { background: #fff; }

/* ----- Toast notifications (lazy-created from JS) ----- */
.qw-toast-stack {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 9999;
    pointer-events: none;
}
.qw-toast {
    background: rgba(20, 22, 24, 0.92);
    color: #fff;
    padding: 10px 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
}
.qw-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}
