/* ===============================
   Premium Admin Dashboard Style
   =============================== */

:root {
    --bg-main: #08080b;
    --bg-card: #111117;
    --bg-soft: #171720;
    --bg-input: rgba(255, 255, 255, 0.045);

    --primary: #ff0055;
    --primary-light: #ff3d7f;
    --primary-soft: rgba(255, 0, 85, 0.12);

    --text-main: #ffffff;
    --text-muted: #9ca3af;
    --text-soft: #cbd5e1;

    --border: rgba(255, 255, 255, 0.1);
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);

    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 28px;

    --sidebar-width: 280px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 0, 85, 0.18), transparent 32%),
        radial-gradient(circle at bottom right, rgba(120, 80, 255, 0.14), transparent 35%),
        var(--bg-main);
    color: var(--text-main);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font-family: inherit;
}

img {
    max-width: 100%;
    display: block;
}

/* ===============================
   Auth Pages
   =============================== */

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 430px;
    padding: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    background: rgba(15, 15, 20, 0.78);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-weight: 900;
    font-size: 24px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    box-shadow: 0 12px 30px rgba(255, 0, 85, 0.3);
}

.brand-title {
    font-size: 24px;
    margin: 0;
    letter-spacing: -0.04em;
}

.brand-subtitle {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 13px;
}

.auth-heading {
    margin: 30px 0 22px;
}

.auth-heading h1 {
    margin: 0;
    font-size: 30px;
    letter-spacing: -0.05em;
}

.auth-heading p {
    margin: 8px 0 0;
    color: #b8bed3;
    line-height: 1.6;
}

/* ===============================
   Forms
   =============================== */

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #d5d8e8;
    font-weight: 600;
    font-size: 14px;
}

.form-control {
    width: 100%;
    height: 52px;
    border-radius: 15px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-main);
    padding: 0 16px;
    outline: none;
    font-size: 15px;
    transition: 0.25s ease;
}

.form-control:focus {
    border-color: rgba(255, 0, 85, 0.7);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.form-control::placeholder {
    color: #6b7280;
}

.form-error {
    margin-top: 8px;
    color: #fb7185;
    font-size: 13px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 6px 0 20px;
    color: var(--text-soft);
    font-size: 14px;
    cursor: pointer;
}

.checkbox-row input {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 46px;
    border: 0;
    border-radius: var(--radius-md);
    padding: 0 18px;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    transition: 0.25s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    box-shadow: 0 14px 35px rgba(255, 0, 85, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(255, 0, 85, 0.42);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.14);
    color: #fecaca;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.22);
}

.btn-block {
    width: 100%;
}

.auth-hint {
    margin-top: 18px;
    text-align: center;
    color: #7d8498;
    font-size: 13px;
}

/* ===============================
   Admin Layout
   =============================== */

.admin-wrapper {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 24px;
    background: rgba(10, 10, 15, 0.86);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(18px);
}

.sidebar-header {
    margin-bottom: 34px;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 14px;
    color: #aab0c5;
    font-size: 15px;
    font-weight: 600;
    transition: 0.25s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.065);
}

.sidebar-link.active {
    border: 1px solid rgba(255, 0, 85, 0.25);
    box-shadow: inset 0 0 0 1px rgba(255, 0, 85, 0.08);
}

.sidebar-icon {
    width: 22px;
    text-align: center;
}

.admin-main {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 24px;
}

.admin-topbar {
    height: 76px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: rgba(17, 17, 23, 0.76);
    backdrop-filter: blur(18px);
    padding: 0 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-title h1 {
    margin: 0;
    font-size: 28px;
    letter-spacing: -0.04em;
}

.page-title p {
    margin: 5px 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    font-weight: 900;
}

.admin-user-info strong {
    display: block;
    font-size: 14px;
}

.admin-user-info span {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 2px;
}

.content-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: rgba(17, 17, 23, 0.76);
    padding: 24px;
}

/* ===============================
   Dashboard Cards
   =============================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.stat-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025)),
        var(--bg-card);
    padding: 24px;
    min-height: 150px;
}

.stat-card::after {
    content: "";
    position: absolute;
    width: 110px;
    height: 110px;
    right: -35px;
    top: -35px;
    background: rgba(255, 0, 85, 0.14);
    border-radius: 50%;
    filter: blur(2px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255, 0, 85, 0.13);
    color: #ff8aad;
    margin-bottom: 18px;
}

.stat-label {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
}

.stat-value {
    margin: 8px 0 0;
    font-size: 38px;
    letter-spacing: -0.06em;
}

/* ===============================
   Alerts
   =============================== */

.alert {
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 600;
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.22);
    color: #bbf7d0;
}

/* ===============================
   Responsive
   =============================== */

.mobile-menu-btn {
    display: none;
}

