@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700;800&display=swap');

:root {
    --page-bg: #f5f7fb;
    --panel-border: #dde3ec;
    --ink: #1c2430;
    --muted: #687487;
}

body {
    min-height: 100vh;
    background: var(--page-bg);
    color: var(--ink);
    font-family: "Noto Sans Thai", "Tahoma", system-ui, sans-serif;
    font-weight: 400;
    line-height: 1.6;
}

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

img,
svg {
    max-width: 100%;
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(100%, 440px);
    padding: 32px;
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(28, 36, 48, 0.09);
}

.register-card {
    width: min(100%, 760px);
}

.register-page {
    min-height: 100vh;
    margin: 0;
    padding: 32px;
    background:
        radial-gradient(circle at 8% 8%, rgba(24, 119, 242, 0.08), transparent 28%),
        radial-gradient(circle at 92% 90%, rgba(220, 29, 85, 0.07), transparent 26%),
        #eef2f7;
}

.register-shell {
    width: min(1180px, 100%);
    min-height: calc(100vh - 64px);
    margin: auto;
    display: grid;
    grid-template-columns: minmax(330px, 0.78fr) minmax(580px, 1.22fr);
    overflow: hidden;
    border: 1px solid rgba(214, 221, 232, 0.9);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 25px 70px rgba(27, 39, 58, 0.13);
}

.register-intro {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 42px;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(circle at 100% 0, rgba(68, 125, 255, 0.3), transparent 34%),
        linear-gradient(155deg, #101a2b 0%, #162947 58%, #123d68 100%);
}

.register-intro::after {
    content: "";
    position: absolute;
    right: -95px;
    bottom: -105px;
    width: 280px;
    height: 280px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 50%;
    box-shadow: 0 0 0 42px rgba(255,255,255,.035), 0 0 0 84px rgba(255,255,255,.025);
}

.register-brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
}

.register-brand:hover {
    color: #fff;
}

.register-brand .brand-mark {
    background: rgba(255,255,255,.12);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}

.register-intro-content {
    position: relative;
    z-index: 1;
    margin: auto 0;
}

.register-eyebrow {
    display: inline-flex;
    padding: 6px 11px;
    margin-bottom: 18px;
    border: 1px solid rgba(255,255,255,.17);
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: #bcd8ff;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .05em;
}

.register-intro h1 {
    margin-bottom: 18px;
    font-size: clamp(2rem, 3vw, 3rem);
    font-weight: 800;
    line-height: 1.22;
    letter-spacing: -.025em;
}

.register-intro-content > p {
    margin-bottom: 30px;
    color: #c9d6e8;
    line-height: 1.8;
}

.register-benefits {
    display: grid;
    gap: 18px;
}

.register-benefits > div {
    display: flex;
    align-items: flex-start;
    gap: 13px;
}

.register-benefits > div > span {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255,255,255,.1);
    color: #8fbdff;
}

.register-benefits p {
    display: grid;
    margin: 0;
}

.register-benefits strong {
    font-size: .93rem;
}

.register-benefits small {
    color: #aebdd0;
    line-height: 1.5;
}

.register-intro-note {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 9px;
    padding-top: 22px;
    color: #aebdd0;
    font-size: .8rem;
}

.register-form-panel {
    padding: clamp(34px, 5vw, 58px);
    background: #fff;
}

.register-form-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 28px;
}

.register-form-header > div > span {
    color: #1769d2;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .08em;
}

.register-form-header h2 {
    margin: 2px 0 3px;
    font-size: 1.75rem;
    font-weight: 800;
}

.register-form-header p {
    margin: 0;
    color: var(--muted);
    font-size: .9rem;
}

.register-mobile-icon {
    display: none;
}

.register-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.register-form {
    display: grid;
    gap: 20px;
}

.register-section-heading {
    display: flex;
    align-items: center;
    gap: 11px;
    padding-bottom: 9px;
    margin-top: 3px;
    border-bottom: 1px solid #e8edf4;
}

.register-section-heading > span {
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: #edf5ff;
    color: #1769d2;
}

.register-section-heading > div {
    display: grid;
}

.register-section-heading strong {
    font-size: .94rem;
}

.register-section-heading small {
    color: var(--muted);
    font-size: .74rem;
}

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

