:root {
    --red: #f5333f;
    --blue: #123a5a;
    --blue-dark: #0d2d47;
    --blue-light: #355d7c;
    --bg: #f3f6f9;
    --text: #1f2937;
    --muted: #6b7788;
    --border: #dbe3ea;
    --green: #239b61;
    --yellow: #f6b333;
}



body.portal-body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

img {
    max-width: 100%;
    height: auto;
}

/* APP */

.app-shell {
    display: flex;
    min-height: 100vh;
    padding: 32px 36px;
    gap: 34px;
}

.sidebar {
    width: 245px;
    min-width: 245px;
    height: calc(100vh - 64px);
    position: fixed;
    left: 36px;
    top: 32px;
    z-index: 100;
    background: linear-gradient(180deg, var(--blue) 0%, var(--blue-dark) 100%);
    border-radius: 24px!important;
    padding: 36px 24px 28px;
    display: flex;
    flex-direction: column;
    color: white;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(18, 58, 90, 0.18);
}

.sidebar-logo {
    background: white;
    border-radius: 8px!important;
    padding: 8px;
    margin-bottom: 70px;
}

.sidebar-logo img {
    width: 100%;
    display: block;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar-nav a,
.sidebar-nav .logout-link {
    color: #dce8f3;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    padding: 16px 20px;
    border-radius: 14px!important;
    width: 100%;
    text-align: left;
    font-family: Arial, Helvetica, sans-serif;
    transition: .2s ease;
}

.sidebar-nav a:hover,
.sidebar-nav .logout-link:hover,
.sidebar-nav a.active {
    background: var(--blue-light);
    color: white;
}

.sidebar-nav a.active {
    box-shadow: inset 4px 0 0 var(--red);
}

.logout-form {
    margin: 0;
    width: 100%;
}

.logout-link {
    border: none;
    background: transparent;
    cursor: pointer;
}

.sidebar-footer {
    margin-top: auto;
    font-size: 14px;
    color: #dce8f3;
    line-height: 1.35;
}

.main-content {
    flex: 1;
    min-width: 0;
    padding: 24px 0;
    margin-left: calc(245px + 34px);
}

/* TOPBAR */

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

.hamburger-btn {
    display: none;
    border: 1px solid var(--border);
    background: white;
    color: var(--blue);
    border-radius: 14px!important;
    width: 48px;
    height: 48px;
    font-size: 24px;
    font-weight: 800;
    cursor: pointer;
}

.user-badge {
    background: white;
    border: 1px solid var(--border);
    border-radius: 18px!important;
    padding: 10px 12px 10px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 700;
    max-width: 100%;
}

.user-badge span {
    width: 34px;
    height: 34px;
    background: var(--red);
    color: white;
    border-radius: 50%!important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

/* TYPOGRAPHY */

h1 {
    margin: 0;
    font-size: 40px;
    color: var(--blue);
    line-height: 1.15;
}

h2 {
    margin-top: 0;
    color: var(--blue);
    font-size: 28px;
}

.page-subtitle {
    margin-top: 8px;
    margin-bottom: 30px;
    color: var(--muted);
    font-size: 19px;
}

/* CARDS */

.card,
.panel-main,
.panel-side {
    background: white;
    border: 1px solid var(--border);
    border-radius: 24px!important;
    padding: 34px;
    overflow: hidden;
}

/* DASHBOARD */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    margin-bottom: 34px;
}

.stat-card h3 {
    margin: 0 0 14px;
    font-size: 20px;
}

.stat-card strong {
    font-size: 48px;
}

.text-red {
    color: var(--red);
}

.text-yellow {
    color: var(--yellow);
}

.text-green {
    color: var(--green);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 34px;
}

/* FORMS */

.form-grid {
    display: grid;
    grid-template-columns: 1.7fr .9fr;
    gap: 34px;
}

.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

label {
    display: block;
    margin: 18px 0 8px;
    font-weight: 800;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: #f7f9fb;
    border-radius: 15px!important;
    padding: 17px 18px;
    font-size: 16px;
    color: var(--text);
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--blue-light);
    box-shadow: 0 0 0 4px rgba(18, 58, 90, 0.12);
}

.upload-box {
    border: 1px solid var(--border);
    background: #f7f9fb;
    border-radius: 20px!important;
    padding: 32px;
    display: block;
    cursor: pointer;
}

