/*
Sufanet UI - Custom CSS
Version: 2.0
*/

/* ---- Base Typography ---- */
body {
    font-size: 0.875rem;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }

/* ---- Alert Styles ---- */
.alert-info {
    background-color: #dbeafe;
    border: 1px solid #60a5fa;
    color: #1e40af;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    position: relative;
}

.alert-success {
    background-color: #dcfce7;
    border: 1px solid #4ade80;
    color: #15803d;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    position: relative;
}

.alert-warning {
    background-color: #fef9c3;
    border: 1px solid #facc15;
    color: #a16207;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    position: relative;
}

.alert-danger {
    background-color: #fee2e2;
    border: 1px solid #f87171;
    color: #b91c1c;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    position: relative;
}

/* WHMCS Modal Styling (to override Bootstrap defaults) */
/* Ensure modals are always hidden by default — prevent Tailwind conflicts */
.modal {
    display: none !important;
}
.modal.show {
    display: block !important;
}

/* ---- Sidebar Navigation ---- */
.sidebar-nav-link {
    color: #cbd5e1;
}
.sidebar-nav-link:hover {
    background: rgba(255,255,255,0.07) !important;
    color: #e2e8f0 !important;
}
.sidebar-nav-active {
    background: rgba(59,130,246,0.22) !important;
    color: #93c5fd !important;
}
.sidebar-parent-btn:hover {
    background: rgba(255,255,255,0.07) !important;
    color: #e2e8f0 !important;
}
.sidebar-child-link {
    color: #94a3b8;
}
.sidebar-child-link:hover {
    background: rgba(255,255,255,0.06) !important;
    color: #e2e8f0 !important;
}
.sidebar-child-active {
    background: rgba(59,130,246,0.22) !important;
    color: #93c5fd !important;
    font-weight: 600;
}
.sidebar-logout-btn {
    color: #fca5a5;
}
.sidebar-logout-btn:hover {
    background: rgba(239,68,68,0.15) !important;
    color: #f87171 !important;
}

/* ---- Dropdown Menu Items ---- */
.dropdown-menu-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    color: #374151;
    text-decoration: none !important;
    transition: background 0.12s ease;
    gap: 0.625rem;
}
.dropdown-menu-item:hover {
    background: #f8fafc;
    color: #1d4ed8;
    text-decoration: none !important;
}
.dropdown-menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 0.4rem;
    flex-shrink: 0;
}
.dropdown-logout-item {
    color: #dc2626 !important;
}
.dropdown-logout-item:hover {
    background: #fff1f2 !important;
    color: #b91c1c !important;
}



.modal-content {
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    background-color: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    padding: 1rem 1.5rem;
}

.modal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    background-color: #f9fafb;
    border-top: 1px solid #e5e7eb;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Style for WHMCS tables to make them look modern */
.table-list, .table-data {
    width: 100%;
    background-color: white;
}

.table-list th, .table-data th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: #f9fafb;
}

.table-list td, .table-data td {
    padding: 0.875rem 1rem;
    white-space: nowrap;
    font-size: 0.875rem;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
}

.table-list tr:last-child td, .table-data tr:last-child td {
    border-bottom: 0;
}

.table-list tr:hover, .table-data tr:hover {
    background-color: #f9fafb;
    cursor: pointer;
}

/* Status badges */
.status-badge {
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    display: inline-block;
}

.status-active {
    background-color: #dcfce7;
    color: #166534;
}

.status-pending {
    background-color: #fef9c3;
    color: #854d0e;
}

.status-suspended {
    background-color: #fed7aa;
    color: #9a3412;
}

