/* ==========================================================================
   KWORK ? Shared Layout & Components
   Requires: variables.css
   ========================================================================== */
@import url('ranks.css');

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

/* ----- Body ----- */
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    font-weight: var(--font-light);
    -webkit-font-smoothing: antialiased;
}

.page-public {
    padding-bottom: var(--mobile-nav-height);
}

.page-dashboard {
    overflow-x: hidden;
    padding-bottom: var(--mobile-nav-height);
}

@media (min-width: 768px) {
    .page-public,
    .page-dashboard {
        padding-bottom: 0;
    }
}

/* ----- Container ----- */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 20px;
    }
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
    background: rgba(21, 32, 48, 0.85);
    backdrop-filter: blur(16px);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 120;
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    gap: 12px;
}

.header-dashboard {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text);
    font-weight: var(--font-medium);
    font-size: 1.4rem;
    letter-spacing: -0.5px;
}

.logo i {
    font-size: 1.6rem;
    color: var(--primary);
}

.site-logo-img, .admin-logo-img {
    height: 28px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.logo.logo-no-text {
    gap: 0;
}

/* Desktop navigation */
.nav-desktop {
    display: none;
    gap: 4px;
}

.nav-link {
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: var(--font-regular);
    color: var(--text-soft);
    text-decoration: none;
    border-radius: var(--radius-full);
    transition: var(--transition);
    white-space: nowrap;
    border: 1px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
    background: var(--primary-light);
    border-color: rgba(106, 156, 255, 0.25);
}

@media (min-width: 1024px) {
    .nav-desktop {
        display: flex;
    }

    .header-left {
        gap: 16px;
    }

    .logo {
        font-size: 1.5rem;
    }
}

/* Desktop search */
.search-desktop {
    display: none;
    flex: 1;
    max-width: 380px;
    position: relative;
}

.search-desktop input {
    width: 100%;
    height: 40px;
    padding: 0 16px 0 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: var(--font-light);
    outline: none;
    color: var(--text);
    transition: var(--transition);
}

.search-desktop input:focus {
    border-color: var(--primary);
    background: #1a2533;
}

.search-desktop input::placeholder {
    color: var(--text-soft);
}

.search-desktop i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-soft);
    font-size: 0.9rem;
    pointer-events: none;
}

.search-suggestions {
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
    display: none;
    z-index: 150;
    padding: 8px;
}

.search-suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text);
    transition: background 0.15s;
}

.suggestion-item:hover {
    background: var(--primary-light);
}

@media (min-width: 768px) {
    .search-desktop {
        display: block;
    }
}

/* Header actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (min-width: 768px) {
    .header-actions {
        gap: 12px;
    }
}

.icon-btn {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--text-soft);
    text-decoration: none;
    font-size: 1.2rem;
    transition: var(--transition);
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
}

.icon-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: var(--font-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    border: 2px solid var(--surface);
    line-height: 1;
    padding: 0 4px;
}

.balance-btn {
    display: none;
    align-items: center;
    gap: 6px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    padding: 0 16px;
    height: 38px;
    font-size: 0.85rem;
    font-weight: var(--font-medium);
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background var(--transition);
    white-space: nowrap;
}

.balance-btn:hover {
    background: #5a85e6;
}

@media (min-width: 480px) {
    .balance-btn {
        display: inline-flex;
    }
}

.header-avatar-link {
    display: none;
    text-decoration: none;
    flex-shrink: 0;
    border-radius: var(--radius-full);
    transition: var(--transition);
    border: 2px solid transparent;
}

.header-avatar-link:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(106, 156, 255, 0.15);
}

@media (min-width: 768px) {
    .header-avatar-link {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 0.85rem;
    margin: 0;
}

.header-avatar .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.header-avatar.avatar-wrap {
    position: relative;
}

.burger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-size: 1.2rem;
    color: var(--text);
    cursor: pointer;
    transition: var(--transition);
}

.burger-btn:hover {
    background: #263548;
}

@media (min-width: 1024px) {
    .burger-btn {
        display: none;
    }
}

/* ==========================================================================
   Mobile Menu
   ========================================================================== */
.mobile-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--surface);
    backdrop-filter: blur(20px);
    padding: 16px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    opacity: 0;
    visibility: hidden;
    transition: 0.25s ease;
    z-index: 110;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.mobile-link {
    padding: 12px 16px;
    background: var(--bg);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text);
    font-weight: var(--font-regular);
    font-size: 1rem;
    border: 1px solid transparent;
    transition: var(--transition);
}

