/* ============================================================
   ADMIN-THEME.CSS — CDP Admin Panel Override
   Overrides Hope UI framework with CDP gold/cream palette
   ============================================================ */

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

/* ============================================================
   CSS Variables — Override Hope UI defaults
   ============================================================ */
:root {
    --bs-primary: #CE912B !important;
    --bs-primary-rgb: 206, 145, 43 !important;
    --bs-link-color: #CE912B !important;
    --bs-link-hover-color: #B07A1E !important;
}

/* ============================================================
   Typography
   ============================================================ */
body, .sidebar, .navbar, .card, .modal, .form-control, .btn, .nav-link, .item-name, h1, h2, h3, h4, h5, h6, p, span, a, label, td, th {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* ============================================================
   Body & Background
   ============================================================ */
body {
    background-color: #F8F4E8 !important;
}

.content-inner {
    background-color: #F8F4E8 !important;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
    background: linear-gradient(180deg, #1A1A2E 0%, #16213E 100%) !important;
    border-right: none !important;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1) !important;
}

.sidebar .sidebar-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(206, 145, 43, 0.15) !important;
}

.sidebar .navbar-brand .logo-title {
    color: #FFFFFF !important;
}

.sidebar .sidebar-body .nav-item .nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
    border-radius: 8px !important;
    margin: 2px 8px !important;
    transition: all 0.3s ease !important;
}

.sidebar .sidebar-body .nav-item .nav-link:hover {
    color: #FFFFFF !important;
    background: rgba(206, 145, 43, 0.15) !important;
}

