/********** Minimalist Charcoal Admin Theme **********/
:root {
    --primary: #0f172a; /* Sleek Slate 900 primary button */
    --primary-hover: #1e293b;
    --light: #f8fafc;
    --dark: #0f172a;
    --border-color: #cbd5e1;
    --card-bg: #ffffff;
    --text-main: #0f172a; /* Slate 900 - Crisp, high contrast text */
    --text-muted: #475569; /* Slate 600 */
    --canvas-bg: #ffffff; /* Pure white canvas background */

    /* Sidebar Specifics (Subtle Charcoal Theme) */
    --sidebar-bg: #0f172a; /* Slate 900 */
    --sidebar-border: #1e293b;
    --sidebar-text: #94a3b8; /* Slate 400 */
    --sidebar-hover-bg: rgba(255, 255, 255, 0.05);
    --sidebar-active-bg: rgba(255, 255, 255, 0.08);
    --sidebar-accent: #f8fafc; /* Sleek silver/white accent */
}

html {
    font-size: 14px;
}

a {
    color: inherit;
    text-decoration: none;
}
/* Minimal Global Scrollbars */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

body {
    margin: 0;
    font-family:
        "Inter",
        system-ui,
        -apple-system,
        sans-serif;
    font-size: 0.8125rem; /* 13px */
    font-weight: 400;
    line-height: 1.4;
    color: var(--text-main);
    background-color: var(--canvas-bg);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

.back-to-top {
    position: fixed;
    display: none;
    right: 30px;
    bottom: 30px;
    z-index: 99;
}

/*** Spinner ***/
#spinner {
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.3s ease-out,
        visibility 0s linear 0.3s;
    z-index: 99999;
}

#spinner.show {
    transition:
        opacity 0.3s ease-out,
        visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}

/*** Buttons ***/
.btn {
    font-size: 0.75rem; /* 12px for compact size */
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 5px;
    transition: all 0.2s ease-in-out;
    box-shadow: none !important;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
    color: #ffffff !important;
}

.btn-secondary {
    background-color: #475569;
    border-color: #475569;
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #334155 !important;
    border-color: #334155 !important;
}

.btn-success {
    background-color: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.btn-success:hover {
    background-color: #059669 !important;
    border-color: #059669 !important;
}

.btn-danger {
    background-color: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #dc2626 !important;
    border-color: #dc2626 !important;
}

.btn-outline-dark {
    border-color: #cbd5e1;
    color: #475569;
}

.btn-outline-dark:hover {
    background-color: #f1f5f9;
    color: #1e293b;
    border-color: #94a3b8;
}

.btn-sm {
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    border-radius: 4px;
}

.btn-square {
    width: 34px;
    height: 34px;
}
.btn-sm-square {
    width: 28px;
    height: 28px;
}
.btn-lg-square {
    width: 44px;
    height: 44px;
}

.btn-square,
.btn-sm-square,
.btn-lg-square {
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
    border-radius: 6px;
}

.bg-light-custom {
    background: #ffffff !important;
    border-bottom: 1px solid #e2e8f0;
}

/*** Layout Structure ***/
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 230px;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
}

.content {
    margin-left: 230px;
    min-height: 100vh;
    background: var(--canvas-bg);
    transition: margin-left 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 992px) {
    .sidebar {
        width: 60px;
    }

    .sidebar:hover {
        width: 230px;
    }

    .sidebar:not(:hover) .navbar .navbar-nav .nav-link span {
        display: none !important;
    }

    .sidebar:not(:hover) .dropdown-toggle::after {
        display: none !important;
    }

    .content {
        margin-left: 60px;
        width: calc(100% - 60px);
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        margin-left: -230px;
        z-index: 1100;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    }

    .sidebar.open {
        margin-left: 0;
    }

    .content {
        width: 100%;
        margin-left: 0;
    }
}

/*** Sidebar Elements ***/
.sidebar .navbar .navbar-nav .nav-link {
    padding: 0.4rem 0.75rem;
    color: var(--sidebar-text);
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    display: flex;
    align-items: center;
    margin-bottom: 3px;
    font-size: 0.78rem;
}

