/* ═══════════════════════════════════════════════════
   Backlink Manager — HRIS-Style Dashboard CSS
   ═══════════════════════════════════════════════════ */

/* ─── CSS Variables ─── */
:root {
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-900: #1e3a8a;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --red-50: #fef2f2;
    --red-100: #fee2e2;
    --red-500: #ef4444;
    --red-600: #dc2626;
    --green-50: #f0fdf4;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --yellow-50: #fefce8;
    --yellow-500: #eab308;
    --yellow-600: #ca8a04;
    --border: #DCDEDD;
    --sidebar-width: 256px;
    --header-height: 72px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 8px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

/* ─── Reset & Base ─── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font);
    color: var(--gray-800);
    background: var(--gray-100);
    line-height: 1.5;
}

/* ─── Utilities ─── */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.flex-05 {
    flex: 0.5;
}

.flex-1 {
    flex: 1;
}

.flex-2 {
    flex: 2;
}

/* ═══════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════ */
.login-body {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 50%, #f5f3ff 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 1rem;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-circle-outer {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
    border-radius: 50%;
}

.logo-circle-inner {
    position: absolute;
    width: 75%;
    height: 75%;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    border-radius: 50%;
    opacity: 0.9;
}

.logo-text {
    position: relative;
    z-index: 1;
    color: white;
    font-weight: 800;
    font-size: 1.25rem;
    letter-spacing: -0.025em;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.login-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 2rem;
}

.login-error {
    background: var(--red-50);
    color: var(--red-600);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-xs);
    font-size: 0.875rem;
    margin-bottom: 1rem;
    border: 1px solid var(--red-100);
}

/* ═══════════════════════════════════════════════════
   DASHBOARD LAYOUT
   ═══════════════════════════════════════════════════ */
