:root {
    --primary-color: #2A4D69;
    --surface: #ffffff;
    --background: #f4f6fb;
    --border: #d8dde9;
    --text: #1f2937;
    --muted: #64748b;
    --danger: #dc2626;
    --radius-lg: 20px;
    --radius-md: 14px;
    --shadow: 0 18px 36px rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.06);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
    margin: 0;
    font-family: inherit;
    background: var(--background);
    color: var(--text);
}

.hp-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

.hp-bottom-nav {
    display: none;
}

.hp-bottom-nav__link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    text-decoration: none;
}

.hp-bottom-nav__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    color: inherit;
    transition: transform 0.2s ease, color 0.2s ease;
}

.hp-bottom-nav__svg {
    width: 1.4rem;
    height: 1.4rem;
    display: block;
}

.hp-bottom-nav__label {
    line-height: 1.2;
    font-size: 0.78rem;
}

.hp-admin-bottom-nav {
    display: none;
}

.hp-admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2.5rem;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.hp-admin-brand span {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.hp-admin-logo {
    height: 34px;
    width: auto;
}

.hp-admin-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-weight: 600;
    color: var(--muted);
}

.hp-admin-nav a {
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    transition: color 0.2s ease, background 0.2s ease;
}

.hp-admin-nav a:hover,
.hp-admin-nav a.is-active {
    color: var(--primary-color);
    background: rgba(42, 77, 105, 0.12);
}

.hp-admin-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--muted);
    font-weight: 500;
}

.hp-admin-logout {
    font-weight: 600;
    color: var(--primary-color);
}

.hp-admin-main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 2.5rem 2rem 3.5rem;
}

.hp-admin-section h1 {
    margin-bottom: 0.4rem;
    font-size: 2rem;
}

.hp-section-subtitle {
    margin-top: 0;
    color: var(--muted);
}

.hp-admin-stats {
    display: grid;
    gap: 1.5rem;
    margin: 2.5rem 0;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.hp-admin-stat-card {
    background: var(--surface);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    display: grid;
    gap: 0.5rem;
}

.hp-stat-title {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.hp-stat-number {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--primary-color);
}

.hp-stat-link {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.hp-admin-grid {
    display: grid;
    gap: 1.75rem;
    margin-bottom: 3rem;
}

.hp-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 1.8rem;
    box-shadow: var(--shadow-soft);
}

.hp-simple-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.8rem;
}

.hp-simple-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-weight: 500;
    color: var(--text);
}

.hp-simple-list small {
    color: var(--muted);
}

.hp-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.hp-btn {
    border-radius: 999px;
    padding: 0.65rem 1.5rem;
    font-weight: 600;
    border: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
    font-family: inherit;
}

.hp-btn:focus-visible {
    outline: 3px solid rgba(42, 77, 105, 0.24);
    outline-offset: 2px;
}

.hp-btn-primary {
    background: var(--primary-color);
    color: #fff;
    box-shadow: var(--shadow-soft);
}

.hp-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.hp-btn-outline {
    background: transparent;
    border-color: rgba(42, 77, 105, 0.25);
    color: var(--primary-color);
}

.hp-btn-outline:hover {
    background: rgba(42, 77, 105, 0.08);
}

.hp-btn-danger {
    background: var(--danger);
    color: #fff;
}

.hp-btn-danger:hover {
    background: #b91c1c;
}

.hp-alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hp-alert-success {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
}

.hp-alert-error {
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
}

.hp-alert-warning {
    background: rgba(234, 179, 8, 0.18);
    color: #92400e;
}

.hp-section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

.hp-table-wrapper {
    overflow-x: auto;
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
}

.hp-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.hp-table th,
.hp-table td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
}

.hp-table th {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--muted);
    white-space: nowrap;
}

.hp-table th,
.hp-table thead th,
table.dataTable thead th {
    white-space: nowrap !important;
}

.hp-table tbody tr:hover {
    background: rgba(241, 245, 249, 0.6);
}

.hp-table td {
    vertical-align: top;
}

.dt-container,
.dataTables_wrapper {
    padding: 1.25rem 1.25rem 0.75rem;
}

.dt-container .dt-layout-row,
.dataTables_wrapper .dt-layout-row {
    gap: 0.85rem;
}

.dt-container .dt-search input,
.dt-container .dt-length select,
.dataTables_wrapper .dt-search input,
.dataTables_wrapper .dt-length select {
    padding: 0.6rem 0.8rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.38);
    background: var(--background);
    font: inherit;
}

.dt-container .dt-search input:focus,
.dt-container .dt-length select:focus,
.dataTables_wrapper .dt-search input:focus,
.dataTables_wrapper .dt-length select:focus {
    outline: none;
    border-color: rgba(42, 77, 105, 0.7);
    box-shadow: 0 0 0 3px rgba(42, 77, 105, 0.12);
    background: #fff;
}