.sidebar .navbar .navbar-nav .nav-link:hover,
.sidebar .navbar .navbar-nav .nav-link.active {
    color: #ffffff;
    background: var(--sidebar-hover-bg);
    border-left-color: var(--sidebar-accent);
}

.sidebar .navbar .navbar-nav .nav-link.active {
    background: var(--sidebar-active-bg);
}

.sidebar .navbar .navbar-nav .nav-link i {
    width: 30px;
    height: 30px;
    min-width: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    border-radius: 6px;
    margin-right: 12px;
    transition: all 0.2s;
    background: transparent;
    color: var(--sidebar-text);
}

.sidebar .navbar .navbar-nav .nav-link:hover i,
.sidebar .navbar .navbar-nav .nav-link.active i {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.sidebar:not(:hover) .sidebar-logo {
    opacity: 0;
    visibility: hidden;
    display: none !important;
}

.sidebar-logo {
    transition: opacity 0.2s;
}

.logo-initial {
    width: 34px;
    height: 34px;
    background: #ffffff;
    color: var(--sidebar-bg);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    transition: 0.2s;
}

.sidebar:hover .logo-initial {
    display: none !important;
}

.sidebar .navbar .dropdown-toggle::after {
    position: absolute;
    top: 15px;
    right: 12px;
    border: none;
    content: "\f107";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 10px;
    transition: transform 0.2s;
    color: var(--sidebar-text);
}

.sidebar:not(:hover) .dropdown-toggle::after {
    opacity: 0;
    visibility: hidden;
}

.sidebar .navbar .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(-180deg);
}

.sidebar .navbar .dropdown-item {
    padding-left: 50px;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    font-size: 0.75rem;
    text-align: left;
    border-radius: 0 4px 4px 0;
    color: var(--sidebar-text);
}

.sidebar .navbar .dropdown-item:hover {
    background-color: var(--sidebar-hover-bg);
    color: #ffffff;
}

.sidebar::-webkit-scrollbar {
    width: 3px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}
.sidebar:hover::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

/*** Navbar (Content Header) ***/
.content .navbar .navbar-nav .nav-link {
    margin-left: 15px;
    padding: 10px 0;
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 500;
}

.content .navbar .navbar-nav .nav-link:hover,
.content .navbar .navbar-nav .nav-link.active {
    color: var(--primary-hover);
}

.content .navbar .sidebar-toggler,
.content .navbar .navbar-nav .nav-link i {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 6px;
    color: var(--text-main);
    transition: all 0.2s;
}

.content .navbar .sidebar-toggler:hover,
.content .navbar .navbar-nav .nav-link i:hover {
    background: #e2e8f0;
    color: var(--primary-hover);
}

.content .navbar .dropdown-toggle::after {
    vertical-align: middle;
    border: none;
    content: "\f107";
    margin-left: 4px;
    font-size: 10px;
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    transition: transform 0.2s;
    color: var(--text-muted);
}

.content .navbar .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(-180deg);
}

@media (max-width: 575.98px) {
    .content .navbar .navbar-nav .nav-link {
        margin-left: 10px;
    }
}

/*** Input Form Styling ***/
input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
textarea,
select,
.form-select,
.form-control {
    border-radius: 4px;
    border: 1px solid #cbd5e1;
    padding: 0.35rem 0.5rem;
    width: 100%;
    font-size: 0.8125rem; /* 13px */
    box-sizing: border-box;
    background-color: #ffffff;
    color: var(--text-main);
    transition: border-color 0.15s ease-in-out;
    box-shadow: none !important; /* ABSOLUTELY NO SHADOW ON BOOTSTRAP INPUTS */
}

input:focus,
textarea:focus,
select:focus,
.form-control:focus,
.form-select:focus {
    border-color: #94a3b8 !important; /* Subtle gray border focus */
    outline: none !important;
    box-shadow: none !important; /* REMOVE SHADOW COMPLETELY */
}

label,
.form-label {
    font-weight: 500;
    font-size: 0.75rem; /* 12px label */
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    display: inline-block;
}

.form-group {
    margin-bottom: 0.75rem;
}

.form-check-label {
    margin-left: 5px;
    font-size: 0.78rem;
    font-weight: 400;
    cursor: pointer;
}