.status-terminated, .status-cancelled {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-fraud {
    background-color: #fbcfe8;
    color: #831843;
}

.status-paid {
    background-color: #dcfce7;
    color: #166534;
}

.status-unpaid {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-open {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-answered, .status-customer-reply {
    background-color: #e9d5ff;
    color: #6b21a8;
}

.status-closed {
    background-color: #e5e7eb;
    color: #1f2937;
}

/* DataTables Styling */
.dataTables_wrapper {
    padding: 0.75rem 1rem;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* The 'listtable' dom element: filter + info + table — make it scrollable */
.dataTables_wrapper .listtable {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f3f4f6;
}

.dataTables_wrapper .listtable::-webkit-scrollbar {
    height: 5px;
}
.dataTables_wrapper .listtable::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 9999px;
}
.dataTables_wrapper .listtable::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 9999px;
}
.dataTables_wrapper .listtable::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Search filter */
.dataTables_filter label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.dataTables_filter input {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    height: 32px;
    outline: none;
    transition: border-color 0.15s;
}

.dataTables_filter input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* Bottom bar: pagination + length on same row */
.dataTables_wrapper .dataTables_paginate,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info {
    padding-top: 0.5rem;
    padding-bottom: 0.25rem;
}

/* Row wrapper that holds p and l outside .listtable — make it flex */
.dataTables_wrapper > .dataTables_paginate {
    float: none !important;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: center;
    align-items: center;
}

.dataTables_wrapper > .dataTables_length {
    float: none !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Length label — fix vertical clipping */
.dataTables_length label {
    display: flex !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 0;
    line-height: 1.5;
}

.dataTables_length select {
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.1875rem 0.5rem;
    font-size: 0.8125rem;
    height: 28px;
    line-height: 1.4;
    cursor: pointer;
    vertical-align: middle;
}

/* Info text */
.dataTables_info {
    color: #9ca3af;
    font-size: 0.8125rem;
    text-align: center;
}

/* ---- Pagination: Bootstrap 4 DataTables integration ---- */
/* Targets <ul class="pagination"> generated by dataTables.bootstrap4.js */
.dataTables_wrapper .pagination {
    flex-wrap: wrap;
    gap: 2px;
    margin-bottom: 0;
    justify-content: center;
}

.dataTables_wrapper .pagination .page-item .page-link {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.8125rem !important;
    line-height: 1.5 !important;
    min-width: 1.875rem;
    text-align: center;
    border-color: #e5e7eb !important;
    color: #374151 !important;
    background-color: #ffffff !important;
    border-radius: 0.375rem !important;
    margin: 0 1px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.dataTables_wrapper .pagination .page-item .page-link:hover {
    background-color: #f9fafb !important;
    border-color: #d1d5db !important;
    color: #111827 !important;
}

.dataTables_wrapper .pagination .page-item.active .page-link {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #ffffff !important;
    font-weight: 500 !important;
    box-shadow: none !important;
}

.dataTables_wrapper .pagination .page-item.disabled .page-link {
    opacity: 0.45 !important;
    background-color: #f9fafb !important;
    border-color: #f3f4f6 !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
}

/* ---- Pagination: Standard DataTables (non-Bootstrap) fallback ---- */
.paginate_button {
    display: inline-block;
    min-width: 1.875rem;
    padding: 0.25rem 0.5rem;
    margin: 0 1px;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background: #ffffff;
    color: #374151 !important;
    font-size: 0.8125rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    user-select: none;
}

.paginate_button:hover:not(.disabled):not(.current) {
    background-color: #f9fafb;
    border-color: #d1d5db;
    color: #111827 !important;
}

.paginate_button.current,
.paginate_button.current:hover {
    background-color: #2563eb;
    color: #ffffff !important;
    border-color: #2563eb;
    font-weight: 500;
}

.paginate_button.disabled,
.paginate_button.disabled:hover {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f9fafb;
    border-color: #f3f4f6;
    color: #9ca3af !important;
}

/* Mobile Menu Fixes */
@media (max-width: 768px) {
    /* Ensure Alpine.js works properly */
    [x-cloak] {
        display: none !important;
    }
    
    /* Ensure mobile sidebar is above everything */
    .md\\:hidden.fixed.inset-0 {
        z-index: 9999 !important;
    }
}

/* Burger Menu Button */
button[class*="toggle-sidebar"] {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Fix FontAwesome Icons in Mobile */
.far, .fas, .fab, .fal, .fad {
    -webkit-font-smoothing: antialiased;
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* Ensure icon buttons are clickable on mobile */
.btn-view-details, button, a {
    touch-action: manipulation;
    cursor: pointer;
}

/* Remove underlines from links globally */
a {
    text-decoration: none !important;
}

a:hover {
    text-decoration: none !important;
}

a:focus, a:active, a:visited {
    text-decoration: none !important;
}

.no-underline {
    text-decoration: none !important;
}

/* Override Bootstrap link styles */
.card a, .panel a, .list-group-item a, 
.table a, .dropdown-item, .nav-link,
.breadcrumb a, .alert a, .btn-link {
    text-decoration: none !important;
}

/* Panel & card spacing */
.panel-body, .card-body {
    padding: 1.25rem !important;
}

/* Panel heading */
.panel-heading {
    padding: 0.75rem 1.25rem !important;
}

/* Form controls — consistent, touch-friendly sizing */
.form-control {
    height: auto !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.9375rem !important;
    line-height: 1.5 !important;
    border-radius: 0.5rem !important;
    border: 1px solid #d1d5db !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
}
.form-control:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12) !important;
    outline: none !important;
}
select.form-control {
    padding-right: 2rem !important;
}

/* Form groups — proper vertical spacing between fields */
.form-group {
    margin-bottom: 1.1rem !important;
}

/* Labels — clear and readable */
.form-group > label,
.control-label {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 0.35rem !important;
    display: block;
}

/* Prevent double scrollbar - critical fix */
html {
    overflow-x: hidden;
    overflow-y: auto;
    /* Thin styled scrollbar for webkit */
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f9fafb;
}

html::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
html::-webkit-scrollbar-track {
    background: #f9fafb;
}
html::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 9999px;
}
html::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

body {
    overflow-x: hidden;
    overflow-y: visible;
    min-height: 100vh;
    width: 100%;
}

/* Ensure main containers don't create extra scrollbars */
.flex-1 {
    overflow: visible;
}

main {
    overflow: visible;
}

/* Table container: clip overflowing DataTables wrapper */
.table-container {
    max-width: 100%;
    overflow: hidden;
}

/* Additional Mobile Responsive Improvements */
@media (max-width: 640px) {
    /* Stats cards on dashboard - full width column on very small screens */
    .grid-cols-1 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    /* Topbar: hide user name text, keep avatar */
    .topbar-username {
        display: none;
    }
    
    /* Reduce heading sizes on small screens */
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    h3 { font-size: 1.125rem; }
}

/* Ensure sidebar is properly scrollable on mobile */
#mobileSidebarPanel {
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 100vh;
}

/* Fix for status badge in invoice page */
.status-badge-lg {
    display: inline-block;
    padding: 0.375rem 1rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 9999px;
}

/* Ensure nav tabs on mobile are scrollable */
@media (max-width: 768px) {
    /* Fix nav tabs on mobile - make them scrollable */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 1px;
    }
    
    .nav-tabs .nav-item {
        flex-shrink: 0;
    }
    
    /* Invoice table - ensure it scrolls on mobile */
    .invoice-container .overflow-x-auto {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}

/* Fix mobile responsive for product details */
@media (max-width: 768px) {
    .product-details .row {
        display: flex;
        flex-direction: column;
    }
    
    .product-details .col-md-6,
    .product-details .col-md-4,
    .product-details .col-md-8,
    .product-details .col-sm-6,
    .product-details .col-sm-4,
    .product-details .col-sm-8 {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0.5rem !important;
        flex: 0 0 100% !important;
    }
    
    .product-actions-wrapper .col-12 {
        width: 100% !important;
        padding: 0.25rem !important;
    }
    
    .product-status {
        margin-bottom: 1rem;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 100%;
        font-size: 0.8125rem;
    }
    
    table td, table th {
        padding: 0.5rem 0.75rem !important;
    }
    
    /* Only make dedicated block buttons full-width, not all buttons */
    .btn-block {
        width: 100%;
        display: block;
        margin-bottom: 0.5rem;
    }

    .btn {
        font-size: 0.8125rem;
    }
    
    /* Fix container padding on mobile */
    .container, .container-fluid {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    /* Reduce grid gaps slightly on mobile */
    .grid {
        gap: 0.75rem !important;
    }
    
    /* Reduce margins globally on mobile */
    .mt-8, .mt-6 {
        margin-top: 1rem !important;
    }
    
    .mb-6 {
        margin-bottom: 0.75rem !important;
    }
    
    /* Card responsive - only padding, NOT overflow-x hidden (breaks scrollable tables) */
    .card-body {
        padding: 1rem !important;
    }
    
    /* Panel body on mobile */
    .panel-body {
        padding: 1rem !important;
    }
    
    /* Form controls on mobile — bigger touch targets */
    .form-control {
        padding: 0.625rem 0.75rem !important;
        font-size: 1rem !important;
    }
    
    /* Critical: Ensure no double scrollbar on mobile */
    html, body {
        overflow-x: hidden !important;
        width: 100%;
        position: relative;
    }
    
    body {
        overflow-y: auto !important;
    }
}

/* ---- WHMCS "Powered by" branding — subtle & spaced ---- */
.whmcs-powered-by {
    text-align: center;
    padding: 0.25rem 1rem 0.5rem;
    background: transparent !important;
}

.whmcs-powered-by,
.whmcs-powered-by p,
.whmcs-powered-by div,
.whmcs-powered-by span,
.whmcs-powered-by small {
    font-size: 0.65rem !important;
    color: #d1d5db !important;
    opacity: 0.6;
    letter-spacing: 0.03em;
    margin: 0 !important;
    line-height: 1.6;
    background: transparent !important;
}

.whmcs-powered-by a {
    font-size: 0.65rem !important;
    color: #d1d5db !important;
    text-decoration: none !important;
    background: transparent !important;
}

/* ---- Visual Polish & Depth ---- */

/* Cards: softer shadow and subtle hover lift */
.card {
    border: 1px solid rgba(0,0,0,0.06) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 0 0 1px rgba(255,255,255,0.8) inset !important;
    border-radius: 0.75rem !important;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10) !important;
    transform: translateY(-1px);
}

/* Stat/summary cards on dashboard */
.stat-card, [class*='bg-white'][class*='rounded'] {
    background: #ffffff;
}

/* Sidebar scrollbar — thin, dark-themed */
#sidebar::-webkit-scrollbar,
#mobileSidebarPanel::-webkit-scrollbar {
    width: 3px;
}
#sidebar::-webkit-scrollbar-track,
#mobileSidebarPanel::-webkit-scrollbar-track {
    background: transparent;
}
#sidebar::-webkit-scrollbar-thumb,
#mobileSidebarPanel::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
}