.dashboard-layout {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ─── */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 50;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sidebar .sidebar-logo {
    width: 48px;
    height: 48px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar .logo-circle-outer {
    width: 48px;
    height: 48px;
}

.sidebar .logo-circle-inner {
    width: 36px;
    height: 36px;
}

.sidebar .logo-text {
    font-size: 0.875rem;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    line-height: 1.2;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.mobile-close-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mobile-close-btn:hover {
    border-color: var(--primary-500);
    border-width: 2px;
}

/* ─── Sidebar Nav ─── */
.sidebar-nav {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    text-decoration: none;
    color: var(--gray-700);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background: var(--gray-50);
    border-color: var(--gray-200);
}

.nav-link svg {
    color: var(--gray-500);
    flex-shrink: 0;
}

.nav-link-active {
    background: var(--primary-50) !important;
    border-color: var(--primary-200) !important;
    color: var(--primary-700) !important;
    font-weight: 600;
}

.nav-link-active svg {
    color: var(--primary-500) !important;
}

/* ─── Sidebar Bottom ─── */
.sidebar-bottom {
    padding: 1rem;
    margin-top: auto;
}

.upgrade-card {
    background: linear-gradient(135deg, var(--primary-50), var(--primary-100));
    border: 1px solid var(--primary-200);
    border-radius: 16px;
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.upgrade-card-bg {
    position: absolute;
    inset: 0;
    opacity: 0.05;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    background: var(--primary-500);
}

.bg-c1 {
    width: 32px;
    height: 32px;
    top: 8px;
    right: 16px;
}

.bg-c2 {
    width: 24px;
    height: 24px;
    bottom: 16px;
    left: 8px;
}

.upgrade-card-content {
    position: relative;
    z-index: 1;
}

.upgrade-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.upgrade-card h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 2px;
}

.upgrade-card p {
    font-size: 0.8rem;
    color: var(--gray-600);
}

/* ─── Sidebar Overlay ─── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 40;
}

/* ═══════════════════════════════════════════════════
   MAIN CONTENT AREA
   ═══════════════════════════════════════════════════ */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ─── Header ─── */
.top-header {
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 30;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mobile-menu-btn:hover {
    border-color: var(--primary-500);
    border-width: 2px;
}

.page-title {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--gray-900);
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 2px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--gray-600);
}

.header-icon-btn:hover {
    border-color: var(--primary-500);
    border-width: 2px;
}

.header-divider {
    width: 1px;
    height: 32px;
    background: var(--border);
    margin: 0 0.5rem;
}

/* ─── User Profile ─── */
.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.user-profile:hover {
    background: var(--gray-50);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}

.user-info {
    text-align: left;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
}

.user-role {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.user-chevron {
    color: var(--gray-400);
    transition: transform 0.2s;
}

/* ─── User Dropdown ─── */
.user-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    width: 220px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    z-index: 999;
    overflow: hidden;
}

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

.dropdown-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
}

.dropdown-user-email {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.dropdown-divider {
    height: 1px;
    background: var(--border);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.625rem 1rem;
    border: none;
    background: none;
    font-size: 0.875rem;
    color: var(--gray-700);
    cursor: pointer;
    transition: background 0.2s;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--gray-50);
}

.dropdown-item-danger {
    color: var(--red-600);
}

.dropdown-item-danger:hover {
    background: var(--red-50);
}

/* ─── Content ─── */
.content-area {
    flex: 1;
    padding: 1.5rem;
    background: var(--gray-100);
    min-height: calc(100vh - var(--header-height));
    min-width: 0;
    overflow-x: hidden;
}

/* ═══════════════════════════════════════════════════
   COMPONENTS
   ═══════════════════════════════════════════════════ */

/* ─── Cards ─── */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.table-card {
    padding: 0;
    overflow: hidden;
}

/* ─── Forms ─── */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

input[type="text"],
input[type="number"],
input[type="url"],
input[type="password"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    font-family: var(--font);
    font-size: 0.875rem;
    color: var(--gray-800);
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input::placeholder {
    color: var(--gray-400);
}

/* ─── Password Wrapper ─── */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    padding: 4px;
    display: flex;
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-xs);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border: 1px solid var(--primary-700);
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    filter: brightness(1.08);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-outline {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.btn-outline:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

.btn-danger {
    background: var(--red-500);
    color: white;
    border: 1px solid var(--red-600);
}

.btn-danger:hover {
    background: var(--red-600);
}

.btn-danger-outline {
    background: white;
    color: var(--red-600);
    border: 1px solid var(--red-500);
}

.btn-danger-outline:hover {
    background: var(--red-50);
}

.btn-success {
    background: var(--green-500);
    color: white;
    border: 1px solid var(--green-600);
}

.btn-success:hover {
    background: var(--green-600);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-group {
    display: flex;
    gap: 8px;
}

/* ─── Search ─── */
.search-card {
    margin-bottom: 1rem;
}

.search-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: var(--gray-50);
}

.search-input-lg {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 12px 0 !important;
    font-size: 0.9375rem;
    box-shadow: none !important;
}

.search-input-lg:focus {
    box-shadow: none !important;
}

.search-bar-simple {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    margin-bottom: 1rem;
}

.search-bar-simple input {
    border: none !important;
    background: transparent !important;
    padding: 6px 0 !important;
    box-shadow: none !important;
}

/* ─── Filters ─── */
.filters-bar {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    background: white;
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.filter-group {
    min-width: 140px;
}

.filter-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    font-size: 0.8125rem;
}

.filter-actions {
    margin-left: auto;
}

.results-count {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-500);
    padding: 10px 0;
}

/* ─── Tables ─── */
.table-container {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.8125rem;
}

th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-500);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: sticky;
    top: 0;
    z-index: 5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

tr:hover td {
    background: var(--gray-50);
}

td {
    color: var(--gray-700);
}

/* ─── Action Buttons in Tables ─── */
.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-500);
    transition: all 0.2s;
    margin-right: 4px;
}

.action-btn:hover {
    border-color: var(--primary-500);
    color: var(--primary-500);
}

.action-btn-danger:hover {
    border-color: var(--red-500);
    color: var(--red-500);
}

/* ─── Inline Form ─── */
.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-row .form-group {
    margin-bottom: 0;
}

.form-actions-inline {
    display: flex;
    align-items: flex-end;
}

/* ─── Website Cards ─── */
.website-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.website-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.website-card:hover {
    border-color: var(--primary-200);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.website-card-header {
    margin-bottom: 0.75rem;
}

.website-card-domain {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--primary-700);
    word-break: break-all;
}

.website-card-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 0.75rem;
}

.metric-item {
    text-align: center;
    padding: 8px 4px;
    background: var(--gray-50);
    border-radius: 8px;
}

.metric-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
}

.metric-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
}

.website-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
}