.form-check-input {
    width: 14px;
    height: 14px;
    margin-top: 0.2em;
    cursor: pointer;
    border-radius: 3px;
    border-color: #cbd5e1;
    box-shadow: none !important;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
    box-shadow: none !important;
}

/*** Cards ***/
.card {
    background: #ffffff;
    border: 1px solid #cbd5e1; /* visible clean borders */
    border-radius: 6px;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.05); /* Subtle pop shadow */
}

.card-body {
    padding: 1rem;
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
}

.card-body h2,
.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

/*** Tables ***/
.table-responsive {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.05);
}

table,
.table {
    margin-bottom: 0;
    font-size: 0.75rem; /* 12px dense tables */
    text-align: center;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.35rem 0.5rem !important; /* Compact spacing */
    vertical-align: middle !important;
    border-color: #cbd5e1 !important;
}

.table thead th {
    background-color: #f1f5f9 !important; /* Clean cool background */
    color: #334155 !important; /* Dark slate text */
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #cbd5e1 !important;
}

.table-hover tbody tr:hover {
    background-color: #f8fafc !important;
    transition: background-color 0.1s ease;
}

/*** Modals ***/
.modal-content {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow:
        0 10px 25px -5px rgba(0, 0, 0, 0.1),
        0 8px 10px -6px rgba(0, 0, 0, 0.1);
    background-color: #ffffff;
}

.modal-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
}

.modal-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark);
}

.modal-backdrop.show {
    backdrop-filter: blur(4px);
    background-color: rgba(15, 23, 42, 0.4);
    opacity: 1 !important;
}

/*** Badges ***/
.badge {
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0.25em 0.5em;
    border-radius: 4px;
    display: inline-block;
}

.bg-success {
    background-color: #dcfce7 !important;
    color: #15803d !important;
}

.bg-danger {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
}

.bg-warning {
    background-color: #fef9c3 !important;
    color: #a16207 !important;
}

.bg-primary {
    background-color: #e0e7ff !important;
    color: #3730a3 !important;
}

.bg-secondary {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
}

.badge.bg-dark {
    background-color: #e2e8f0 !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1;
}

/* Custom Checkbox */
.product-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid #cbd5e1;
    border-radius: 3px;
    background-color: #fff;
    cursor: pointer;
    display: inline-block;
    position: relative;
    transition: all 0.15s ease-in-out;
}

.product-checkbox:hover {
    background-color: #f1f5f9;
    border-color: var(--primary);
}

.product-checkbox:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.product-checkbox:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

/* Specific Admin Containers */
#shippingContainer {
    padding: 10px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-top: 10px;
}

.dropzone {
    border: 1.5px dashed #cbd5e1;
    border-radius: 6px;
    background-color: #f8fafc;
    padding: 15px;
    text-align: center;
    transition: all 0.2s;
}

.dropzone:hover {
    border-color: var(--primary);
    background-color: #f1f5f9;
}

.dz-message {
    font-size: 0.78rem;
    color: var(--text-muted);
}

#variations-container {
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

#specsContainer {
    padding: 10px;
    margin-top: 15px;
    background-color: #faf5ff !important;
    border: 1px solid #ebd5ff !important;
    border-radius: 6px;
}

.img_input_preview {
    height: 60px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.profile_icon {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border-radius: 50%;
}

.tdhtml img {
    max-width: 40px;
    border-radius: 3px;
}

.overlay {
    top: 0;
    left: 0;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(2px);
    z-index: 10;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bootstrap Component Custom Overrides */
.form-check-input:checked {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.form-check-input:focus {
    border-color: #cbd5e1 !important;
    box-shadow: none !important;
}

.page-item.active .page-link {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
}

.page-link {
    color: var(--text-main) !important;
    border-color: #cbd5e1 !important;
    padding: 0.3rem 0.6rem !important;
    font-size: 0.75rem;
}

.page-link:hover {
    color: var(--primary-hover) !important;
    background-color: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--primary) !important;
    color: #ffffff !important;
}

.form-floating > .form-control:focus ~ label {
    color: var(--primary) !important;
}

.text-primary {
    color: var(--primary) !important;
}