.dt-container .dt-paging button,
.dataTables_wrapper .dt-paging button {
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: #fff;
    color: var(--text);
    font-weight: 600;
}

.dt-container .dt-paging button:hover,
.dataTables_wrapper .dt-paging button:hover {
    background: rgba(42, 77, 105, 0.08);
    border-color: rgba(42, 77, 105, 0.25);
}

.dt-container .dt-paging button.current,
.dataTables_wrapper .dt-paging button.current {
    background: rgba(42, 77, 105, 0.12);
    border-color: rgba(42, 77, 105, 0.25);
    color: var(--primary-color);
}

.dt-container .dt-paging button.disabled,
.dataTables_wrapper .dt-paging button.disabled {
    opacity: 0.55;
}

.dt-container table.dataTable,
.dataTables_wrapper table.dataTable {
    margin: 0 !important;
    width: 100% !important;
}

.dt-container .dataTable thead th,
.dataTables_wrapper .dataTable thead th {
    white-space: nowrap;
}

.dt-container .dt-info,
.dataTables_wrapper .dt-info {
    color: var(--muted);
    font-weight: 500;
}

.dt-container .dt-length,
.dt-container .dt-search,
.dataTables_wrapper .dt-length,
.dataTables_wrapper .dt-search {
    color: var(--muted);
    font-weight: 600;
}

.dt-container .dt-length label,
.dt-container .dt-search label,
.dataTables_wrapper .dt-length label,
.dataTables_wrapper .dt-search label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.dt-container .dt-length select,
.dataTables_wrapper .dt-length select {
    min-width: 90px;
}

.dt-container .dt-search input,
.dataTables_wrapper .dt-search input {
    min-width: min(260px, 100%);
}

.hp-table-actions {
    /* display: flex; */
    gap: 0.5rem;
    white-space: nowrap;
}

.hp-action-group {
    display: inline-flex;
    align-items: center;
    background: rgba(241, 245, 249, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    overflow: hidden;
}

.hp-action-group form {
    margin: 0;
}

.hp-icon-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--primary-color);
    padding: 0.55rem 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    cursor: pointer;
    font-weight: 700;
    line-height: 1;
}

.hp-icon-btn:hover {
    background: rgba(42, 77, 105, 0.1);
}

.hp-icon-btn:focus-visible {
    outline: 3px solid rgba(42, 77, 105, 0.24);
    outline-offset: 2px;
}

.hp-icon-btn--danger {
    color: var(--danger);
}

.hp-icon-btn--danger:hover {
    background: rgba(220, 38, 38, 0.12);
}

.hp-icon-btn+.hp-icon-btn,
.hp-action-group form+.hp-icon-btn,
.hp-icon-btn+form {
    border-left: 1px solid rgba(148, 163, 184, 0.28);
}

.hp-icon-btn i {
    font-size: 0.95rem;
}

.hp-inline-form {
    margin: 0;
}

/* Form Layout */
.hp-form {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 2.25rem;
    display: grid;
    gap: 2.25rem;
}

.hp-form.separated {
    border-top: none;
    padding-top: 0;
    gap: 3rem;
}

.hp-form-stack {
    display: grid;
    gap: 1.85rem;
}

.hp-form-stack+.hp-form-stack {
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    padding-top: 2.25rem;
}

.hp-form-stack>h2 {
    margin: 0;
    font-size: 1.32rem;
    color: var(--text);
}

.hp-form-stack>p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.hp-form-grid {
    display: grid;
    gap: 1.5rem;
}

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

.hp-form-field-full {
    grid-column: 1 / -1;
}

.hp-form-row {
    display: grid;
    gap: 1.1rem;
}

.hp-form-field {
    display: grid;
    gap: 0.65rem;
}

.hp-form-field label {
    margin: 0;
    font-weight: 600;
    color: var(--muted);
}

.hp-form-control,
.hp-form-field input,
.hp-form-field textarea,
.hp-form-field select {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.38);
    background: var(--background);
    font: inherit;
    transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.hp-form-field input:focus,
.hp-form-field textarea:focus,
.hp-form-field select:focus,
.hp-form-control:focus {
    outline: none;
    border-color: rgba(42, 77, 105, 0.7);
    box-shadow: 0 0 0 3px rgba(42, 77, 105, 0.12);
    background: #fff;
}

.hp-form-field input[type="color"] {
    padding: 0.25rem;
    height: 3rem;
    width: 100%;
    cursor: pointer;
    background: #fff;
}

.hp-form-field input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 8px;
}

.hp-form-field input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 8px;
}

.hp-form-field input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 8px;
}

.hp-form-field small {
    color: var(--muted);
    font-size: 0.84rem;
}