@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 820px) {
    .sidebar {
        display: none;
    }

    .admin-main {
        width: 100%;
        margin-left: 0;
        padding: 16px;
    }

    .admin-topbar {
        height: auto;
        padding: 18px;
        align-items: flex-start;
        gap: 16px;
        flex-direction: column;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .admin-user {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 520px) {
    .auth-card {
        padding: 24px;
        border-radius: 22px;
    }

    .auth-heading h1 {
        font-size: 26px;
    }

    .brand-title {
        font-size: 21px;
    }

    .page-title h1 {
        font-size: 24px;
    }

    .stat-value {
        font-size: 32px;
    }
}

/* ===============================
   Page Actions
   =============================== */

.page-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: #d7dbea;
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-sm {
    height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 13px;
}

/* ===============================
   Forms Layout
   =============================== */

.form-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: rgba(17, 17, 23, 0.76);
    padding: 24px;
}

.form-section {
    margin-bottom: 30px;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-title {
    margin: 0 0 18px;
    font-size: 18px;
    letter-spacing: -0.03em;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.form-full {
    grid-column: 1 / -1;
}

textarea.form-control {
    height: auto;
    min-height: 130px;
    padding-top: 14px;
    resize: vertical;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid var(--border);
    margin-top: 30px;
    padding-top: 24px;
}

.input-hint {
    margin-top: 7px;
    font-size: 12px;
    color: var(--text-muted);
}

.preview-box {
    width: 100%;
    min-height: 92px;
    border: 1px dashed rgba(255,255,255,0.18);
    border-radius: 16px;
    background: rgba(255,255,255,0.035);
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-box img {
    max-height: 70px;
    object-fit: contain;
}

.preview-empty {
    color: var(--text-muted);
    font-size: 13px;
}

.color-input {
    padding: 6px;
    cursor: pointer;
}

/* ===============================
   Responsive Forms
   =============================== */

@media (max-width: 900px) {
    .form-grid,
    .form-grid-3 {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }
}

.mt-12 {
    margin-top: 12px;
}

/* ===============================
   Admin Tables
   =============================== */

.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.card-header-row .form-section-title {
    margin-bottom: 6px;
}

.card-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.025);
}

.admin-table {
    width: 100%;
    min-width: 900px;
    border-collapse: separate;
    border-spacing: 0;
}

.admin-table thead th {
    padding: 16px 18px;
    color: #b8bed3;
    font-size: 12px;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(255, 255, 255, 0.035);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.admin-table tbody td {
    padding: 18px;
    color: var(--text-soft);
    font-size: 14px;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

.admin-table tbody tr {
    transition: 0.2s ease;
}

.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.035);
}

.table-title {
    color: var(--text-main);
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 6px;
}

.table-description {
    max-width: 520px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.table-muted {
    color: var(--text-muted);
    font-weight: 700;
}

.table-icon-text {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    color: #ffd4e2;
    background: var(--primary-soft);
    font-size: 13px;
    font-weight: 800;
}

.table-image {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    object-fit: cover;
    border: 1px solid var(--border);
    background: var(--bg-soft);
}

.table-image-placeholder {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: var(--text-muted);
    border: 1px dashed rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.035);
    font-weight: 800;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.status-active {
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.22);
}

.status-hidden {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.22);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.table-actions form {
    margin: 0;
}

.empty-state {
    padding: 42px 20px;
    text-align: center;
}

.empty-state-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    border-radius: 18px;
    background: var(--primary-soft);
    font-size: 24px;
}

.empty-state h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.empty-state p {
    margin: 0 0 18px;
    color: var(--text-muted);
}

.pagination-wrap {
    margin-top: 22px;
}

/* ===============================
   Responsive Tables
   =============================== */

@media (max-width: 700px) {
    .card-header-row {
        align-items: stretch;
        flex-direction: column;
    }

    .card-header-row .btn {
        width: 100%;
    }
}

.readonly-control {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
}

.mt-24 {
    margin-top: 24px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.gallery-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.035);
    padding: 14px;
}

.gallery-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid var(--border);
    margin-bottom: 14px;
}

.gallery-actions {
    display: flex;
    justify-content: flex-end;
}

.gallery-delete-forms {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

@media (max-width: 1200px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 820px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* ===============================
   Pagination
   =============================== */

.pagination-wrap {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.pagination-wrap nav[role="navigation"] {
    width: 100%;
}

/* hide mobile pagination on desktop */
.pagination-wrap nav[role="navigation"] > div:first-child {
    display: none;
}

/* desktop pagination */
.pagination-wrap nav[role="navigation"] > div:last-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.pagination-wrap nav[role="navigation"] > div:last-child > div:first-child {
    flex: 1 1 260px;
}

.pagination-wrap nav[role="navigation"] > div:last-child > div:first-child p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.pagination-wrap nav[role="navigation"] > div:last-child > div:last-child {
    flex: 0 0 auto;
}

.pagination-wrap nav[role="navigation"] > div:last-child > div:last-child > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* links / buttons */
.pagination-wrap nav[role="navigation"] a,
.pagination-wrap nav[role="navigation"] span[aria-current="page"] span,
.pagination-wrap nav[role="navigation"] span[aria-disabled="true"] span {
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    transition: 0.25s ease;
}

.pagination-wrap nav[role="navigation"] a:hover {
    color: #fff;
    background: rgba(255, 0, 85, 0.12);
    border-color: rgba(255, 0, 85, 0.3);
}

.pagination-wrap nav[role="navigation"] span[aria-current="page"] span {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-color: rgba(255, 0, 85, 0.35);
    box-shadow: 0 10px 24px rgba(255, 0, 85, 0.25);
}

.pagination-wrap nav[role="navigation"] span[aria-disabled="true"] span {
    opacity: 0.45;
    cursor: not-allowed;
}

.pagination-wrap nav[role="navigation"] svg {
    width: 16px;
    height: 16px;
}

/* mobile pagination */
@media (max-width: 640px) {
    .pagination-wrap nav[role="navigation"] > div:first-child {
        display: flex;
        justify-content: space-between;
        gap: 12px;
    }

    .pagination-wrap nav[role="navigation"] > div:last-child {
        display: none;
    }

    .pagination-wrap nav[role="navigation"] > div:first-child a,
    .pagination-wrap nav[role="navigation"] > div:first-child span {
        min-width: 110px;
        height: 40px;
        padding: 0 16px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        border: 1px solid var(--border);
        background: rgba(255, 255, 255, 0.05);
        color: var(--text-soft);
        font-size: 14px;
        font-weight: 700;
    }
}