.register-grid-three {
    grid-template-columns: .75fr 1fr 1fr;
}

.registration-field label {
    display: block;
    margin-bottom: 7px;
    color: #354055;
    font-size: .84rem;
    font-weight: 700;
}

.registration-field label em {
    color: #dc1d55;
    font-style: normal;
}

.registration-field .form-control,
.registration-field .form-select {
    min-height: 48px;
    border: 1px solid #dce3ed;
    border-radius: 10px;
    background-color: #fbfcfe;
}

.registration-field .form-control:focus,
.registration-field .form-select:focus {
    border-color: #1769d2;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(23, 105, 210, .09);
}

.register-input-icon {
    position: relative;
}

.register-input-icon > i {
    position: absolute;
    z-index: 2;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #8591a3;
}

.register-input-icon .form-control {
    padding-left: 42px;
}

.register-submit {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    padding-inline: 22px;
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(100deg, #135ebd, #1877e8);
    box-shadow: 0 10px 22px rgba(24, 105, 210, .22);
}

.register-submit:hover,
.register-submit:focus {
    color: #fff;
    background: linear-gradient(100deg, #104f9f, #1468cb);
}

.register-login-link {
    margin: 24px 0 0;
    text-align: center;
    color: var(--muted);
    font-size: .9rem;
}

.register-login-link a {
    color: #1769d2;
    font-weight: 700;
}

.auth-brand {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
}

.auth-footer a {
    color: var(--ink);
    font-weight: 700;
}

.login-page {
    min-height: 100vh;
    margin: 0;
    background: #eef1f6;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 1.05fr) minmax(480px, 0.95fr);
}

.login-showcase {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(145deg, #11131a 0%, #1b1c29 55%, #281724 100%);
}

.login-showcase::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.18;
    background-image: radial-gradient(rgba(255, 255, 255, 0.5) 0.7px, transparent 0.7px);
    background-size: 24px 24px;
}

.showcase-glow {
    position: absolute;
    border-radius: 999px;
    filter: blur(4px);
}

.showcase-glow-one {
    width: 430px;
    height: 430px;
    top: -160px;
    right: -100px;
    background: radial-gradient(circle, rgba(255, 29, 112, 0.4), transparent 68%);
}

.showcase-glow-two {
    width: 480px;
    height: 480px;
    bottom: -220px;
    left: -160px;
    background: radial-gradient(circle, rgba(37, 244, 238, 0.3), transparent 68%);
}

.showcase-content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: clamp(32px, 5vw, 72px);
}

.showcase-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
}

.showcase-copy {
    max-width: 610px;
    margin-block: auto;
    padding-block: 64px;
}

.showcase-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    color: #d8dbe5;
    background: rgba(255, 255, 255, 0.07);
    font-size: 0.84rem;
}

.showcase-copy h1 {
    margin: 26px 0 18px;
    font-size: clamp(2.5rem, 5vw, 5rem);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.showcase-copy > p {
    max-width: 540px;
    color: #b7bac6;
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    line-height: 1.8;
}

.showcase-features {
    display: grid;
    gap: 13px;
    margin-top: 30px;
    color: #e3e5eb;
}

.showcase-features div {
    display: flex;
    align-items: center;
    gap: 11px;
}

.showcase-features i {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    color: #101318;
    background: #25f4ee;
}

.showcase-note {
    color: #8f93a1;
    font-size: 0.82rem;
}

.login-form-panel {
    display: grid;
    place-items: center;
    padding: 48px clamp(28px, 7vw, 100px);
    background: #fff;
}

.login-form-wrap {
    width: min(100%, 440px);
}

.login-mobile-brand {
    display: none;
}

.login-welcome {
    display: block;
    margin-bottom: 8px;
    color: #dc1d55;
    font-size: 0.88rem;
    font-weight: 700;
}

.login-heading h2 {
    margin-bottom: 10px;
    font-size: clamp(2rem, 3vw, 2.7rem);
    font-weight: 800;
    letter-spacing: -0.03em;
}

.login-heading p {
    margin: 0 0 32px;
    color: var(--muted);
}

.login-form {
    display: grid;
    gap: 20px;
}

.login-form .form-label {
    margin-bottom: 8px;
    font-weight: 700;
}

.login-material-field .form-control {
    min-height: 54px;
    border-color: #dce1e9;
    border-radius: 10px;
    background: #f9fafc;
}

.login-material-field .form-control:focus {
    border-color: #252731;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(28, 36, 48, 0.08);
}

.login-material-field .form-label {
    color: #747c8c;
}

.login-submit,
.login-register {
    min-height: 52px;
    border-radius: 10px;
    font-weight: 700;
}

.login-submit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    padding-inline: 21px;
    color: #fff;
    border: 0;
    background: #171922;
}