.niche-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary-50);
    color: var(--primary-700);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.niche-badge.tech {
    background: #eff6ff;
    color: #1d4ed8;
}

.niche-badge.health {
    background: #f0fdf4;
    color: #15803d;
}

.niche-badge.finance {
    background: #fef3c7;
    color: #92400e;
}

.niche-badge.edu {
    background: #fce7f3;
    color: #9d174d;
}

.taken-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--red-50);
    color: var(--red-600);
}

/* ─── Status Badges ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active {
    background: var(--green-50);
    color: var(--green-600);
}

.badge-lost {
    background: var(--red-50);
    color: var(--red-600);
}

.badge-queue {
    background: var(--yellow-50);
    color: var(--yellow-600);
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.badge-active .badge-dot {
    background: var(--green-500);
}

.badge-lost .badge-dot {
    background: var(--red-500);
}

.badge-queue .badge-dot {
    background: var(--yellow-500);
}

/* ═══════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
}

.modal-card {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    animation: modalIn 0.25s ease-out;
    z-index: 1;
}

.modal-accent-line {
    height: 4px;
    border-radius: 16px 16px 0 0;
}

.accent-blue {
    background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
}

.accent-red {
    background: linear-gradient(90deg, #f87171, var(--red-500), var(--red-600));
}

.modal-body {
    padding: 1.5rem;
    text-align: center;
}

.modal-body h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.modal-body>p {
    font-size: 0.875rem;
    color: var(--gray-500);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.modal-body form {
    text-align: left;
}

.modal-domain {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--primary-600);
    background: var(--primary-50);
    padding: 8px 16px;
    border-radius: var(--radius-xs);
    margin-bottom: 1.25rem;
    display: inline-block;
}

.modal-icon-wrapper {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.icon-red {
    background: var(--red-50);
    border: 4px solid var(--red-100);
    color: var(--red-500);
}

.modal-user-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border: 1px solid var(--gray-100);
    margin-bottom: 1.5rem;
    text-align: left;
}

.user-avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}

.modal-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
}

.modal-user-email {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.modal-actions .btn {
    flex: 1;
    justify-content: center;
    height: 44px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ═══════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    background: var(--gray-900);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-xs);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease-out;
}

.toast.toast-success {
    background: var(--green-600);
}

.toast.toast-error {
    background: var(--red-600);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════
   LOADING STATE
   ═══════════════════════════════════════════════════ */
.loading-state {
    text-align: center;
    padding: 3rem;
    color: var(--gray-400);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary-500);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════════════════════════
   DASHBOARD STATS
   ═══════════════════════════════════════════════════ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card-link {
    position: relative;
    cursor: pointer;
}

.stat-card-link:hover {
    border-color: var(--primary-200);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.12);
}

.stat-card-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: var(--gray-300);
    transition: all 0.2s;
    opacity: 0;
}

.stat-card-link:hover .stat-card-arrow {
    opacity: 1;
    color: var(--primary-500);
    right: 10px;
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-blue {
    background: var(--primary-50);
    color: var(--primary-600);
}

.icon-green {
    background: var(--green-50);
    color: var(--green-600);
}

.icon-purple {
    background: #f5f3ff;
    color: #7c3aed;
}

.icon-orange {
    background: #fff7ed;
    color: #ea580c;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
}

.stat-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ─── Charts ─── */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.chart-card {
    padding: 1.25rem;
    overflow: hidden;
}

.chart-card canvas {
    max-height: 280px;
    width: 100% !important;
}

.chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.chart-header h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--gray-900);
}

.chart-badge {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-600);
    background: var(--primary-50);
    padding: 4px 10px;
    border-radius: 20px;
}

/* ─── Mini Stats Row ─── */
.stats-mini-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.stat-mini {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
    flex: 1;
    min-width: 160px;
}

.stat-mini-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-left: auto;
}

/* ─── Table Card ─── */
.table-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.table-card-header h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* ═══════════════════════════════════════════════════
   GLOBAL SEARCH
   ═══════════════════════════════════════════════════ */
.global-search {
    position: relative;
    margin-right: 0.5rem;
}

.global-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--gray-50);
    border: 1px solid var(--border);
    border-radius: 20px;
    min-width: 240px;
    transition: all 0.2s;
}