/* Page background */
body {
    background-color: #f8fafc;
}

/* Breadcrumb separator improvement */
nav[aria-label="breadcrumb"] ol li a {
    color: #6b7280;
    transition: color 0.15s;
}
nav[aria-label="breadcrumb"] ol li a:hover {
    color: #2563eb;
}

/* Panels & info boxes — lift out of flat background */
.panel, .panel-default {
    border: none !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07) !important;
    border-radius: 0.75rem !important;
}
.panel-heading {
    border-radius: 0.75rem 0.75rem 0 0 !important;
    font-weight: 600;
    font-size: 0.875rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9) !important;
    border-bottom: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
}

/* Buttons: more rounded and modern */
.btn-primary {
    background: linear-gradient(135deg, #2563eb, #4f46e5) !important;
    border: none !important;
    border-radius: 0.5rem !important;
    font-weight: 500;
    transition: opacity 0.15s, transform 0.1s !important;
}
.btn-primary:hover {
    opacity: 0.92 !important;
    transform: translateY(-1px) !important;
}
.btn-default, .btn-secondary {
    border-radius: 0.5rem !important;
    font-weight: 500;
}

/* Tables — subtler header */
.table > thead > tr > th {
    background: #f8fafc !important;
    border-bottom: 2px solid #e2e8f0 !important;
    color: #475569;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- Dashboard Home Panels: Service & Ticket items ---- */

/* Fix rounded corners on panel card header/footer when overflow:visible */
.bg-white.rounded-xl > .px-4.py-3.border-b:first-child {
    border-radius: 0.75rem 0.75rem 0 0;
}
.bg-white.rounded-xl > div:last-child > a:last-child,
.bg-white.rounded-xl > div:last-child > .div-service-item:last-child {
    border-radius: 0 0 0.75rem 0.75rem;
}

/* Dropdown inside service item: natural direction (overflow:visible on card handles clipping) */

/* Service item: flex row, name left / status+button right */

/* Remove Bootstrap list-group-item padding when it wraps a service item */
.list-group-item:has(.div-service-item) {
    padding: 0 !important;
    border-left: none !important;
    border-right: none !important;
}

.div-service-item {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0.5rem;
}
.div-service-name {
    flex: 1;
    min-width: 0;
}
.div-service-name .font-weight-bold {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.div-service-name .text-domain {
    display: block;
    font-size: 0.75rem;
    color: #94a3b8;
}
.div-service-status {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}
.div-service-status .label {
    font-size: 0.7rem !important;
    padding: 0.25em 0.6em !important;
    border-radius: 5px !important;
    white-space: nowrap;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
}
/* Hide placeholder label (empty status) */
.div-service-status .label-placeholder {
    display: none;
}
.div-service-buttons {
    flex-shrink: 0;
}
.div-service-buttons .btn-view-details {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    white-space: nowrap;
    background-color: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    text-decoration: none !important;
    transition: background 0.15s, border-color 0.15s;
}
.div-service-buttons .btn-view-details:hover {
    background-color: #dbeafe;
    border-color: #93c5fd;
    color: #1d4ed8;
}
/* Show icon, hide sr-only text */
.div-service-buttons .btn-view-details .fa-info-circle {
    display: inline-block !important;
    font-size: 0.8rem;
}
.div-service-buttons .btn-view-details .sr-only {
    display: none;
}

/* Ticket items: absolutely position status badge on far right.
   getLabel() outputs: text <label style="...">Status</label><br><small>date</small>
   Label is a DIRECT child of .home-panel-item (service labels are nested deeper,
   so .home-panel-item > label only matches ticket badges). */
.home-panel-item:has(> label) {
    position: relative !important;
    padding-right: 5.5rem !important;
}
.home-panel-item > label {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.68rem !important;
    padding: 0.2em 0.6em !important;
    border-radius: 4px;
    line-height: 1.5;
    white-space: nowrap;
}
/* <br> is suppressed; show date as a smaller subtitle line */
.home-panel-item > br {
    display: none;
}
.home-panel-item > small {
    font-size: 0.68rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 100%;
}

/* ---- Product Details: Icon & Title ---- */
div.product-details div.product-icon {
    font-size: 32px !important;
    padding: 20px 30px !important;
    line-height: 1.2 !important;
}

div.product-details div.product-icon .fa-stack {
    display: block !important;
    margin: 0 auto 10px auto !important;
    font-size: inherit !important;
    line-height: 2em !important;
    width: 2em !important;
    height: 2em !important;
}

div.product-details div.product-icon .fa-stack .fa-circle {
    font-size: 2em !important;
}

div.product-details div.product-icon .fa-stack .fa-stack-1x {
    font-size: 1em !important;
    line-height: 2em !important;
}

div.product-details div.product-icon h3 {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    margin-top: 0.5rem !important;
    margin-bottom: 0.15rem !important;
    line-height: 1.3 !important;
}

div.product-details div.product-icon h4 {
    font-size: 0.875rem !important;
    font-weight: 400 !important;
    color: #6b7280 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    line-height: 1.4 !important;
}

/* ============================================================
   Global Fix: .prepend-icon - icon overlapping text in ALL forms
   (registration, checkout, cart, etc.)
   ============================================================ */

.prepend-icon {
    position: relative !important;
    display: block !important;
    width: 100% !important;
}

.prepend-icon .field-icon {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 4 !important;
    width: 2.5rem !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: none !important;
    color: #9ca3af !important;
}

.prepend-icon .field-icon i {
    font-size: 0.8125rem !important;
    color: #9ca3af !important;
}

/* Fix padding-left for ALL inputs/selects with icon — override Bootstrap */
.prepend-icon .field,
.prepend-icon .form-control,
.prepend-icon input,
.prepend-icon select {
    padding-left: 2.5rem !important;
}

/* ============================================================
   Product Details: Usage Statistics (Disk & Bandwidth)
   Fix knob/dial gauge + module overview output
   ============================================================ */

/* Knob canvas centering */
.dial-usage,
canvas.knob {
    display: block !important;
    margin: 0 auto 4px auto !important;
}

/* Module-rendered usage stats overrides */
.stats-wrapper,
.usage-stats,
[id="resourceusage"] {
    padding: 0.5rem 0 !important;
}

/* Fix text overlapping inside knob area */
.dial-usage + p,
.dial-usage ~ p {
    text-align: center !important;
    font-size: 0.8125rem !important;
    color: #6b7280 !important;
    margin-top: 4px !important;
    line-height: 1.4 !important;
    word-break: break-word !important;
}

/* Fix module-rendered overview: Usage Statistics card */
.product-details .row [class*="col"] canvas {
    display: block !important;
    margin: 0 auto !important;
}

/* Prevent knob value text from overflowing outside the canvas */
canvas.knob {
    max-width: 100% !important;
    height: auto !important;
}

/* ============================================================
   Registration Form - Fix icon overlapping text + UI cleanup
   ============================================================ */

/* Card styling */
#registration .card {
    border: 1px solid #e5e7eb !important;
    border-radius: 0.75rem !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important;
}

#registration .card-title {
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 1.25rem !important;
    padding-bottom: 0.75rem !important;
    border-bottom: 1px solid #f3f4f6 !important;
}

/* Ensure prepend-icon wrapper is positioned correctly */
#registration .prepend-icon {
    position: relative !important;
    width: 100% !important;
}

