:root {
    --sidebar-width: 270px;
    --primary: #0d6efd;
    --dark: #0f172a;
    --soft-bg: #f5f7fb;
    --border: #e5e7eb;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    background: var(--soft-bg);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text-dark);
    margin: 0;
}

/* =========================
   Login Page
========================= */

.login-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(13, 110, 253, 0.35), transparent 35%),
        linear-gradient(135deg, #0f172a, #1e293b);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-wrapper {
    width: 100%;
    max-width: 430px;
    padding: 20px;
}

.login-card {
    background: #ffffff;
    padding: 35px;
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
}

.login-logo {
    width: 70px;
    height: 70px;
    margin: auto;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #0d6efd, #6610f2);
    color: #ffffff;
    font-weight: 800;
    font-size: 24px;
}

/* =========================
   Admin Layout
========================= */

.admin-layout {
    display: flex;
    min-height: 100vh;
    background: var(--soft-bg);
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: #0f172a;
    color: #ffffff;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1000;
}

.sidebar-brand {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand strong {
    color: #ffffff;
    display: block;
    line-height: 1.2;
}

.sidebar-brand small {
    display: block;
    color: #94a3b8;
    font-size: 12px;
    margin-top: 2px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, #0d6efd, #6610f2);
}

.sidebar-menu {
    padding: 16px;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 14px;
    margin-bottom: 6px;
    transition: 0.2s ease;
    font-size: 14px;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.sidebar-menu i {
    font-size: 18px;
}

.menu-title {
    color: #64748b;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.08em;
    margin: 18px 10px 8px;
    font-weight: 700;
}

.logout-link {
    color: #fecaca !important;
}

.admin-main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
}

.admin-topbar {
    min-height: 76px;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 500;
}

.admin-topbar h5 {
    font-weight: 800;
    color: #0f172a;
}

.admin-content {
    padding: 28px;
}

/* =========================
   Cards / Dashboard
========================= */

.dashboard-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 22px;
    display: flex;
    gap: 16px;
    align-items: center;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
    height: 100%;
}

.dashboard-card h3 {
    margin: 0;
    font-weight: 800;
    color: #0f172a;
}

.dashboard-card p {
    margin: 0;
    color: #64748b;
}

.card-icon {
    width: 58px;
    height: 58px;
    min-width: 58px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    font-size: 26px;
}

.panel-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
    overflow: hidden;
    margin-bottom: 20px;
}

.panel-card-header {
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.panel-card-header h5 {
    margin: 0;
    font-weight: 800;
    font-size: 16px;
    color: #0f172a;
}

.panel-card-body {
    padding: 22px !important;
}

/* =========================
   Form Design
========================= */

.admin-content form .form-label {
    font-weight: 600;
    color: #334155;
    font-size: 13px;
    margin-bottom: 6px;
}

.admin-content .form-control,
.admin-content .form-select {
    min-height: 42px;
    border-radius: 10px;
    border-color: #dbe3ef;
    font-size: 14px;
}

.admin-content textarea.form-control {
    min-height: 95px;
}

.admin-content .form-control:focus,
.admin-content .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.18rem rgba(13, 110, 253, 0.12);
}

.form-control-color {
    width: 56px;
    height: 42px;
    padding: 6px;
    border-radius: 10px;
}

.code-textarea {
    font-family: Consolas, monospace;
    font-size: 13px;
}

.btn {
    border-radius: 10px;
}

.btn-lg {
    min-height: 46px;
}

.badge {
    border-radius: 20px;
    padding: 6px 10px;
}

/* =========================
   Table / Alert
========================= */

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    color: #334155;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.alert {
    border-radius: 16px;
}

/* =========================
   Quick Actions
========================= */

.quick-actions {
    padding: 18px;
    display: grid;
    gap: 12px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border: 1px solid var(--border);
    padding: 14px;
    border-radius: 16px;
    color: #0f172a;
    text-decoration: none;
    transition: 0.2s ease;
}

.quick-action:hover {
    background: #eef4ff;
    border-color: #bfdbfe;
}

.quick-action i {
    font-size: 22px;
    color: var(--primary);
}

/* =========================
   Settings Page
========================= */

.settings-preview-img {
    max-width: 220px;
    height: auto;
    border-radius: 16px;
    border: 1px solid var(--border);
    padding: 6px;
    background: #fff;
}

.brand-preview-box {
    min-height: 110px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    display: grid;
    place-items: center;
    padding: 18px;
    margin-top: 10px;
}

.brand-preview-box img {
    max-width: 220px;
    max-height: 90px;
    object-fit: contain;
}

.favicon-preview-box {
    width: 80px;
    height: 80px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    display: grid;
    place-items: center;
    padding: 12px;
    margin-top: 10px;
}

.favicon-preview-box img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.empty-preview {
    background: #f8fafc;
    color: #64748b;
    border: 1px dashed #cbd5e1;
    padding: 20px;
    text-align: center;
    border-radius: 18px;
    margin-top: 10px;
}

