* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f5f6f8;
    color: #222;
}

.admin-layout {
    min-height: 100vh;
    display: flex;
}


/* =========================
   SIDEBAR
========================= */

.admin-sidebar {
    width: 245px;
    min-width: 245px;
    background: #111;
    color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.admin-logo {
    padding: 24px 22px;
    border-bottom: 1px solid #292929;
}

.admin-logo a {
    color: #fff;
    text-decoration: none;
    font-size: 22px;
    font-weight: 700;
}

.admin-logo a span {
    color: #d79b35;
}

.admin-logo small {
    display: block;
    margin-top: 5px;
    font-size: 9px;
    letter-spacing: 2px;
    color: #999;
}

.admin-nav {
    padding: 15px 10px;
    flex: 1;
}

.admin-nav-title {
    padding: 18px 12px 7px;
    font-size: 9px;
    letter-spacing: 1.5px;
    color: #777;
    font-weight: 700;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    margin-bottom: 3px;
    border-radius: 7px;
    color: #bbb;
    text-decoration: none;
    font-size: 13px;
    transition: .2s;
}

.admin-nav-item i {
    width: 18px;
    text-align: center;
}

.admin-nav-item:hover,
.admin-nav-item.active {
    background: #252525;
    color: #fff;
}

.admin-sidebar-bottom {
    padding: 10px;
    border-top: 1px solid #292929;
}

.admin-nav-item.logout:hover {
    color: #ff6b6b;
}


/* =========================
   MAIN
========================= */

.admin-main {
    flex: 1;
    min-width: 0;
}

.admin-topbar {
    height: 64px;
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    display: flex;
    align-items: center;
    padding: 0 25px;
}

.admin-page-title {
    flex: 1;
    font-size: 15px;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #555;
    font-size: 13px;
}

.admin-user i {
    font-size: 20px;
}

.admin-menu-btn {
    display: none;
    border: 0;
    background: none;
    font-size: 20px;
    cursor: pointer;
    margin-right: 15px;
}

.admin-content {
    padding: 28px;
}


/* =========================
   DASHBOARD
========================= */

.dashboard-heading {
    margin-bottom: 25px;
}

.dashboard-heading h1 {
    margin: 0 0 5px;
    font-size: 26px;
}

.dashboard-heading p {
    margin: 0;
    color: #777;
    font-size: 13px;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 10px;
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 9px;
    background: #f7f1e7;
    color: #b67a18;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.stat-info {
    min-width: 0;
}

.stat-info span {
    display: block;
    font-size: 11px;
    color: #777;
    margin-bottom: 5px;
}

.stat-info strong {
    display: block;
    font-size: 21px;
}


/* =========================
   QUICK ACTIONS
========================= */

.dashboard-section {
    margin-top: 30px;
}

.dashboard-section h2 {
    margin: 0 0 15px;
    font-size: 18px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.quick-actions a {
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 9px;
    padding: 18px 14px;
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
}

.quick-actions a:hover {
    border-color: #d0a052;
}

.quick-actions i {
    color: #b67a18;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 900px) {

    .admin-sidebar {
        position: fixed;
        left: -245px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left .25s ease;
    }

    .admin-sidebar.active {
        left: 0;
    }

    .admin-menu-btn {
        display: block;
    }

    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}


@media (max-width: 600px) {

    .admin-topbar {
        padding: 0 15px;
    }

    .admin-user span {
        display: none;
    }

    .admin-content {
        padding: 18px 14px;
    }

    .dashboard-heading h1 {
        font-size: 22px;
    }

    .dashboard-stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 13px;
        gap: 9px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .stat-info span {
        font-size: 10px;
    }

    .stat-info strong {
        font-size: 17px;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   USER MANAGEMENT
===================================================== */

.user-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box {
    position: relative;
    flex: 1;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

.search-box input {
    width: 100%;
    height: 44px;
    padding: 0 15px 0 42px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    outline: none;
}

.search-box input:focus {
    border-color: #222;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
    background: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.user-info strong {
    display: block;
}

.user-info small {
    display: block;
    margin-top: 3px;
    color: #888;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-icon {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .2s;
}

.action-icon.view {
    background: #eef4ff;
    color: #3565b8;
}

.action-icon.edit {
    background: #fff5df;
    color: #9a6800;
}

.action-icon.danger {
    background: #fdecec;
    color: #c62828;
}

.action-icon.success {
    background: #e8f7ee;
    color: #168044;
}

.action-icon:hover {
    transform: translateY(-1px);
}


/* =====================================================
   MODAL
===================================================== */

body.modal-open {
    overflow: hidden;
}

.admin-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
}

.admin-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(2px);
}

.admin-modal-box {
    position: relative;
    z-index: 2;
    width: calc(100% - 30px);
    max-width: 650px;
    max-height: calc(100vh - 40px);
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.25);
    animation: adminModalIn .2s ease;
}

.small-modal {
    max-width: 430px;
}

@keyframes adminModalIn {

    from {
        opacity: 0;
        transform: translateY(15px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

}

.admin-modal-header {
    min-height: 70px;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
}

.admin-modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.admin-modal-header span {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: #888;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: 0;
    background: #f5f5f5;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}

.admin-modal-body {
    padding: 22px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.modal-loading {
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    color: #888;
}

.modal-loading i {
    font-size: 25px;
}


/* USER PROFILE */

.user-profile-top {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 22px;
    margin-bottom: 22px;
    border-bottom: 1px solid #eee;
}

.large-user-avatar {
    width: 64px;
    height: 64px;
    min-width: 64px;
    border-radius: 50%;
    background: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
}

.user-profile-top h2 {
    margin: 0 0 7px;
    font-size: 21px;
}

.user-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-item {
    padding: 14px;
    background: #f8f8f8;
    border-radius: 9px;
}

.detail-item label {
    display: block;
    margin-bottom: 6px;
    color: #888;
    font-size: 12px;
}

.detail-item strong {
    font-size: 14px;
    word-break: break-word;
}


/* EDIT FORM */

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    height: 44px;
    padding: 0 13px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    outline: none;
}

.form-group input:focus {
    border-color: #222;
}

.form-group input:disabled {
    background: #f5f5f5;
    color: #888;
}


/* MODAL FOOTER */

.modal-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #eee;
}

.btn-danger {
    background: #c62828;
    color: #fff;
}


/* CONFIRM */

.confirm-content {
    text-align: center;
    padding: 25px 10px 10px;
}

.confirm-icon {
    width: 55px;
    height: 55px;
    margin: 0 auto 15px;
    border-radius: 50%;
    background: #fff5df;
    color: #a36b00;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.confirm-content h3 {
    margin: 0;
}

.confirm-content p {
    color: #888;
    font-size: 13px;
}


/* MOBILE */

@media (max-width: 767px) {

    .user-search-form {
        flex-wrap: wrap;
    }

    .search-box {
        flex: none;
        width: 100%;
    }

    .user-search-form .btn {
        flex: 1;
    }

    .table-wrapper {
        overflow-x: auto;
    }

    .admin-table {
        min-width: 950px;
    }

    .admin-modal-box {
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
        border-radius: 12px;
    }

    .admin-modal-body {
        padding: 17px;
    }

    .user-detail-grid {
        grid-template-columns: 1fr;
    }

    .admin-modal-header {
        min-height: 62px;
        padding: 13px 15px;
    }

}