/* ==========================================================================
   London Aesthetics UK — Invoice & Student Management
   Frontend dashboard styles (self-contained, no external framework)
   Design by Ahmad Hassan
   ========================================================================== */

/* Many WordPress themes (block themes especially) render page content
   inside a narrow "constrained" column — fine for a paragraph of text,
   but it squeezes a full dashboard into a tiny strip with wasted space
   on both sides. .lauk-breakout (wrapped around .lauk-wrap in every
   template) breaks out of that narrow column back to the full page
   width using the standard vw-based technique, then .lauk-wrap's own
   max-width + auto margins re-center and cap it at a sensible design
   width. overflow-x:hidden guards against the 100vw-vs-scrollbar
   rounding that can otherwise add a few pixels of horizontal scroll. */
.lauk-breakout {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    overflow-x: hidden;
}

.lauk-wrap, .lauk-wrap * { box-sizing: border-box; }

.lauk-wrap {
    /* Brand palette — London Aesthetics UK Training Institute */
    --lauk-navy: #5e1540;          /* brand primary (maroon) */
    --lauk-navy-light: #7a1f54;    /* lighter shade for hover/active feedback */
    --lauk-secondary: #9e2a4c;     /* brand rose accent */
    --lauk-accent: #c9a227;        /* brand gold accent */
    --lauk-bg: #f7f2f5;
    --lauk-card: #ffffff;
    --lauk-border: #e6dbe2;
    --lauk-text: #221a1e;
    --lauk-text-muted: #6b7280;
    --lauk-success: #1e7e34;
    --lauk-success-bg: #e6f6ea;
    --lauk-warning: #a5670c;
    --lauk-warning-bg: #fdf3e0;
    --lauk-danger: #a12626;
    --lauk-danger-bg: #fbeaea;
    --lauk-radius: 10px;
    --lauk-font-heading: 'Baskervville', Georgia, 'Times New Roman', serif;
    --lauk-font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    font-family: var(--lauk-font-body);
    color: var(--lauk-text);
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 14px 60px;
    line-height: 1.5;
}

.lauk-wrap a { color: var(--lauk-navy); }
.lauk-wrap h1, .lauk-wrap h2, .lauk-wrap h3, .lauk-wrap h4 { color: var(--lauk-navy); margin: 0 0 8px 0; font-family: var(--lauk-font-heading); }

