:root {
    --bg: #f8f9fa;                /* main background */
    --bg-soft: #ffffff;           /* inputs / subtle */
    --panel: #ffffff;             /* sidebar */
    --panel-soft: #ffffff;        /* cards */
    --border: #dcdfe3;            /* light border */
    --accent: #E80028;            /* MassHeads red */
    --accent-soft: rgba(232, 0, 40, 0.12);
    --text-main: #1a1a1a;         /* main text dark */
    --text-muted: #555555;
    --text-soft: #888888;
    --radius-lg: 18px;
    --radius-md: 12px;
}

/* Reset */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text-main);
}

/* Shell */

.mh-shell {
    min-height: 100vh;
    background: var(--bg);
}

/* ===========================
   AUTH LAYOUT (LOGIN SCREEN)
   =========================== */

.mh-auth-body {
    background: var(--bg);
}

.mh-brand-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 26px;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
}

.mh-brand-logo {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mh-brand-logo img {
    width: 20px;
    height: 20px;
    display: block;
}

.mh-brand-text {
    display: flex;
    flex-direction: column;
}

.mh-brand-title {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.mh-brand-sub {
    font-size: 11px;
    color: var(--text-soft);
}

.mh-auth-wrapper {
    min-height: calc(100vh - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.mh-auth-card {
    background: var(--panel);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.08);
    padding: 28px 26px 24px;
    width: 360px;
    max-width: 100%;
}

.mh-auth-heading {
    margin-bottom: 18px;
}

.mh-auth-heading h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.mh-auth-heading p {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--text-soft);
}

.mh-field-group {
    margin-top: 14px;
}

.mh-field-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.mh-input {
    width: 100%;
    padding: 9px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text-main);
    font-size: 13px;
    outline: none;
}

.mh-input::placeholder {
    color: #9a9a9a;
}

.mh-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(232, 0, 40, 0.35);
}

/* Buttons */

.mh-btn-primary {
    margin-top: 18px;
    width: auto;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition:
        transform 0.08s ease,
        box-shadow 0.08s ease,
        background 0.1s ease;
        text-decoration: none;
}

.mh-btn-primary:hover {
    background: #ff0731;
    box-shadow: 0 12px 25px rgba(232, 0, 40, 0.25);
    transform: translateY(-1px);
}

.mh-btn-primary:active {
    transform: translateY(0);
    box-shadow: none;
}

.mh-error {
    margin-top: 10px;
    padding: 9px 10px;
    border-radius: var(--radius-md);
    background: #ffe5e7;
    color: #b0001b;
    font-size: 12px;
}

/* ===========================
   AUTHENTICATED APP LAYOUT
   =========================== */

.mh-app-layout {
    min-height: 100vh;
    display: flex;
}

/* Sidebar */

.mh-sidebar {
    width: 230px;
    background: var(--panel);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 18px 16px 10px;
    position: sticky;
    top: 0;
    align-self: flex-start;
    min-height: 100vh;
}

.mh-sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.mh-sidebar-logo-circle {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: var(--accent-soft);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mh-sidebar-logo-circle img {
    width: 48px;
    height: 48px;
    display: block;
}

.mh-sidebar-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.mh-sidebar-nav {
    flex: 1;
    margin-top: 8px;
}

.mh-nav-section-label {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-soft);
    margin: 10px 8px 4px;
    letter-spacing: 0.08em;
}

.mh-nav-item {
    margin: 2px 0;
}

.mh-nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border-radius: 10px;
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.08s ease, color 0.08s ease;
}

.mh-nav-link:hover {
    background: #f0f0f0;
    color: #000;
}

.mh-nav-item--active .mh-nav-link {
    background: var(--accent-soft);
    color: #000;
}

.mh-nav-dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--accent);
}

/* Sidebar footer */

.mh-sidebar-footer {
    border-top: 1px solid var(--border);
    padding-top: 10px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-soft);
}

/* Main column */