.mobile-link:active,
.mobile-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.mobile-link-sub {
    font-size: 0.88rem;
    padding-left: 28px;
    color: var(--text-soft);
    background: transparent;
    border: none;
}

.mobile-link-sub:hover {
    color: var(--primary);
}

@media (min-width: 1024px) {
    .mobile-menu {
        display: none;
    }
}

/* ==========================================================================
   Bottom Navigation (mobile)
   ========================================================================== */
.bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--mobile-nav-height);
    background: rgba(21, 32, 48, 0.92);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    z-index: 120;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-soft);
    font-size: 0.65rem;
    font-weight: var(--font-regular);
    gap: 2px;
    transition: var(--transition);
    padding: 4px 8px;
    border: none;
    background: transparent;
    cursor: pointer;
}

.bottom-nav-item i {
    font-size: 1.3rem;
}

.bottom-nav-item.active,
.bottom-nav-item:hover {
    color: var(--primary);
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
}

/* ==========================================================================
   App Layout & Sidebar
   ========================================================================== */
.app-layout {
    display: flex;
    min-height: calc(100vh - var(--header-height));
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--header-height);
    bottom: 0;
    left: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding: 16px 12px;
    gap: 20px;
}

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

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 1024px) {
    .sidebar {
        position: sticky;
        top: var(--header-height);
        transform: translateX(0);
        z-index: 1;
        align-self: flex-start;
        height: calc(100vh - var(--header-height));
    }

    .sidebar-overlay {
        display: none;
    }
}

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--primary-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f6ef7, var(--purple));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    font-weight: var(--font-medium);
    flex-shrink: 0;
}

.profile-info .name {
    font-weight: var(--font-medium);
    font-size: 0.9rem;
}

.profile-info .role {
    font-size: 0.7rem;
    color: var(--text-soft);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: var(--font-regular);
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
    position: relative;
}

.sidebar-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-item .item-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: var(--font-medium);
}

.sidebar-item:hover,
.sidebar-item.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: rgba(106, 156, 255, 0.25);
}

.sidebar-divider {
    border-top: 1px solid var(--border);
    margin: 8px 0;
}

.sidebar-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-soft);
    padding: 8px 14px 4px;
    font-weight: var(--font-medium);
}

/* ==========================================================================
   Main Content
   ========================================================================== */
.main-content {
    flex: 1;
    padding: 24px 20px;
    width: 100%;
    overflow-x: hidden;
    min-width: 0;
}

@media (max-width: 1023px) {
    .main-content {
        padding: 16px;
    }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    font-family: inherit;
    font-weight: var(--font-medium);
    font-size: 0.85rem;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    background: transparent;
    color: var(--text);
}

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

.btn-primary:hover {
    background: #5a85e6;
}