.global-search-input-wrap:focus-within {
    border-color: var(--primary-500);
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.global-search-input-wrap svg {
    color: var(--gray-400);
    flex-shrink: 0;
}

.global-search-input-wrap input {
    border: none !important;
    background: transparent !important;
    padding: 4px 0 !important;
    font-size: 0.8125rem;
    box-shadow: none !important;
    width: 100%;
}

.global-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 999;
    max-height: 400px;
    overflow-y: auto;
}

.search-result-group {
    padding: 0.5rem 0;
}

.search-result-group:not(:last-child) {
    border-bottom: 1px solid var(--gray-100);
}

.search-result-label {
    padding: 6px 16px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.15s;
}

.search-result-item:hover {
    background: var(--gray-50);
}

.search-result-item strong {
    font-size: 0.8125rem;
    color: var(--gray-900);
}

.search-result-item span {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.search-no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--gray-400);
    font-size: 0.8125rem;
}

/* ═══════════════════════════════════════════════════
   NOTIFICATIONS
   ═══════════════════════════════════════════════════ */
.notification-wrapper {
    position: relative;
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--red-500);
    color: white;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.notif-panel {
    position: absolute;
    top: 100%;
    right: -60px;
    margin-top: 12px;
    width: 340px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 999;
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.notif-panel-header h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--gray-900);
}

.notif-mark-all {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--primary-600);
    cursor: pointer;
    font-weight: 600;
}

.notif-mark-all:hover {
    text-decoration: underline;
}

.notif-list {
    max-height: 320px;
    overflow-y: auto;
}

.notif-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-50);
    cursor: pointer;
    transition: background 0.15s;
}

.notif-item:hover {
    background: var(--gray-50);
}

.notif-item.unread {
    background: var(--primary-50);
}

.notif-item.unread:hover {
    background: var(--primary-100);
}

.notif-icon-sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.notif-icon-new {
    background: var(--green-50);
    color: var(--green-600);
}

.notif-icon-lost {
    background: var(--red-50);
    color: var(--red-600);
}

.notif-icon-general {
    background: var(--primary-50);
    color: var(--primary-600);
}

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-900);
}

.notif-msg {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notif-time {
    font-size: 0.6875rem;
    color: var(--gray-400);
    margin-top: 4px;
}

.notif-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--gray-400);
    font-size: 0.8125rem;
}

/* ═══════════════════════════════════════════════════
   WARRANTY BADGES
   ═══════════════════════════════════════════════════ */
.badge-warranty {
    background: #dbeafe;
    color: var(--primary-700);
}

.badge-warranty .badge-dot {
    background: var(--primary-500);
}

.badge-warranty-expired {
    background: var(--gray-100);
    color: var(--gray-500);
}

.badge-warranty-expired .badge-dot {
    background: var(--gray-400);
}

.warranty-days {
    font-size: 0.6875rem;
    font-weight: 500;
    opacity: 0.8;
}

/* ═══════════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════════ */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    background: white;
    border-radius: 0 0 var(--radius) var(--radius);
}

.pagination-info {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--gray-700);
    transition: all 0.15s;
}

.page-btn:hover {
    border-color: var(--primary-500);
    color: var(--primary-500);
}

.page-btn.active {
    background: var(--primary-500);
    color: white;
    border-color: var(--primary-500);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ═══════════════════════════════════════════════════
   CSV IMPORT MODAL
   ═══════════════════════════════════════════════════ */
.import-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-sm);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
    margin-bottom: 1rem;
}

.import-zone:hover {
    border-color: var(--primary-500);
}

.import-zone.dragover {
    border-color: var(--primary-500);
    background: var(--primary-50);
}

.import-zone input[type="file"] {
    display: none;
}