.mh-main-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.mh-main-header {
    padding: 18px 26px 10px;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.mh-main-header-title {
    font-size: 19px;
    font-weight: 600;
}

.mh-main-header-sub {
    font-size: 13px;
    color: var(--text-soft);
}

.mh-main-header-right {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
}

.mh-main-header-right a {
    color: var(--accent);
    text-decoration: none;
}

/* Main content */

.mh-main-content {
    flex: 1;
    padding: 20px 26px 30px;
}

/* Card */

.mh-card {
    background: var(--panel);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 18px;
    font-size: 13px;
    color: var(--text-muted);
}

/* Table */

.mh-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mh-table th,
.mh-table td {
    padding: 7px 6px;
    border-top: 1px solid #e2e2e2;
    text-align: left;
}

.mh-table th {
    border-top: none;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    color: var(--text-muted);
}

/* Badge */

.mh-badge-soft {
    display: inline-block;
    padding: 2px 7px;
    border-radius: 999px;
    background: #f1f1f1;
    color: var(--text-soft);
    font-size: 11px;
}

/* Secondary button */

.mh-btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.mh-btn-secondary:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.mh-btn-secondary:active {
    transform: translateY(0);
    opacity: 0.9;
}

/* File input */

.mh-file-field {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mh-file-input {
    display: none;
}

.mh-file-label {
    cursor: pointer;
}

.mh-file-name {
    font-size: 11px;
    color: var(--text-soft);
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ticket previews */

.ticket-preview-wrapper {
    display: flex;
    gap: 20px;
    margin-top: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.ticket-preview-box {
    flex: 1;
    min-width: 280px;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: var(--radius-md);
}

.ticket-preview-box h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: var(--text-muted);
}

.ticket-preview-img {
    width: 100%;
    border-radius: var(--radius-md);
    display: block;
    user-select: none;
    -webkit-user-drag: none;
}

 .tickets-table {
            width: 100%;
            border-collapse: collapse;
        }
        .tickets-table thead tr {
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--text-soft);
        }
        .tickets-table th,
        .tickets-table td {
            padding: 10px 12px;
            border-bottom: 1px solid var(--border-soft, rgba(255,255,255,0.03));
            font-size: 13px;
            vertical-align: middle;
        }
        .tickets-table tbody tr:last-child td {
            border-bottom: none;
        }
        .tickets-table tbody tr:hover {
            background: rgba(255,255,255,0.02);
        }

        .mh-tag {
            display: inline-flex;
            align-items: center;
            padding: 2px 8px;
            border-radius: 999px;
            font-size: 11px;
            border: 1px solid rgba(255,255,255,0.08);
            background: rgba(255,255,255,0.03);
        }
        .mh-tag-active {
            border-color: rgba(58,181,73,0.65);
            color: #b8f7c5;
        }
        .mh-tag-inactive {
            border-color: rgba(232,0,40,0.65);
            color: #ffd1dd;
        }

        .ticket-thumb {
            width: 150px;
            max-width: 150px;
            border-radius: 12px;
            border: 1px solid var(--border);
            background: var(--bg-soft);
            padding: 4px;
            cursor: zoom-in;
        }
        .ticket-thumb-inner {
            position: relative;
            width: 100%;
            padding-top: 56%; /* approx 16:9 */
            overflow: hidden;
            border-radius: 10px;
            background: #050505;
        }
        .ticket-thumb-inner img {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 10px;
            user-select: none;
            -webkit-user-drag: none;
        }
        .ticket-thumb-qr {
            position: absolute;
            border: 2px solid var(--accent);
            box-shadow: 0 0 0 1px rgba(0,0,0,0.5);
            border-radius: 4px;
            pointer-events: none;
        }

        .ticket-meta {
            font-size: 11px;
            color: var(--text-soft);
        }

        .tickets-actions {
            display: flex;
            gap: 6px;
            align-items: center;
            justify-content: flex-end;
        }

        .mh-btn-chip {
            border-radius: 999px;
            padding: 4px 10px;
            font-size: 11px;
            border: 1px solid transparent;
            background: transparent;
            color: var(--text-soft);
            cursor: pointer;
        }
        .mh-btn-chip:hover {
            background: rgba(255,255,255,0.06);
        }
        .mh-btn-chip-edit {
            border-color: rgba(255,255,255,0.1);
        }
        .mh-btn-chip-delete {
            border-color: rgba(232,0,40,0.4);
            color: #ffb3c1;
        }
        .mh-btn-chip-delete:hover {
            background: rgba(232,0,40,0.15);
        }

        /* Image modal */
        .ticket-modal-backdrop {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.7);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 9999;
        }
        .ticket-modal-content {
            max-width: 90vw;
            max-height: 90vh;
            border-radius: 14px;
            overflow: hidden;
            background: #050505;
            border: 1px solid var(--border);
            position: relative;
        }
        .ticket-modal-content img {
            display: block;
            max-width: 100%;
            max-height: 90vh;
            object-fit: contain;
            user-select: none;
            -webkit-user-drag: none;
        }
        .ticket-modal-close {
            position: absolute;
            top: 10px;
            right: 10px;
            border-radius: 999px;
            border: 1px solid rgba(255,255,255,0.2);
            background: rgba(0,0,0,0.6);
            color: #fff;
            font-size: 11px;
            padding: 4px 8px;
            cursor: pointer;
        }
        .ticket-modal-close:hover {
            background: rgba(0,0,0,0.9);
        }