.btn-outline {
    border-color: var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

.btn-block {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* ----- Breadcrumbs ----- */
.breadcrumbs,
.breadcrumbs-enhanced {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.breadcrumbs-enhanced {
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.breadcrumbs a,
.breadcrumbs-enhanced a {
    color: var(--primary);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.breadcrumbs a:hover,
.breadcrumbs-enhanced a:hover {
    background: var(--primary-light);
}

.breadcrumbs i.fa-chevron-right,
.breadcrumbs-enhanced .bc-sep {
    color: var(--text-soft);
    font-size: 0.6rem;
    opacity: 0.55;
    margin: 0 2px;
}

.breadcrumbs span,
.breadcrumbs-enhanced .bc-current {
    color: var(--text);
    font-weight: var(--font-medium);
    padding: 4px 10px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.breadcrumbs-enhanced .bc-home i {
    margin-right: 4px;
}

.btn-danger {
    color: var(--danger);
    border-color: var(--danger);
}

.btn-danger:hover {
    background: rgba(244, 63, 94, 0.1);
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}

.card-title {
    font-size: 1.1rem;
    font-weight: var(--font-medium);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title i {
    color: var(--primary);
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: var(--font-medium);
    margin-bottom: 6px;
    color: var(--text);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: var(--font-light);
    outline: none;
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    background: #1a2533;
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-soft);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239aabbf' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

/* ==========================================================================
   Chips
   ========================================================================== */
.chip-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--primary-light);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text);
}

.chip i {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.chip i:hover {
    opacity: 1;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrapper,
.table-responsive {
    overflow-x: auto;
    margin-top: 10px;
}

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

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

th {
    font-weight: var(--font-medium);
    color: var(--text-soft);
    white-space: nowrap;
}

td {
    color: var(--text);
}

th i {
    margin-left: 4px;
    font-size: 0.7rem;
}

th.sortable {
    cursor: pointer;
    user-select: none;
}

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

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(30, 42, 58, 0.4);
}

/* Status badges */
.status,
.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: var(--font-medium);
    display: inline-block;
    white-space: nowrap;
}

.status-active {
    background: rgba(45, 212, 191, 0.15);
    color: var(--success);
}

.status-completed {
    background: rgba(106, 156, 255, 0.15);
    color: var(--primary);
}

.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.status-cancelled {
    background: rgba(244, 63, 94, 0.15);
    color: var(--danger);
}

/* ==========================================================================
   Modal & Toast
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 400;
    display: none;
}

.modal-overlay.active {
    display: block;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 24px;
    max-width: 600px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-soft);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color var(--transition);
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    position: fixed;
    top: 80px;
    right: 16px;
    background: var(--surface);
    border-radius: 16px;
    padding: 12px 18px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 3000;
    font-size: 0.85rem;
    border-left: 3px solid var(--primary);
    animation: toastSlideIn 0.2s ease;
    max-width: 300px;
    color: var(--text);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 32px 0 20px;
    margin-top: 32px;
}

.footer-compact {
    padding: 16px 0;
    margin-top: 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .footer-grid-extended {
        grid-template-columns: 1.4fr repeat(4, 1fr);
    }
}

@media (min-width: 1100px) {
    .footer-grid-extended {
        grid-template-columns: 1.5fr repeat(4, 1fr);
        gap: 28px;
    }
}

.footer-col-brand .footer-desc {
    font-size: 0.8rem;
    color: var(--text-soft);
    line-height: 1.5;
    margin-bottom: 4px;
}

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    color: var(--text-soft);
    font-size: 0.7rem;
}

.footer-grid-extended + .footer-bottom,
.footer-bottom:has(.footer-bottom-links) {
    text-align: left;
}

.footer-col h4 {
    font-weight: var(--font-medium);
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--text);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 6px;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: var(--font-light);
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
}

.social-links {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.social-link {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-soft);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.footer-bottom-links {
    display: flex;
    gap: 14px;
}

.footer-bottom-links a {
    color: var(--text-soft);
    text-decoration: none;
    font-size: 0.7rem;
}

.footer-bottom-links a:hover {
    color: var(--primary);
}

.footer-compact .footer-bottom {
    padding-top: 0;
    border-top: none;
}

/* ==========================================================================
   Stats Grid
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 16px;
        margin-bottom: 24px;
    }
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius-md);
    padding: 16px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.2s;
}

@media (min-width: 768px) {
    .stat-card {
        padding: 18px;
        gap: 14px;
    }
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .stat-icon {
        width: 48px;
        height: 48px;
        border-radius: var(--radius-md);
        font-size: 1.4rem;
    }
}

.stat-icon.blue {
    background: rgba(106, 156, 255, 0.15);
    color: var(--primary);
}

.stat-icon.green {
    background: rgba(45, 212, 191, 0.15);
    color: var(--success);
}

.stat-icon.orange {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.stat-icon.purple {
    background: rgba(167, 139, 250, 0.15);
    color: var(--purple);
}

.stat-value {
    font-size: 1.4rem;
    font-weight: var(--font-medium);
    line-height: 1.2;
}

@media (min-width: 768px) {
    .stat-value {
        font-size: 1.6rem;
    }
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-soft);
}

@media (min-width: 768px) {
    .stat-label {
        font-size: 0.8rem;
    }
}

/* ==========================================================================
   Filters & Search
   ========================================================================== */
.filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 0 16px;
    height: 40px;
    transition: border-color var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary);
}

.search-box i {
    color: var(--text-soft);
    margin-right: 8px;
    flex-shrink: 0;
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text);
    width: 100%;
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: var(--font-light);
}

.search-box input::placeholder {
    color: var(--text-soft);
}

.filter-select {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239aabbf' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.filter-select:focus {
    border-color: var(--primary);
}

.stat-pill {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 6px 14px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-soft);
    white-space: nowrap;
}