/* Fix: ensure icon is absolutely positioned inside the input */
#registration .prepend-icon .field-icon {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 4 !important;
    width: 2.5rem !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    pointer-events: none !important;
    color: #9ca3af !important;
}

#registration .prepend-icon .field-icon i {
    font-size: 0.8125rem !important;
    color: #9ca3af !important;
}

/* Fix: add left padding so text does NOT overlap icon — override Bootstrap .form-control */
#registration .prepend-icon .field,
#registration .prepend-icon .form-control {
    padding-left: 2.5rem !important;
    height: 2.625rem !important;
    border-radius: 0.5rem !important;
    border: 1px solid #d1d5db !important;
    font-size: 0.875rem !important;
    color: #111827 !important;
    background-color: #fff !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
    box-shadow: none !important;
}

#registration .prepend-icon select.field,
#registration .prepend-icon select.form-control {
    padding-left: 2.5rem !important;
    height: 2.625rem !important;
    border-radius: 0.5rem !important;
    border: 1px solid #d1d5db !important;
    font-size: 0.875rem !important;
    color: #111827 !important;
    background-color: #fff !important;
    cursor: pointer !important;
}

#registration .prepend-icon .field:focus,
#registration .prepend-icon .form-control:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12) !important;
    outline: none !important;
}