.upload-box strong {
    display: block;
    color: var(--blue);
    font-size: 23px;
    margin-bottom: 12px;
}

.upload-box span {
    color: var(--muted);
    display: block;
    margin-bottom: 18px;
}

/* BUTTONS */

.primary-btn,
button.primary-btn,
.filter-btn {
    border: none;
    background: var(--red);
    color: white;
    border-radius: 15px!important;
    padding: 18px 28px;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.primary-btn:hover,
.filter-btn:hover {
    opacity: .92;
}

.secondary-btn {
    border: 1px solid var(--border);
    background: white;
    color: var(--blue);
    border-radius: 15px!important;
    padding: 18px 28px;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
}

/* ALERTS */

.alert {
    padding: 16px 20px;
    border-radius: 14px!important;
    margin-bottom: 20px;
    font-weight: 700;
}

.alert-success {
    background: #eaf8f0;
    color: #176b43;
    border: 1px solid #bfe8cf;
}

.alert-error {
    background: #fdecee;
    color: #a61b28;
    border: 1px solid #f6bcc3;
}

/* TABLE */

.search-row {
    display: flex;
    gap: 18px;
    margin-bottom: 34px;
}

.search-row input {
    flex: 1;
    background: white;
}

.filter-btn {
    width: 215px;
}

.ticket-table {
    width: 100%;
    border-collapse: collapse;
}

.ticket-table th {
    text-align: left;
    color: var(--blue);
    font-size: 16px;
    padding: 0 10px 16px;
    border-bottom: 1px solid var(--border);
}

.ticket-table td {
    padding: 18px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.ticket-id {
    color: var(--blue);
    font-weight: 800;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 130px;
    padding: 12px 18px;
    border-radius: 14px!important;
    color: white;
    font-weight: 800;
    font-size: 15px;
    white-space: nowrap;
}

.status-red {
    background: var(--red);
}

.status-blue {
    background: var(--blue-light);
}

.status-yellow {
    background: var(--yellow);
    color: #1f2937;
}

.status-green {
    background: var(--green);
}

/* LOGIN */

.login-body {
    margin: 0;
    font-family: Arial, sans-serif;
    min-height: 100vh;
    background: var(--bg);
}

.login-wrapper {
    display: grid;
    /*grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);*/
    min-height: 100vh;
}

.login-left {
    background: var(--red);
    color: white;
    padding: 76px 80px 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    height:100%;
}

.login-left::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 48%;
    background: url('../img/bg3-1.png') no-repeat;
    background-size: cover;
    background-position: bottom center;
    opacity: .9;
    pointer-events: none;
}

.login-brand {
    position: relative;
    z-index: 2;
    background: white;
    padding: 10px 14px;
    border-radius: 8px!important;
    width: fit-content;
    margin-bottom: 46px;
}

.login-brand img {
    width: 220px;
    display: block;
}

.login-left h1 {
    font-size: clamp(48px, 5.5vw, 76px);
    line-height: 1.06;
    margin: 0;
    font-weight: 800;
    color: white;
    position: relative;
    z-index: 2;
    max-width: 760px;
}

.login-left p {
    font-size: 22px;
    max-width: 640px;
    line-height: 1.45;
    margin-top: 36px;
    position: relative;
    z-index: 2;
}

.login-right {
    background:
        linear-gradient(rgba(243, 246, 249, .75), rgba(243, 246, 249, .75)),
        url('../img/bg3-1.png');
    background-repeat: no-repeat;
    background-position: bottom right;
    background-size: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
     height:100%;
}

.login-card {
    width: 420px;
    max-width: 100%;
    background: white;
    padding: 50px;
    border-radius: 24px!important;
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0,0,0,.05);
}

.login-card h2 {
    font-size: 34px;
    margin-bottom: 10px;
}

.login-subtitle {
    color: var(--muted);
    margin-bottom: 30px;
}

.login-card input {
    margin-bottom: 18px;
    background: #f9fbfc;
}

.login-card .primary-btn {
    width: 100%;
    margin-top: 10px;
}

/* SESSION MODAL */

.session-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.session-modal-box {
    background: white;
    border-radius: 24px!important;
    padding: 34px;
    max-width: 460px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,.22);
    text-align: center;
}

.session-modal-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    margin-top: 24px;
}

/* TABLET */