.import-zone-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.import-zone p {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.import-zone .import-zone-cta {
    color: var(--primary-600);
    font-weight: 600;
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════
   SCROLLBAR
   ═══════════════════════════════════════════════════ */
.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.show {
        display: block;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .mobile-close-btn {
        display: flex;
    }

    .header-divider {
        display: none;
    }

    .user-info {
        display: none;
    }

    .user-chevron {
        display: none;
    }

    /* Show notification bell but hide settings on mobile */
    .header-actions {
        display: flex;
        gap: 4px;
    }

    .header-actions .header-icon-btn:nth-child(2) {
        display: none;
    }

    .global-search {
        display: none;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-row {
        grid-template-columns: 1fr;
    }

    /* Horizontal scroll for tables */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table-container table {
        min-width: 700px;
    }
}

@media (max-width: 768px) {
    .content-area {
        padding: 1rem;
    }

    .form-row {
        flex-direction: column;
    }

    .search-row {
        flex-direction: column;
    }

    .website-grid {
        grid-template-columns: 1fr;
    }

    .filters-bar {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .page-subtitle {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stats-mini-row {
        flex-direction: column;
    }

    .pagination-bar {
        flex-direction: column;
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .modal-card {
        min-width: auto;
    }

    .page-title {
        font-size: 1.125rem;
    }

    .notif-panel {
        width: 280px;
        right: -40px;
    }
}

/* ═══════════════════════════════════════════════════
   EDIT PLACEMENT MODAL
   ═══════════════════════════════════════════════════ */
.modal-container {
    position: relative;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 560px;
    animation: modalIn 0.25s ease-out;
    z-index: 1;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--primary-50), white);
}

.modal-header h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--red-50);
    color: var(--red-500);
    border-color: var(--red-200);
}

.edit-placement-modal .modal-body {
    padding: 1.5rem;
    text-align: left;
}

.edit-placement-modal .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.edit-placement-modal .form-group {
    display: flex;
    flex-direction: column;
}

.edit-placement-modal .form-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.edit-placement-modal .form-input {
    padding: 10px 14px;
    font-size: 0.8125rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    background: white;
    transition: all 0.2s;
    color: var(--gray-900);
}

.edit-placement-modal .form-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.edit-placement-modal .form-input:disabled {
    background: var(--gray-50);
    color: var(--gray-400);
    cursor: not-allowed;
}

.modal-footer {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    background: var(--gray-50);
    justify-content: flex-end;
}

.modal-footer .btn {
    min-width: 120px;
    justify-content: center;
    height: 42px;
}

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-300);
}

@media (max-width: 600px) {
    .modal-container {
        max-width: 95vw;
    }

    .edit-placement-modal .form-row {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════
   BUYERS ORDER ENHANCEMENTS
   ═══════════════════════════════════════════════════ */

/* ─── View Toggle ─── */
.filter-actions-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.view-toggle {
    display: flex;
    gap: 2px;
    background: var(--gray-100);
    border-radius: 8px;
    padding: 2px;
}

.view-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    transition: all 0.2s;
}

.view-btn.active {
    background: white;
    color: var(--primary-600);
    box-shadow: var(--shadow-sm);
}

.view-btn:hover:not(.active) {
    color: var(--gray-600);
}

/* ─── Card Enhancements ─── */
.website-card-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.bulk-check {
    cursor: pointer;
}

.bulk-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-600);
}

.bookmark-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.125rem;
    padding: 4px;
    border-radius: 50%;
    transition: transform 0.2s;
    line-height: 1;
}

.bookmark-btn:hover {
    transform: scale(1.2);
}

.bookmark-btn-sm {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 2px;
    margin-left: 6px;
    transition: transform 0.2s;
    vertical-align: middle;
}

.bookmark-btn-sm:hover {
    transform: scale(1.2);
}

.website-card-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-600);
    margin-top: 4px;
}

.website-card-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 8px;
}

.card-rating {
    display: flex;
    align-items: center;
    gap: 2px;
}

.card-selected {
    border-color: var(--primary-400) !important;
    background: var(--primary-50) !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
}

.row-selected {
    background: var(--primary-50) !important;
}

/* ─── Availability Badges ─── */
.badge-available {
    background: var(--green-50);
    color: var(--green-600);
}

.badge-available .badge-dot {
    background: var(--green-500);
}

.badge-limited {
    background: var(--yellow-50);
    color: var(--yellow-600);
}

.badge-limited .badge-dot {
    background: var(--yellow-500);
}

.badge-full {
    background: var(--red-50);
    color: var(--red-600);
}

.badge-full .badge-dot {
    background: var(--red-500);
}

/* ─── Bulk Toolbar ─── */
.bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bulk-toolbar .btn-sm {
    padding: 6px 14px;
    font-size: 0.75rem;
    height: auto;
}

.bulk-toolbar .btn-outline {
    border-color: rgba(255, 255, 255, 0.4);
    color: white;
}

.bulk-toolbar .btn-outline:hover {
    background: rgba(255, 255, 255, 0.15);
}