/* Non-icon inputs */
#registration .form-group:not(.prepend-icon) .form-control,
#registration .form-group:not(.prepend-icon) .field {
    height: 2.625rem !important;
    border-radius: 0.5rem !important;
    border: 1px solid #d1d5db !important;
    font-size: 0.875rem !important;
    color: #111827 !important;
    padding: 0.5rem 0.875rem !important;
    box-shadow: none !important;
    transition: border-color 0.15s, box-shadow 0.15s !important;
}

#registration .form-group:not(.prepend-icon) .form-control:focus,
#registration .form-group:not(.prepend-icon) .field:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.12) !important;
    outline: none !important;
}

/* Form group spacing */
#registration .form-group {
    margin-bottom: 1rem !important;
}

/* Submit button */
#registration .btn-primary {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    border-radius: 0.5rem !important;
    padding: 0.625rem 2.5rem !important;
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
    transition: background-color 0.15s !important;
}

#registration .btn-primary:hover {
    background-color: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
}

/* Section heading: "required fields are marked with *" */
#registration .card-title small {
    font-size: 0.75rem !important;
    font-weight: 400 !important;
    color: #6b7280 !important;
}

/* Password strength bar */
#registration .password-strength-meter .progress {
    height: 6px !important;
    border-radius: 9999px !important;
    background-color: #e5e7eb !important;
}