.login-submit:hover,
.login-submit:focus {
    color: #fff;
    background: #292c38;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 27px 0 17px;
    color: #9198a7;
    font-size: 0.82rem;
}

.login-divider::before,
.login-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: #e4e7ed;
}

.login-divider span {
    white-space: nowrap;
}

.login-register {
    display: grid;
    place-items: center;
    color: #1c2430;
    border: 1px solid #d7dce5;
    background: #fff;
}

.login-register:hover {
    border-color: #aeb5c1;
    background: #f7f8fa;
}

.login-privacy {
    margin: 25px 0 0;
    color: #969ca9;
    font-size: 0.78rem;
    text-align: center;
}

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

    .login-showcase {
        display: none;
    }

    .login-form-panel {
        min-height: 100vh;
        padding: 40px 24px;
    }

    .login-mobile-brand {
        display: flex;
        align-items: center;
        gap: 11px;
        margin-bottom: clamp(48px, 10vh, 90px);
    }
}

.brand-mark {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #101318;
    color: #fff;
}

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

.stat-card,
.panel {
    background: #fff;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(28, 36, 48, 0.05);
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.25rem;
}

.stat-label {
    color: var(--muted);
    font-size: 0.875rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
}

.panel {
    padding: 22px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.form-control,
.form-select,
.input-group-text,
.btn {
    border-radius: 8px;
}

.table {
    min-width: 850px;
}

.table thead th {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
}

.table-search {
    max-width: 330px;
}

code {
    color: #bd1542;
}

.description-preview {
    max-width: 360px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
}

.attachment-links a {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-main {
    max-width: 1600px;
    margin-inline: auto;
}

.admin-table th:nth-child(4),
.admin-table th:nth-child(5),
.admin-table td[data-label="เหตุผล"],
.admin-table td[data-label="ไฟล์"] {
    display: none;
}

.admin-update-form {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(100px, 0.8fr) minmax(150px, 1.2fr) minmax(155px, auto);
    gap: 8px;
    min-width: 560px;
}

.admin-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.report-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
}

.report-detail-grid > div {
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.report-detail-grid dt {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: .82rem;
}

.report-detail-grid dd {
    margin-bottom: 0;
    overflow-wrap: anywhere;
}

.report-detail-full {
    grid-column: 1 / -1;
}

.report-description {
    white-space: normal;
}

.report-detail-files {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-filter-form {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(170px, 0.55fr) minmax(170px, 0.55fr) auto auto;
    gap: 10px;
}

.admin-filter-form .table-search {
    max-width: none;
}

.admin-color-select {
    border-width: 1px;
    font-weight: 600;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.admin-color-select.select-neutral {
    border-color: #cbd5e1;
    background-color: #f8fafc;
    color: #475569;
}

.admin-color-select.select-warning {
    border-color: #f0b429;
    background-color: #fff7d6;
    color: #7a4b00;
}

.admin-color-select.select-primary {
    border-color: #6ea8fe;
    background-color: #eaf2ff;
    color: #174ea6;
}

.admin-color-select.select-success {
    border-color: #75c791;
    background-color: #e9f8ee;
    color: #176b36;
}

.admin-color-select.select-danger {
    border-color: #ef8c9d;
    background-color: #fff0f2;
    color: #a61e35;
}

.admin-color-select:focus {
    border-color: #3b71ca;
    box-shadow: 0 0 0 0.2rem rgba(59, 113, 202, 0.18);
}

.email-status-cell {
    min-width: 205px;
}

.email-status-cell .badge {
    max-width: 230px;
    white-space: normal;
    line-height: 1.35;
}

.user-approval-scroll {
    overflow-x: auto !important;
}

.user-approval-table {
    min-width: 980px;
}

.user-approval-table th:last-child,
.user-approval-table td:last-child {
    position: sticky;
    right: 0;
    z-index: 2;
    min-width: 175px;
    background: #fff;
    box-shadow: -10px 0 18px -16px rgba(28, 36, 48, .55);
}

.user-approval-table thead th:last-child {
    z-index: 3;
    background: #fff;
}

@media (max-width: 767.98px) {
    .admin-table {
        min-width: 760px;
    }

    .report-detail-grid {
        grid-template-columns: 1fr;
    }

    .report-detail-full {
        grid-column: auto;
    }
}

@media (max-width: 992px) {
    .register-page {
        padding: 20px;
    }

    .register-shell {
        min-height: calc(100vh - 40px);
        grid-template-columns: 1fr;
    }

    .register-intro {
        padding: 28px 34px;
    }

    .register-intro-content,
    .register-intro-note {
        display: none;
    }

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

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

    .admin-filter-form .table-search {
        grid-column: 1 / -1;
    }
}

@media (min-width: 1400px) {
    main.container-fluid,
    .navbar .container-fluid {
        max-width: 1560px;
        margin-inline: auto;
    }
}

@media (max-width: 767.98px) {
    .navbar .container-fluid {
        flex-wrap: wrap;
        gap: 10px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .navbar-brand {
        max-width: calc(100% - 56px);
        white-space: normal;
        line-height: 1.2;
    }

    .navbar .container-fluid > div {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        padding-left: 46px;
    }

    .table-responsive {
        overflow: visible;
    }

    #reportsTable {
        min-width: 0;
        margin-bottom: 0;
    }

    #reportsTable thead {
        display: none;
    }

    #reportsTable tbody,
    #reportsTable tr,
    #reportsTable td {
        display: block;
        width: 100%;
    }

    #reportsTable tr {
        margin-bottom: 16px;
        padding: 14px;
        border: 1px solid var(--panel-border);
        border-radius: 10px;
        background: #fff;
    }

    #reportsTable td {
        display: grid;
        grid-template-columns: minmax(105px, 36%) 1fr;
        gap: 12px;
        padding: 8px 0;
        border: 0;
        overflow-wrap: anywhere;
    }

    #reportsTable td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.8rem;
        font-weight: 700;
    }

    #reportsTable td[colspan] {
        display: block;
    }

    #reportsTable td[colspan]::before {
        content: none;
    }

    .description-preview {
        max-width: none;
        white-space: normal;
    }
}