.bulk-toolbar .btn-primary {
    background: white;
    color: var(--primary-700);
}

/* ─── Detail Modal ─── */
.detail-modal {
    max-width: 520px;
}

.detail-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-100);
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
}

.detail-val {
    font-size: 1.125rem;
    font-weight: 800;
    color: var(--gray-900);
}

/* ─── Star Rating ─── */
.star-rating {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin: 8px 0;
}

.star-rating .star {
    font-size: 2rem;
    cursor: pointer;
    color: #d1d5db;
    transition: all 0.15s;
    user-select: none;
}

.star-rating .star:hover {
    transform: scale(1.15);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .filter-actions-bar {
        width: 100%;
        justify-content: space-between;
    }

    .bulk-toolbar {
        flex-wrap: wrap;
    }

    .detail-modal {
        max-width: 95vw;
    }
}

/* ─── Autocomplete Dropdown ─── */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
}

.autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.8125rem;
    display: flex;
    align-items: center;
    transition: background 0.15s;
}

.autocomplete-item:hover {
    background: var(--primary-50);
}

.autocomplete-item:first-child {
    border-radius: 8px 8px 0 0;
}

.autocomplete-item:last-child {
    border-radius: 0 0 8px 8px;
}

/* ─── Responsive for Recent Orders Panel ─── */
@media (max-width: 900px) {
    #recentOrdersPanel {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════
   DOMAIN COLLISION DETECTION
   ═══════════════════════════════════════════════════ */

/* ─── Collision Warning (in install/bulk modals) ─── */
.collision-warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: #92400e;
    animation: pulseWarn 0.6s ease-out;
}

@keyframes pulseWarn {
    0% {
        transform: scale(0.97);
        opacity: 0;
    }

    50% {
        transform: scale(1.01);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.collision-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.875rem;
    color: #b45309;
}

.collision-header svg {
    color: #d97706;
    flex-shrink: 0;
}

.collision-warning p {
    margin: 4px 0;
    line-height: 1.4;
}

.collision-group-warn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    padding: 8px 10px;
    margin-top: 6px;
    color: #b91c1c;
    font-weight: 600;
}

.collision-buyers {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.collision-buyer-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    font-size: 0.8125rem;
}

.collision-buyer-name {
    font-weight: 600;
    color: #78350f;
}

.collision-group-tag {
    font-size: 0.6875rem;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 2px 8px;
    border-radius: 9999px;
    font-weight: 600;
}

.collision-count {
    margin-left: auto;
    color: #92400e;
    font-weight: 700;
}

/* ─── Dashboard Duplicate Alert Card ─── */
.duplicate-alert-card {
    border: 1px solid #f59e0b;
    background: #fffbeb;
    margin-bottom: 1.5rem;
}

.duplicate-alert-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.duplicate-alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.duplicate-alert-header h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #92400e;
    margin: 0;
}

.duplicate-alert-header p {
    font-size: 0.8125rem;
    color: #a16207;
    margin: 2px 0 0;
}

/* ─── Duplicate Alert Pagination ─── */
.dup-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid rgba(245, 158, 11, 0.15);
}

.hidden {
    display: none !important;
}

/* ═══════════════════════════════════════════════════
   FORM VALIDATION
   ═══════════════════════════════════════════════════ */
.form-control.is-invalid,
.form-input.is-invalid,
input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: var(--red-500) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
    animation: shakeField 0.3s ease-out;
}

.field-error {
    font-size: 0.75rem;
    color: var(--red-500);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: fadeInDown 0.2s ease-out;
}

.field-error::before {
    content: '⚠';
    font-size: 0.6875rem;
}

@keyframes shakeField {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-4px);
    }

    40% {
        transform: translateX(4px);
    }

    60% {
        transform: translateX(-3px);
    }

    80% {
        transform: translateX(2px);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--gray-400);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 2rem;
}

.empty-state h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.8125rem;
    color: var(--gray-400);
    max-width: 320px;
    margin: 0 auto 1.25rem;
    line-height: 1.6;
}

.empty-state .btn {
    display: inline-flex;
}

/* ═══════════════════════════════════════════════════
   WARRANTY EXPIRING WIDGET
   ═══════════════════════════════════════════════════ */
.warranty-alert-card {
    border: 1px solid #f59e0b;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    margin-bottom: 1.5rem;
    border-radius: var(--radius);
    overflow: hidden;
}