@media (max-width: 1200px) {
    .app-shell {
        padding: 22px;
        gap: 22px;
    }

    .sidebar {
        width: 220px;
        min-width: 220px;
        height: calc(100vh - 44px);
        left: 22px;
        top: 22px;
        padding: 28px 20px;
    }

    .main-content {
        margin-left: calc(220px + 22px);
    }

    .sidebar-nav a,
    .sidebar-nav .logout-link {
        font-size: 16px;
        padding: 14px 16px;
    }

    h1 {
        font-size: 34px;
    }

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

/* MOBILE */

@media (max-width: 980px) {
    .app-shell {
        display: block;
        padding: 18px;
    }

    .main-content {
        margin-left: 0;
        padding: 0;
        width: 100%;
    }

    .topbar {
        position: sticky;
        top: 0;
        z-index: 3000;
        background: var(--bg);
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0 16px;
        margin-bottom: 22px;
    }

    .hamburger-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        position: relative;
        z-index: 3100;
    }

    .hamburger-btn.is-open {
        background: var(--red);
        color: white;
        border-color: var(--red);
    }

    .user-badge {
        display: flex;
        max-width: calc(100vw - 88px);
        overflow: hidden;
        font-size: 14px;
        padding: 8px 10px 8px 14px;
        position: relative;
        z-index: 3100;
    }

    .sidebar {
        position: fixed;
        top: 96px;
        left: 18px;
        bottom: 18px;
        width: 260px;
        min-width: 260px;
        max-width: 260px;
        height: auto;
        padding: 22px 20px 24px;
        border-radius: 22px!important;
        z-index: 2500;
        transform: translateX(-310px);
        transition: transform .25s ease;
        overflow-y: auto;
    }

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

    .sidebar-logo {
        margin-bottom: 36px;
    }

    .stats-grid,
    .dashboard-grid,
    .form-grid,
    .two-col {
        grid-template-columns: 1fr;
    }

    .card,
    .panel-main,
    .panel-side {
        padding: 24px;
        border-radius: 20px!important;
    }

    h1 {
        font-size: 30px;
    }

    .page-subtitle {
        font-size: 16px;
    }

    .search-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .filter-btn,
    .primary-btn,
    button.primary-btn {
        width: 100%;
    }

    .ticket-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .login-wrapper {
        grid-template-columns: 1fr;
    }

    .login-left {
        min-height: auto;
        padding: 42px 28px 70px;
    }

    .login-brand img {
        width: 180px;
    }

    .login-left h1 {
        font-size: 52px;
    }

    .login-left p {
        font-size: 18px;
    }

    .login-right {
        padding: 28px;
        background-size: 100%;
    }
}

/* SMALL MOBILE */

@media (max-width: 640px) {
    .app-shell {
        padding: 14px;
    }

    h1 {
        font-size: 26px;
    }

    h2 {
        font-size: 22px;
    }

    .card,
    .panel-main,
    .panel-side {
        padding: 18px;
    }

    .stat-card strong {
        font-size: 36px;
    }

    input,
    textarea {
        padding: 14px 15px;
        font-size: 15px;
    }

    .upload-box {
        padding: 22px;
    }

    .session-modal-actions {
        flex-direction: column;
    }

    .secondary-btn,
    .primary-btn {
        width: 100%;
    }

    .sidebar {
        top: 88px;
        left: 14px;
        width: 250px;
        min-width: 250px;
        max-width: 250px;
        transform: translateX(-300px);
    }

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

    .login-left {
        padding: 34px 22px 54px;
    }

    .login-brand img {
        width: 150px;
    }

    .login-left h1 {
        font-size: 40px;
    }

    .login-left p {
        font-size: 16px;
    }

    .login-right {
        padding: 20px;
    }

    .login-card {
        width: 100%;
        padding: 28px 22px;
    }
}

/* === MOBILE OPEN MENU SCROLL FIX === */

@media (max-width: 980px) {
    body:has(.sidebar.sidebar-open) {
        overflow: hidden !important;
        height: 100vh !important;
    }

    body:has(.sidebar.sidebar-open) .app-shell {
        height: 100vh !important;
        overflow: hidden !important;
    }

    body:has(.sidebar.sidebar-open) .main-content {
        height: calc(100vh - 36px) !important;
        overflow: hidden !important;
    }

    .sidebar.sidebar-open {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