@media (max-width: 576px) {
    .register-page {
        padding: 0;
        background: #fff;
    }

    .register-shell {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .register-intro {
        padding: 20px;
    }

    .register-form-panel {
        padding: 28px 20px 34px;
    }

    .register-mobile-icon {
        width: 46px;
        height: 46px;
        flex: 0 0 46px;
        display: grid;
        place-items: center;
        border-radius: 12px;
        background: #edf5ff;
        color: #1769d2;
        font-size: 1.2rem;
    }

    .register-grid,
    .register-grid-three {
        grid-template-columns: 1fr;
    }

    main.container-fluid,
    .navbar .container-fluid {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .panel {
        padding: 16px;
    }

    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .table-search {
        max-width: none;
        width: 100%;
    }

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

    .admin-filter-form .table-search {
        grid-column: auto;
    }

    .auth-page {
        display: block;
        padding: 0;
        background: #fff;
    }

    .auth-card {
        width: 100%;
        min-height: 100vh;
        padding: 32px 20px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .stat-card {
        padding: 15px;
    }

    #reportsTable td {
        grid-template-columns: 96px 1fr;
    }

    .form-control,
    .form-select {
        min-height: 46px;
        font-size: 16px;
    }

    textarea.form-control {
        min-height: 130px;
    }

    .btn-lg {
        min-height: 48px;
        font-size: 1rem;
    }

    .alert {
        font-size: 0.9rem;
    }
}

@media (max-width: 359.98px) {
    main.container-fluid,
    .navbar .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .navbar-brand {
        font-size: 0.95rem;
    }

    .navbar .container-fluid > div {
        padding-left: 0;
    }

    #reportsTable td {
        display: block;
    }

    #reportsTable td::before {
        display: block;
        margin-bottom: 4px;
    }
}