.stat-pill:hover {
    background: var(--primary-light);
    border-color: rgba(106, 156, 255, 0.25);
    color: var(--text);
}

.stat-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.page-item {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-soft);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    text-decoration: none;
}

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

.page-item:hover:not(.active) {
    background: var(--primary-light);
    border-color: rgba(106, 156, 255, 0.25);
    color: var(--primary);
}

.page-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==========================================================================
   Steps (multi-step forms)
   ========================================================================== */
.steps {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.step {
    flex: 1;
    min-width: 80px;
    text-align: center;
    padding: 12px 8px;
    border-radius: var(--radius-md);
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-soft);
    cursor: pointer;
    transition: var(--transition);
}

.step.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

.step.completed {
    background: rgba(45, 212, 191, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.step-panel { display: none; }
.step-panel.active { display: block; }

.page-title {
    font-size: 1.5rem;
    font-weight: var(--font-light);
    margin-bottom: 20px;
}

.form-nav {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.input-wrapper { position: relative; }
.input-wrapper .form-input { padding-right: 40px; }

.chart-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    color: var(--text-soft);
    margin-top: 8px;
}

.modal-lg { max-width: 640px; }
.form-hint { color: var(--text-soft); font-size: 0.85rem; margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.empty-state { color: var(--text-soft); padding: 40px 0; text-align: center; }
.empty-state a { color: var(--primary); }

.header-simple .header-content { height: 64px; }
.page-viewkwork { padding-bottom: 0; }

.status-cancelled {
    background: rgba(244, 63, 94, 0.15);
    color: var(--danger);
}

.bottom-nav-dashboard { display: flex; }
@media (min-width: 1024px) {
    .bottom-nav-dashboard { display: none; }
}

/* ===== Enhanced UI shared ===== */
.page-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.page-header-row .page-title { margin-bottom: 0; }
.draft-badge { font-size: 0.75rem; color: var(--text-soft); background: var(--primary-light); padding: 6px 12px; border-radius: var(--radius-full); border: 1px solid var(--border); }
.step-progress { height: 4px; background: var(--border); border-radius: 4px; margin-bottom: 16px; overflow: hidden; }
.step-progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--success)); width: 16%; transition: width 0.3s ease; }
.steps .step span { display: block; font-size: 0.7rem; margin-top: 4px; }
.required { color: var(--danger); }
.form-hint-inline { font-size: 0.75rem; color: var(--text-soft); }
.chip-inline-input { flex: 1; min-width: 120px; border: none !important; background: transparent !important; padding: 4px !important; }
.filters-enhanced { margin-bottom: 20px; }
.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-pill { padding: 6px 14px; border-radius: var(--radius-full); background: var(--surface); border: 1px solid var(--border); color: var(--text-soft); text-decoration: none; font-size: 0.8rem; transition: var(--transition); }
.filter-pill.active, .filter-pill:hover { background: var(--primary); border-color: var(--primary); color: white; }
.view-toggle { display: flex; gap: 4px; }
.view-toggle .view-btn { width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-soft); cursor: pointer; }
.view-toggle .view-btn.active { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.empty-state-card { text-align: center; padding: 48px 24px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius-md); margin: 20px 0; }
.empty-state-card.full-width { grid-column: 1 / -1; }
.empty-state-card i { font-size: 2.5rem; color: var(--text-soft); margin-bottom: 12px; }
.empty-state-card h3 { font-weight: var(--font-medium); margin-bottom: 8px; }
.empty-state-card p { color: var(--text-soft); margin-bottom: 16px; }
.enhanced-table tr.row-urgent { border-left: 3px solid var(--danger); }
.urgent-badge { background: var(--danger); color: white; font-size: 0.6rem; padding: 2px 6px; border-radius: 4px; margin-left: 6px; font-weight: var(--font-medium); }
.cat-tag { font-size: 0.7rem; background: var(--primary-light); padding: 3px 10px; border-radius: var(--radius-full); border: 1px solid var(--border); }
.price-cell, .price-highlight { color: var(--primary); font-weight: var(--font-medium); }
.deadline-warn { color: var(--danger) !important; }
.mini-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-light); display: inline-flex; align-items: center; justify-content: center; font-size: 0.65rem; margin-right: 6px; }
.user-cell { display: flex; align-items: center; }
.orders-cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; }
.order-card-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; transition: var(--transition); }
.order-card-item:hover { border-color: var(--primary); }
.order-card-item.urgent { border-left: 4px solid var(--danger); }
.order-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.order-card-title { font-size: 1rem; font-weight: var(--font-medium); margin-bottom: 8px; }
.order-card-meta { display: flex; gap: 16px; font-size: 0.8rem; color: var(--text-soft); margin-bottom: 12px; }
.order-card-actions { display: flex; gap: 8px; margin-top: 12px; }
.deadline-bar-wrap { background: var(--bg); border-radius: var(--radius-full); height: 6px; position: relative; margin: 12px 0; overflow: hidden; }
.deadline-bar { height: 100%; background: var(--success); border-radius: var(--radius-full); }
.deadline-bar-wrap span { position: absolute; right: 0; top: -18px; font-size: 0.7rem; color: var(--text-soft); }
.order-detail-modal h2 { margin-bottom: 12px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 16px 0; }
.detail-grid label { font-size: 0.7rem; color: var(--text-soft); text-transform: uppercase; display: block; margin-bottom: 4px; }
.detail-badges { display: flex; gap: 8px; margin-bottom: 12px; }
.search-results-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px 16px; margin-bottom: 16px; font-size: 0.9rem; }
.search-results-banner .results-count { color: var(--text-soft); margin-left: auto; }
.service-actions { display: flex; gap: 4px; }
.fav-btn.favorited i { color: var(--danger); }
.btn-publish { background: linear-gradient(135deg, var(--primary), #5a85e6); }
.package-card.disabled { opacity: 0.72; }
.package-card.disabled .package-header,
.package-card.disabled .package-toggle,
.package-card.disabled .package-toggle-label {
    pointer-events: auto;
    cursor: pointer;
}
.file-upload-area.dragover { border-color: var(--primary); background: var(--primary-light); }
.file-thumb.has-image img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.file-thumb .remove-file { position: absolute; top: -6px; right: -6px; background: var(--danger); color: white; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 0.75rem; }
.star-rating-input { display: flex; gap: 6px; margin-bottom: 16px; }
.star-btn { background: none; border: none; color: var(--border); font-size: 1.4rem; cursor: pointer; padding: 0; }
.star-btn.active { color: var(--warning); }
.enhanced-pills .stat-pill { display: inline-flex; align-items: center; gap: 6px; }
.enhanced-pills .stat-pill b { font-weight: var(--font-medium); }
.btn-compact {
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: var(--font-regular);
    gap: 5px;
    letter-spacing: 0.01em;
}

.avatar-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.avatar .online-dot,
.contact-avatar .online-dot,
.seller-avatar-inner .online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: var(--success);
    border-radius: 50%;
    border: 2px solid var(--surface);
}

.sidebar-profile-link {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.sidebar-profile-link:hover {
    border-color: rgba(106, 156, 255, 0.35);
}

.avatar-xl {
    width: 88px;
    height: 88px;
    font-size: 1.8rem;
}

.seller-avatar-inner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f6ef7, #a78bfa);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-medium);
    overflow: hidden;
}

.seller-avatar-inner.avatar-wrap.has-pro,
.seller-avatar-inner.has-pro {
    overflow: visible;
}

.file-thumb small {
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
    font-size: 0.55rem;
    text-align: center;
    color: var(--text-soft);
    background: rgba(13, 20, 32, 0.75);
    border-radius: 4px;
    padding: 1px 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 640px) {
    .form-row { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .steps .step span { display: none; }
}

/* Admin broadcast notifications ? shared highlight */
.notification-item.notification-broadcast {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.08), rgba(45, 212, 191, 0.02));
    border: 1px solid rgba(45, 212, 191, 0.4);
    border-radius: var(--radius-sm);
    margin: 0 -4px;
    padding: 12px 8px 12px 10px !important;
    border-left: 3px solid var(--success) !important;
}

.notification-item.notification-broadcast.unread {
    border-left-width: 4px !important;
}

.notification-icon-broadcast {
    background: rgba(45, 212, 191, 0.18) !important;
    color: var(--success) !important;
}

.notif-broadcast-badge {
    display: inline-block;
    padding: 1px 7px;
    margin-bottom: 4px;
    border-radius: var(--radius-full);
    background: rgba(45, 212, 191, 0.15);
    border: 1px solid rgba(45, 212, 191, 0.35);
    color: var(--success);
    font-size: 0.62rem;
    font-weight: var(--font-medium);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