.website-preview-card {
    text-align: center;
    background: linear-gradient(180deg, #f8fafc, #ffffff);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 24px;
    margin-top: 10px;
}

.website-preview-card img {
    max-width: 180px;
    max-height: 70px;
    object-fit: contain;
    margin-bottom: 14px;
}

.website-preview-card h6 {
    font-size: 17px;
    font-weight: 800;
    margin-top: 8px;
    margin-bottom: 4px;
}

.website-preview-card p {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 14px;
}

.preview-logo-text {
    font-weight: 800;
    font-size: 22px;
    color: #0f172a;
    margin-bottom: 14px;
}

/* =========================
   Media Manager
========================= */

.upload-zone {
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    border-radius: 20px;
    padding: 24px;
    text-align: center;
}

.upload-zone i {
    font-size: 42px;
    color: var(--primary);
}

.upload-zone h6 {
    margin-top: 10px;
    font-weight: 700;
}

.upload-zone p {
    color: #64748b;
    font-size: 14px;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 18px;
}

.media-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    overflow: hidden;
    transition: 0.2s ease;
}

.media-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
}

.media-thumb {
    height: 135px;
    background: #f8fafc;
    display: grid;
    place-items: center;
    border-bottom: 1px solid var(--border);
}

.media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-icon {
    text-align: center;
    color: #475569;
}

.file-icon i {
    font-size: 44px;
    display: block;
}

.file-icon span {
    font-size: 12px;
    font-weight: 700;
}

.media-info {
    padding: 13px;
}

.media-info h6 {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-info p {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 10px;
}

.media-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.media-actions form {
    display: inline;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.empty-state i {
    font-size: 64px;
    color: #cbd5e1;
    margin-bottom: 14px;
}

/* =========================
   Mobile Sidebar Support
========================= */

.mobile-menu-btn {
    display: none;
}

.sidebar-overlay {
    display: none;
}

/* =========================
   Responsive
========================= */

@media (max-width: 991px) {
    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .admin-sidebar {
        transform: translateX(-100%);
        transition: 0.3s ease;
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
        width: 100%;
    }

    .admin-content {
        padding: 18px;
    }

    .panel-card-body {
        padding: 18px !important;
    }

    .admin-topbar {
        padding: 0 16px;
        gap: 12px;
    }

    .admin-topbar > div:first-child {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.55);
        z-index: 900;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 575px) {
    .login-card {
        padding: 24px;
        border-radius: 18px;
    }

    .admin-topbar {
        height: auto;
        min-height: 76px;
        flex-wrap: wrap;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .admin-topbar .btn-outline-primary {
        display: none;
    }

    .media-grid {
        grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    }

    .dashboard-card {
        padding: 18px;
    }

    .card-icon {
        width: 48px;
        height: 48px;
        min-width: 48px;
        font-size: 22px;
    }
}
.admin-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-menu-btn {
    display: none;
}

.sidebar-overlay {
    display: none;
}

@media (max-width: 991px) {
    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.55);
        z-index: 900;
    }

    .sidebar-overlay.show {
        display: block;
    }

    .admin-sidebar {
        transform: translateX(-100%);
        transition: 0.3s ease;
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .admin-main {
        margin-left: 0;
        width: 100%;
    }

    .admin-topbar {
        padding: 12px 16px;
    }

    .admin-actions .btn-outline-primary {
        display: none;
    }
}
.section-item-heading {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px 24px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.table-thumb {
    width: 54px;
    height: 54px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--border);
    background: #f8fafc;
}

.code-textarea {
    font-family: Consolas, monospace;
    font-size: 13px;
}
.gallery-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
}

.gallery-admin-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
}

.gallery-admin-card > img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: #f8fafc;
}
.sidebar-badge {
    margin-left: auto;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    display: inline-grid;
    place-items: center;
    font-size: 12px;
    font-weight: 800;
}

.contact-detail-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
}

.contact-detail-header h4 {
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 6px;
}

.contact-info-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 15px;
    height: 100%;
}

.contact-info-box strong {
    display: block;
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.contact-info-box span {
    color: #0f172a;
    font-weight: 700;
    word-break: break-word;
}

.contact-message-box {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 22px;
    color: #334155;
    line-height: 1.7;
    white-space: normal;
}

.table-warning td {
    background-color: #fff8e1 !important;
}
.module-code-box {
    background: #0f172a;
    color: #dbeafe;
    border-radius: 16px;
    padding: 18px;
    font-size: 13px;
    overflow-x: auto;
    margin: 0;
}

.module-card-icon {
    width: 54px;
    height: 54px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: rgba(13, 110, 253, 0.09);
    color: #0d6efd;
    font-size: 26px;
}
.update-info-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 15px;
    height: 100%;
}

.update-info-box strong {
    display: block;
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.update-info-box span {
    color: #0f172a;
    font-weight: 700;
    word-break: break-word;
}

.update-log-box {
    background: #0f172a;
    color: #dbeafe;
    border-radius: 18px;
    padding: 20px;
    min-height: 260px;
    max-height: 520px;
    overflow: auto;
    font-size: 13px;
    line-height: 1.7;
}