/* Top bar */
.lauk-topbar {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--lauk-navy); color: #fff; padding: 14px 20px; border-radius: var(--lauk-radius);
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.lauk-topbar .lauk-brand { display: flex; align-items: center; gap: 10px; }
.lauk-topbar .lauk-brand img { max-height: 36px; }
.lauk-topbar .lauk-brand-name { font-weight: 700; font-size: 17px; font-family: var(--lauk-font-heading); }
.lauk-topbar .lauk-brand-sub { font-size: 11px; opacity: .75; }
.lauk-topbar .lauk-topbar-right { display: flex; align-items: center; gap: 14px; }
.lauk-topbar .lauk-user-chip { font-size: 13px; opacity: .9; }
.lauk-topbar a.lauk-logout { color: #ffd9d9; font-size: 13px; text-decoration: none; }
.lauk-topbar a.lauk-logout:hover { text-decoration: underline; }

/* Bell */
.lauk-bell-wrap { position: relative; cursor: pointer; }
.lauk-bell-icon { width: 22px; height: 22px; display: inline-block; }
.lauk-bell-badge {
    position: absolute; top: -6px; right: -8px; background: #e0433f; color: #fff;
    font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 10px; min-width: 16px; text-align: center;
    display: none;
}
.lauk-bell-badge.lauk-show { display: inline-block; }
.lauk-bell-panel {
    position: absolute; top: 34px; right: 0; width: 320px; max-height: 420px; overflow-y: auto;
    background: #fff; color: var(--lauk-text); border-radius: 8px; box-shadow: 0 12px 28px rgba(0,0,0,.22);
    display: none; z-index: 200; border: 1px solid var(--lauk-border);
}
.lauk-bell-panel.lauk-open { display: block; }
.lauk-bell-panel-header { padding: 10px 14px; font-weight: 700; border-bottom: 1px solid var(--lauk-border); display:flex; justify-content:space-between; align-items:center; }
.lauk-bell-panel-header button { font-size: 11px; background:none; border:none; color: var(--lauk-navy); cursor:pointer; text-decoration:underline; }
.lauk-notif-item { padding: 10px 14px; border-bottom: 1px solid #f0f1f4; font-size: 12.5px; }
.lauk-notif-item:last-child { border-bottom: none; }
.lauk-notif-item .lauk-notif-time { color: var(--lauk-text-muted); font-size: 10.5px; margin-top: 2px; }
.lauk-notif-empty { padding: 24px 14px; text-align: center; color: var(--lauk-text-muted); font-size: 12.5px; }

/* Layout: sidebar + content */
.lauk-shell { display: flex; gap: 18px; align-items: flex-start; }
.lauk-sidebar {
    width: 210px; flex-shrink: 0; background: var(--lauk-card); border: 1px solid var(--lauk-border);
    border-radius: var(--lauk-radius); padding: 10px; position: sticky; top: 14px;
}
/* !important on color/text-decoration here (and on the active/hover
   rules below) is deliberate: block themes such as Twenty Twenty-Four
   inject a global-styles rule shaped like
   ":root :where(a:not(.wp-element-button)) { text-decoration: underline; color: ...; }".
   The bare ":root" is a real pseudo-class (not inside :where()), so
   that selector's specificity ties with a single class like
   ".lauk-nav-item" — and being injected later in the page, the theme
   rule wins the tie and silently underlines/recolors every nav link
   without this. */
.lauk-nav-item {
    display: block; padding: 9px 12px; border-radius: 7px; color: var(--lauk-text) !important; text-decoration: none !important;
    font-size: 13.5px; font-weight: 500; cursor: pointer; margin-bottom: 3px;
    background: transparent; border: none; text-align: left; width: 100%;
}
/* Hover on a non-active item: light tint background, keep dark text —
   readable, no white-on-white / blue-link-color regressions. */
.lauk-nav-item:hover { background: var(--lauk-bg); color: var(--lauk-text) !important; }
/* Active item: brand-colored background always paired with white text.
   The active+hover rule is listed explicitly (not just relying on
   specificity) so hovering the currently-selected item can never fall
   back to the plain :hover rule above and leave white text sitting on
   the light hover background — that mismatch was the reported bug. */
.lauk-nav-item.lauk-active,
.lauk-nav-item.lauk-active:hover,
.lauk-nav-item.lauk-active:focus {
    background: var(--lauk-navy);
    color: #fff !important;
}
.lauk-nav-item.lauk-active:hover { background: var(--lauk-navy-light); }
.lauk-content { flex: 1; min-width: 0; }

/* Cards & stats */
.lauk-card {
    background: var(--lauk-card); border: 1px solid var(--lauk-border); border-radius: var(--lauk-radius);
    padding: 18px 20px; margin-bottom: 18px;
}
.lauk-card-title { font-size: 14px; font-weight: 700; margin-bottom: 14px; color: var(--lauk-navy); display:flex; justify-content:space-between; align-items:center; }
.lauk-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.lauk-stat-box { background: var(--lauk-card); border: 1px solid var(--lauk-border); border-radius: var(--lauk-radius); padding: 16px; }
.lauk-stat-box .lauk-stat-label { font-size: 11.5px; color: var(--lauk-text-muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.lauk-stat-box .lauk-stat-value { font-size: 24px; font-weight: 800; color: var(--lauk-navy); }
.lauk-stat-box.lauk-accent-success .lauk-stat-value { color: var(--lauk-success); }
.lauk-stat-box.lauk-accent-warning .lauk-stat-value { color: var(--lauk-warning); }
.lauk-stat-box.lauk-accent-danger .lauk-stat-value { color: var(--lauk-danger); }

/* Buttons */
.lauk-btn {
    display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; border-radius: 7px;
    padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none; line-height: 1.3;
    background: #eef0f3; color: var(--lauk-text);
}
.lauk-btn:hover { opacity: .92; }
.lauk-btn-primary { background: var(--lauk-navy); color: #fff; }
.lauk-btn-accent { background: var(--lauk-accent); color: #201803; }
.lauk-btn-success { background: var(--lauk-success); color: #fff; }
.lauk-btn-danger { background: var(--lauk-danger); color: #fff; }
.lauk-btn-outline { background: transparent; border-color: var(--lauk-border); }
.lauk-btn-sm { padding: 5px 10px; font-size: 12px; }
.lauk-btn[disabled] { opacity: .55; cursor: not-allowed; }
.lauk-btn-whatsapp { background: #25D366; color: #06331a; }

/* Forms */
.lauk-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.lauk-field { margin-bottom: 4px; }
.lauk-field label { display: block; font-size: 12px; font-weight: 600; color: var(--lauk-text); margin-bottom: 5px; }
.lauk-field .lauk-hint { font-size: 10.5px; color: var(--lauk-text-muted); margin-top: 3px; }
.lauk-input, .lauk-select, .lauk-textarea {
    width: 100%; padding: 9px 11px; font-size: 13px; border: 1px solid var(--lauk-border); border-radius: 7px;
    background: #fff; color: var(--lauk-text);
}
.lauk-input:focus, .lauk-select:focus, .lauk-textarea:focus { outline: none; border-color: var(--lauk-navy); box-shadow: 0 0 0 3px rgba(22,35,60,.1); }
.lauk-textarea { resize: vertical; min-height: 72px; }
.lauk-checkbox-row { display:flex; align-items:center; gap: 8px; font-size: 13px; }
.lauk-form-actions { margin-top: 16px; display: flex; gap: 10px; align-items:center; }
.lauk-form-msg { font-size: 12.5px; padding: 8px 12px; border-radius: 6px; margin-top: 10px; display:none; }
.lauk-form-msg.lauk-show { display:block; }
.lauk-form-msg.lauk-success { background: var(--lauk-success-bg); color: var(--lauk-success); }
.lauk-form-msg.lauk-error { background: var(--lauk-danger-bg); color: var(--lauk-danger); }

/* Tables */
.lauk-table-wrap { overflow-x: auto; }
.lauk-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.lauk-table th { text-align: left; background: var(--lauk-bg); color: var(--lauk-navy); font-weight: 700; padding: 9px 10px; white-space: nowrap; }
/* Keep each cell's content on a single line (e.g. a two-word student
   name) instead of wrapping mid-name — .lauk-table-wrap already scrolls
   horizontally (overflow-x: auto) for any row that needs more room. */
.lauk-table td { padding: 9px 10px; border-bottom: 1px solid var(--lauk-border); vertical-align: middle; white-space: nowrap; }
/* Opt back into normal wrapping for cells that hold a full sentence or
   address rather than a short compact value (audit log details, branch
   addresses) — those should still wrap for readability. */
.lauk-table td.lauk-wrap-text { white-space: normal; }
/* Cap wide-but-non-essential columns (Branch, Officer) to a fixed width
   with an ellipsis instead of letting them stretch the whole table wider
   than the dashboard — the full value is still available on hover via
   the cell's title attribute. This is what keeps a many-column table
   (e.g. the Admin students list) fitting without a horizontal scrollbar. */
.lauk-table td.lauk-truncate { max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
.lauk-table tr:hover td { background: #fafbfc; }
.lauk-table .lauk-empty-row td { text-align: center; color: var(--lauk-text-muted); padding: 30px 10px; }

/* Compact action-button row inside a table cell (Edit / Invoice /
   WhatsApp / Delete) — a flex row with a small gap reads cleaner and
   takes less horizontal space than inline buttons separated by spaces. */
.lauk-row-actions { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; }
.lauk-btn-xs { padding: 4px 9px; font-size: 11.5px; }

/* Badges & stamps */
.lauk-badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; }
.lauk-badge-success { background: var(--lauk-success-bg); color: var(--lauk-success); }
.lauk-badge-warning { background: var(--lauk-warning-bg); color: var(--lauk-warning); }
.lauk-badge-danger { background: var(--lauk-danger-bg); color: var(--lauk-danger); }
.lauk-badge-neutral { background: #eef0f3; color: var(--lauk-text-muted); }

/* Tabs (in-page, used by dashboards) */
.lauk-tabs { display: flex; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--lauk-border); flex-wrap: wrap; }
.lauk-tab-btn { padding: 9px 14px; font-size: 13px; font-weight: 600; background: none; border: none; cursor: pointer; color: var(--lauk-text-muted); border-bottom: 2px solid transparent; }
.lauk-tab-btn.lauk-active { color: var(--lauk-navy); border-bottom-color: var(--lauk-navy); }
.lauk-tab-panel { display: none; }
.lauk-tab-panel.lauk-active { display: block; }

/* Modal */
.lauk-modal-overlay {
    position: fixed; inset: 0; background: rgba(15,20,30,.55); display: none; align-items: center; justify-content: center;
    z-index: 500; padding: 20px;
}
.lauk-modal-overlay.lauk-open { display: flex; }
.lauk-modal {
    background: #fff; border-radius: 12px; padding: 22px 24px; max-width: 720px; width: 100%;
    max-height: 88vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.lauk-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.lauk-modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--lauk-text-muted); line-height: 1; }

/* Auth cards */
.lauk-auth-card { max-width: 420px; margin: 60px auto; background: var(--lauk-card); border: 1px solid var(--lauk-border); border-radius: var(--lauk-radius); padding: 30px; text-align: center; }

/* Verification portal */
.lauk-verify-card { max-width: 520px; margin: 20px auto; background: var(--lauk-card); border: 1px solid var(--lauk-border); border-radius: var(--lauk-radius); padding: 30px; }
.lauk-verify-search { display: flex; gap: 10px; }
.lauk-verify-result { margin-top: 20px; padding: 18px; border-radius: 8px; background: var(--lauk-bg); display: none; }
.lauk-verify-result.lauk-show { display: block; }
.lauk-verify-result dl { display: grid; grid-template-columns: 42% 58%; row-gap: 8px; font-size: 13px; margin: 0; }
.lauk-verify-result dt { font-weight: 700; color: var(--lauk-navy); }
.lauk-verify-result dd { margin: 0; }

/* Signature box */
.lauk-signature-preview { max-width: 220px; max-height: 90px; border: 1px dashed var(--lauk-border); padding: 6px; background: #fff; display:block; margin-bottom: 10px; }

/* Utility */
.lauk-muted { color: var(--lauk-text-muted); }
.lauk-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lauk-flex-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.lauk-spacer { flex: 1; }
.lauk-small { font-size: 11.5px; }
.lauk-mt-0 { margin-top: 0; }
.lauk-footer-credit { text-align: center; color: var(--lauk-text-muted); font-size: 11px; margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--lauk-border); }

/* Responsive */
@media (max-width: 820px) {
    .lauk-shell { flex-direction: column; }
    .lauk-sidebar { width: 100%; position: static; display: flex; overflow-x: auto; gap: 4px; }
    .lauk-nav-item { white-space: nowrap; }
    .lauk-verify-search { flex-direction: column; }
    .lauk-bell-panel { width: 90vw; right: -10px; }
}