.sidebar .sidebar-body .nav-item .nav-link.active,
.sidebar .sidebar-body .nav-item.active .nav-link {
    color: #FFFFFF !important;
    background: linear-gradient(135deg, #CE912B 0%, #DCA54A 100%) !important;
    box-shadow: 0 4px 15px rgba(206, 145, 43, 0.3) !important;
}

.sidebar .sidebar-body .nav-item .nav-link .icon svg {
    color: currentColor !important;
}

.sidebar .sidebar-body .nav-item .nav-link .item-name {
    color: inherit !important;
}

.sidebar .sidebar-body .nav-item .nav-link .right-icon svg {
    color: rgba(255, 255, 255, 0.5) !important;
}

.sidebar .sidebar-body hr.hr-horizontal {
    border-color: rgba(206, 145, 43, 0.15) !important;
}

/* Sub-nav items */
.sidebar .sub-nav .nav-item .nav-link {
    color: rgba(255, 255, 255, 0.55) !important;
    padding-left: 2.5rem !important;
    font-size: 0.85rem !important;
}

.sidebar .sub-nav .nav-item .nav-link:hover {
    color: #DCA54A !important;
    background: rgba(206, 145, 43, 0.08) !important;
}

.sidebar .sub-nav .nav-item .nav-link.active {
    color: #DCA54A !important;
    background: rgba(206, 145, 43, 0.12) !important;
    box-shadow: none !important;
}

.sidebar-toggle i {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* ============================================================
   TOP NAVBAR
   ============================================================ */
.iq-navbar {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: 1px solid rgba(206, 145, 43, 0.1) !important;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.04) !important;
}

.iq-navbar .navbar-brand .logo-title {
    color: #2D2D2D !important;
}

/* ============================================================
   BUTTONS — Primary
   ============================================================ */
.btn-primary {
    background: linear-gradient(135deg, #CE912B 0%, #DCA54A 100%) !important;
    border-color: #CE912B !important;
    color: #FFFFFF !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 15px rgba(206, 145, 43, 0.25) !important;
    transition: all 0.3s ease !important;
}

.btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-primary.active {
    background: linear-gradient(135deg, #B07A1E 0%, #CE912B 100%) !important;
    border-color: #B07A1E !important;
    box-shadow: 0 6px 25px rgba(206, 145, 43, 0.35) !important;
    transform: translateY(-1px) !important;
}

.btn-outline-primary {
    border-color: #CE912B !important;
    color: #CE912B !important;
}

.btn-outline-primary:hover {
    background: #CE912B !important;
    border-color: #CE912B !important;
    color: #FFFFFF !important;
}

/* Secondary stays dark */
.btn-secondary {
    background: linear-gradient(135deg, #1A1A2E 0%, #16213E 100%) !important;
    border-color: #1A1A2E !important;
    border-radius: 8px !important;
}

/* Success — remap to CDP gold for action buttons */
.btn-success {
    background: linear-gradient(135deg, #CE912B 0%, #DCA54A 100%) !important;
    border-color: #CE912B !important;
    color: #FFFFFF !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    box-shadow: 0 4px 15px rgba(206, 145, 43, 0.25) !important;
    transition: all 0.3s ease !important;
}

.btn-success:hover, .btn-success:focus, .btn-success:active {
    background: linear-gradient(135deg, #B07A1E 0%, #CE912B 100%) !important;
    border-color: #B07A1E !important;
    color: #FFFFFF !important;
    box-shadow: 0 6px 25px rgba(206, 145, 43, 0.35) !important;
    transform: translateY(-1px) !important;
}

/* Warning — use dark secondary for edit/action buttons */
.btn-warning {
    background: linear-gradient(135deg, #1A1A2E 0%, #2D2D5E 100%) !important;
    border-color: #1A1A2E !important;
    color: #FFFFFF !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.btn-warning:hover, .btn-warning:focus, .btn-warning:active {
    background: linear-gradient(135deg, #16213E 0%, #1A1A2E 100%) !important;
    border-color: #16213E !important;
    color: #FFFFFF !important;
    transform: translateY(-1px) !important;
}

/* Danger keeps red but with better radius */
.btn-danger, .btn-info {
    border-radius: 8px !important;
    font-weight: 600 !important;
}

/* text-success override to match theme */
.text-success {
    color: #28a745 !important;
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    border: 1px solid rgba(206, 145, 43, 0.08) !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.3s ease !important;
    overflow: hidden !important;
}

.card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.07) !important;
}

.card-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(206, 145, 43, 0.08) !important;
}

/* ============================================================
   TABLES
   ============================================================ */
.table {
    border-radius: 12px !important;
    overflow: hidden !important;
}

.table thead th {
    background: linear-gradient(135deg, #1A1A2E 0%, #16213E 100%) !important;
    color: #FFFFFF !important;
    font-weight: 600 !important;
    font-size: 0.82rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border: none !important;
    padding: 0.9rem 0.75rem !important;
}

.table tbody tr {
    transition: all 0.2s ease !important;
}

.table tbody tr:hover {
    background-color: rgba(206, 145, 43, 0.04) !important;
}

.table tbody td {
    vertical-align: middle !important;
    font-size: 0.85rem !important;
    border-color: rgba(206, 145, 43, 0.08) !important;
    padding: 0.75rem !important;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-control {
    border-radius: 10px !important;
    border: 1.5px solid #E8E3D5 !important;
    padding: 0.6rem 1rem !important;
    transition: all 0.3s ease !important;
}

.form-control:focus {
    border-color: #CE912B !important;
    box-shadow: 0 0 0 3px rgba(206, 145, 43, 0.15) !important;
}

.form-floating > label {
    color: #8B8B8B !important;
}

.form-select {
    border-radius: 10px !important;
    border: 1.5px solid #E8E3D5 !important;
}

.form-select:focus {
    border-color: #CE912B !important;
    box-shadow: 0 0 0 3px rgba(206, 145, 43, 0.15) !important;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge.bg-primary, .bg-primary {
    background: linear-gradient(135deg, #CE912B 0%, #DCA54A 100%) !important;
}

.badge.bg-soft-primary {
    background: rgba(206, 145, 43, 0.12) !important;
    color: #CE912B !important;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.page-item.active .page-link {
    background-color: #CE912B !important;
    border-color: #CE912B !important;
}

.page-link {
    color: #CE912B !important;
    border-radius: 8px !important;
}

.page-link:hover {
    background-color: rgba(206, 145, 43, 0.1) !important;
    color: #B07A1E !important;
}

/* ============================================================
   MODALS
   ============================================================ */
.modal-content {
    border-radius: 16px !important;
    border: none !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

.modal-header {
    border-bottom: 1px solid rgba(206, 145, 43, 0.1) !important;
}

.modal-footer {
    border-top: 1px solid rgba(206, 145, 43, 0.1) !important;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb-item + .breadcrumb-item::before {
    color: #CE912B !important;
}

.breadcrumb-item a {
    color: #CE912B !important;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
    background: #FFFFFF !important;
    border-top: 1px solid rgba(206, 145, 43, 0.08) !important;
}

.footer a {
    color: #CE912B !important;
}

/* ============================================================
   DROPDOWN
   ============================================================ */
.dropdown-menu {
    border-radius: 12px !important;
    border: 1px solid rgba(206, 145, 43, 0.08) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08) !important;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: rgba(206, 145, 43, 0.06) !important;
    color: #CE912B !important;
}

/* ============================================================
   SCROLLBAR (sidebar)
   ============================================================ */
.sidebar .data-scrollbar::-webkit-scrollbar {
    width: 4px !important;
}

.sidebar .data-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(206, 145, 43, 0.3) !important;
    border-radius: 4px !important;
}

/* ============================================================
   LINKS & TEXT
   ============================================================ */
a {
    color: #CE912B !important;
}

a:hover {
    color: #B07A1E !important;
}

.text-primary {
    color: #CE912B !important;
}

/* ============================================================
   AUTH / LOGIN PAGES
   ============================================================ */
.login-content .bg-primary {
    background: #F0EBD8 !important;
}

.login-content h2 {
    color: #2D2D2D !important;
    font-weight: 700 !important;
}

.login-content .btn-primary {
    width: 100% !important;
    padding: 0.7rem !important;
    font-size: 1rem !important;
    border-radius: 50px !important;
}

.login-content .text-underline {
    color: #CE912B !important;
}

.auth-card {
    border: 1px solid rgba(206, 145, 43, 0.08) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05) !important;
    border-radius: 20px !important;
    padding: 1rem !important;
}

/* ============================================================
   Select2 Override
   ============================================================ */
.select2-container--default .select2-selection--single {
    border-radius: 10px !important;
    border: 1.5px solid #E8E3D5 !important;
    height: 42px !important;
}

.select2-container--default .select2-selection--single:focus {
    border-color: #CE912B !important;
}

.select2-container--default .select2-results__option--selected {
    background-color: rgba(206, 145, 43, 0.12) !important;
}

.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: #CE912B !important;
}

/* ============================================================
   SweetAlert2 Override
   ============================================================ */
.swal2-confirm.swal2-styled {
    background: linear-gradient(135deg, #CE912B 0%, #DCA54A 100%) !important;
    border-radius: 50px !important;
    font-family: 'Poppins', sans-serif !important;
    font-weight: 600 !important;
}

.swal2-cancel.swal2-styled {
    border-radius: 50px !important;
    font-family: 'Poppins', sans-serif !important;
}

.swal2-popup {
    border-radius: 20px !important;
    font-family: 'Poppins', sans-serif !important;
}

/* ============================================================
   DASHBOARD CARDS
   ============================================================ */
.iq-banner {
    background: transparent !important;
}

/* Chart area improvements */
.apexcharts-toolbar {
    display: none !important;
}

/* ============================================================
   LOADING / PROGRESS
   ============================================================ */
.progress-bar {
    background: linear-gradient(135deg, #CE912B 0%, #DCA54A 100%) !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1199px) {
    .sidebar {
        z-index: 1050 !important;
    }
}