.warranty-alert-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.warranty-alert-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    font-size: 1.125rem;
}

.warranty-alert-header h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #92400e;
    margin: 0;
}

.warranty-alert-header p {
    font-size: 0.8125rem;
    color: #a16207;
    margin: 2px 0 0;
}

.warranty-expiring-list {
    padding: 0.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 240px;
    overflow-y: auto;
}

.warranty-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.15);
    font-size: 0.8125rem;
}

.warranty-item-domain {
    font-weight: 600;
    color: #92400e;
}

.warranty-item-target {
    color: #a16207;
    font-size: 0.75rem;
}

.warranty-days-left {
    font-weight: 700;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.warranty-days-left.critical {
    background: var(--red-50);
    color: var(--red-600);
}

.warranty-days-left.warning {
    background: #fef3c7;
    color: #92400e;
}

/* ═══════════════════════════════════════════════════
   REPORT PAGE
   ═══════════════════════════════════════════════════ */
.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.report-card {
    background: white;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.report-card-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.report-card-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gray-900);
}

.report-card-sub {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 4px;
}

@media (max-width: 768px) {
    .report-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .report-summary-grid {
        grid-template-columns: 1fr;
    }

    .warranty-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .warranty-days-left {
        align-self: flex-end;
    }
}

/* ═══════════════════════════════════════════════════
   ENHANCED MOBILE — 480px
   ═══════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .stat-card {
        padding: 1rem;
        gap: 0.75rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .stat-icon svg {
        width: 18px;
        height: 18px;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .modal-overlay {
        padding: 0.5rem;
        align-items: flex-end;
    }

    .modal-card {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-container {
        max-width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
        overflow-y: auto;
    }

    .btn {
        min-height: 44px;
        font-size: 0.8125rem;
    }

    .header-icon-btn {
        width: 40px;
        height: 40px;
    }

    .content-area {
        padding: 0.75rem;
    }

    .chart-card canvas {
        max-height: 200px;
    }

    .charts-row {
        gap: 0.75rem;
    }
}

/* ─── Table scroll hint ─── */
.table-scroll-hint {
    display: none;
    text-align: center;
    font-size: 0.75rem;
    color: var(--gray-400);
    padding: 6px;
    background: var(--gray-50);
    border-radius: 0 0 var(--radius) var(--radius);
}

@media (max-width: 768px) {
    .table-scroll-hint {
        display: block;
    }
}

/* ═══════════════════════════════════════════════════
   SORTABLE TABLE HEADERS
   ═══════════════════════════════════════════════════ */
.sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    transition: color 0.15s;
}

.sortable-th:hover {
    color: var(--primary-600);
}

.sort-icon {
    font-size: 0.75rem;
    color: var(--gray-300);
    margin-left: 4px;
    transition: color 0.15s;
}

.sort-icon.active {
    color: var(--primary-600);
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════
   DRAG & DROP — GROUP ZONES
   ═══════════════════════════════════════════════════ */
.group-drop-zone {
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.group-drop-zone.drag-over {
    border-color: var(--primary-400) !important;
    background: var(--primary-50) !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    transform: scale(1.02);
}

.buyer-draggable {
    cursor: grab;
    transition: opacity 0.2s;
}

.buyer-draggable:active {
    cursor: grabbing;
}

/* ═══════════════════════════════════════════════════
   BUYER DETAIL — STAT BOXES
   ═══════════════════════════════════════════════════ */
.buyer-stat-box {
    text-align: center;
    padding: 0.875rem 0.5rem;
    background: var(--gray-50);
    border-radius: 10px;
    border: 1px solid var(--gray-100);
}

.buyer-stat-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.2;
}

.buyer-stat-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

/* ─── Empty State sub classes ─── */
.empty-state-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.empty-state-desc {
    font-size: 0.8125rem;
    color: var(--gray-400);
    max-width: 320px;
    margin: 0 auto 1.25rem;
    line-height: 1.6;
}

/* ─── Responsive buyer detail ─── */
@media (max-width: 480px) {
    .buyer-stat-box {
        padding: 0.625rem 0.375rem;
    }

    .buyer-stat-value {
        font-size: 1rem;
    }

    .buyer-profile-header {
        flex-direction: column;
        text-align: center;
    }
}