.hp-form-helper {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.hp-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
}

.hp-current-photo {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.hp-current-photo img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.06);
    padding: 0.75rem;
}

.hp-checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
    color: var(--muted);
}

.hp-admin-footer {
    padding: 1.5rem 2rem 2.5rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.hp-admin-login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    padding: 2rem 1.5rem;
}

.hp-login-card {
    background: var(--surface);
    padding: clamp(2rem, 6vw, 2.75rem);
    border-radius: 24px;
    box-shadow: var(--shadow);
    width: min(420px, 100%);
    display: grid;
    gap: 1.5rem;
    text-align: center;
}

.hp-login-card h1 {
    margin: 0;
    font-size: 1.8rem;
    color: var(--text);
}

.hp-login-card form {
    display: grid;
    gap: 1rem;
    text-align: left;
}

.hp-login-card label {
    font-weight: 600;
    color: var(--muted);
}

.hp-login-card input {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: var(--background);
    font: inherit;
}

.hp-login-card input:focus {
    outline: none;
    border-color: rgba(42, 77, 105, 0.65);
    box-shadow: 0 0 0 3px rgba(42, 77, 105, 0.15);
    background: var(--surface);
}

.hp-login-brand img,
.hp-login-brand span {
    width: 160px;
    margin: 0 auto;
    display: block;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.45rem;
}

@media (min-width: 680px) {
    .hp-admin-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hp-admin-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

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

@media (min-width: 960px) {
    .hp-admin-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .hp-admin-stats {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .hp-admin-header {
        padding: 1rem 1.75rem;
    }

    .hp-admin-nav {
        gap: 1rem;
    }

    .hp-admin-main {
        padding: 2rem 1.75rem 3rem;
    }
}

@media (max-width: 900px) {
    .hp-section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .hp-section-header>* {
        width: 100%;
    }

    .hp-section-header .hp-btn {
        align-self: flex-start;
    }
}

@media (max-width: 720px) {
    body.hp-with-bottom-nav {
        padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    }

    .hp-admin-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        padding: 1rem 1.25rem 0.75rem;
    }

    .hp-admin-nav {
        display: none;
    }

    .hp-admin-user {
        width: 100%;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .hp-admin-bottom-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        align-items: center;
        justify-content: space-around;
        padding: 0.45rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(16px);
        border-top: 1px solid rgba(148, 163, 184, 0.2);
        box-shadow: 0 -10px 28px rgba(15, 23, 42, 0.1);
        z-index: 30;
    }

    .hp-bottom-nav__link {
        flex: 1 1 0;
        font-size: 0.82rem;
        font-weight: 600;
        color: var(--muted);
        padding: 0.4rem 0.3rem;
        border-radius: 12px;
        transition: color 0.2s ease, background 0.2s ease;
    }

    .hp-bottom-nav__link:hover,
    .hp-bottom-nav__link:focus-visible,
    .hp-bottom-nav__link.is-active {
        color: var(--primary-color);
        background: rgba(42, 77, 105, 0.14);
    }

    .hp-bottom-nav__link:hover .hp-bottom-nav__icon,
    .hp-bottom-nav__link:focus-visible .hp-bottom-nav__icon,
    .hp-bottom-nav__link.is-active .hp-bottom-nav__icon {
        transform: scale(1.08);
    }

    .hp-admin-main {
        padding: 1.75rem 1.25rem calc(3.5rem + 64px);
    }

    .hp-table {
        min-width: 640px;
    }

    .hp-quick-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hp-form-actions {
        justify-content: flex-start;
        width: 100%;
    }

    .hp-form-actions .hp-btn {
        flex: 1 1 auto;
    }

    .hp-current-photo {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .hp-form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hp-form-actions .hp-btn {
        width: 100%;
    }
}

@media (min-width: 721px) {
    .hp-admin-bottom-nav {
        display: none !important;
    }
}

@media (max-width: 540px) {
    .hp-admin-login-page {
        padding: 1.75rem 1.25rem;
    }

    .hp-login-card {
        gap: 1.25rem;
        border-radius: 20px;
    }

    .hp-login-card h1 {
        font-size: 1.7rem;
    }

    .hp-login-card form {
        gap: 0.85rem;
    }

    .hp-login-card label {
        font-size: 0.95rem;
    }

    .hp-login-card input {
        padding: 0.7rem 0.9rem;
    }

    .hp-login-card form .hp-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 380px) {
    .hp-admin-login-page {
        padding: 1.5rem 1rem;
    }

    .hp-login-card {
        padding: 1.6rem 1.4rem;
        border-radius: 16px;
    }

    .hp-login-card h1 {
        font-size: 1.5rem;
    }

    .hp-login-card label {
        font-size: 0.9rem;
    }
}
