/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 2.5rem 2.5rem;
    position: relative;
}

/* ─ Section system ─ */
.section-panel {
    display: none;
}

.section-panel.active {
    display: block;
    animation: section-appear 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes section-appear {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

/* ── Fix: Modal must render above everything — explicit z-index stack ── */
.modal-backdrop {
    z-index: 1040 !important;
}

.modal {
    z-index: 1045 !important;
}

.modal-dialog {
    position: relative;
    z-index: 1046 !important;
    /* Ensure dialog is never clipped */
    transform: none !important;
}


/* ============================================================
   DASHBOARD SECTION
   ============================================================ */

/* Greeting */
.greeting-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    animation: fade-up 0.6s ease;
    gap: 1rem;
}

.greeting-title {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    color: var(--text);
    margin: 0 0 0.35rem 0;
    background: linear-gradient(135deg, var(--text) 0%, var(--text2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.greeting-sub {
    font-size: 0.9rem;
    color: var(--text3);
    margin: 0;
    font-weight: 500;
}

.greeting-date {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0.7rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text2);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.greeting-date i {
    color: var(--teal);
    font-size: 1rem;
}

/* Stat Tiles Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.stat-tile {
    background: linear-gradient(145deg, var(--surface) 0%, var(--surface2) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 1.75rem 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    cursor: default;
    transition: var(--transition);
    animation: fade-up 0.6s ease calc(var(--i, 0) * 0.1s) backwards;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.stat-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-tile:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border2);
}

.stat-tile:hover::before {
    opacity: 1;
}

/* Tile accent colors */
.stat-tile:nth-child(1)::before {
    background: linear-gradient(90deg, var(--teal), var(--teal-l), var(--teal));
    background-size: 200% 100%;
    animation: gradient-shift 3s ease infinite;
}

.stat-tile:nth-child(2)::before {
    background: linear-gradient(90deg, var(--violet), #8b5cf6, var(--violet));
    background-size: 200% 100%;
    animation: gradient-shift 3s ease infinite;
}

.stat-tile:nth-child(3)::before {
    background: linear-gradient(90deg, var(--amber), var(--amber-l), var(--amber));
    background-size: 200% 100%;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.stat-tile-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-tile-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    transition: var(--transition);
    position: relative;
}

.stat-tile:hover .stat-tile-icon {
    transform: scale(1.1) rotate(-5deg);
}

.stat-tile-icon.teal {
    background: linear-gradient(145deg, var(--teal-pale2) 0%, var(--teal-pale) 100%);
    color: var(--teal);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.stat-tile-icon.violet {
    background: linear-gradient(145deg, #ddd6fe 0%, var(--violet-pale) 100%);
    color: var(--violet);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.stat-tile-icon.amber {
    background: linear-gradient(145deg, var(--amber-pale2) 0%, var(--amber-pale) 100%);
    color: var(--amber);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.stat-tile-num {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -0.05em;
    color: var(--text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.stat-tile-label {
    font-size: 0.7rem;
    color: var(--text3);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 4px;
}

/* Spark bar (decorative) */
.stat-tile-bar {
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.stat-tile-spark {
    height: 100%;
    border-radius: 3px;
    width: 0;
    position: relative;
    transition: width 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-tile-spark.teal {
    background: linear-gradient(90deg, var(--teal-pale2), var(--teal));
}

.stat-tile-spark.violet {
    background: linear-gradient(90deg, #ddd6fe, var(--violet));
}

.stat-tile-spark.amber {
    background: linear-gradient(90deg, var(--amber-pale2), var(--amber));
}

/* Dashboard Grid */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}




/* Dashboard Cards */
.dash-card {
    background: linear-gradient(145deg, var(--surface) 0%, var(--surface2) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    animation: fade-up 0.6s ease calc(var(--i, 0) * 0.1s + 0.2s) backwards;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.dash-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--border2);
}

.dash-card-header {
    background: linear-gradient(180deg, var(--surface2) 0%, var(--surface) 100%);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.text-teal {
    color: var(--teal);
}

.text-gold {
    color: var(--amber-l);
}

.text-violet {
    color: var(--violet);
}

.text-amber {
    color: var(--amber);
}

/* Dashboard Card Badge */
.dash-card-badge {
    font-size: 0.65rem;
    font-weight: 700;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.35);
    animation: pulse-badge 2s ease infinite;
}

@keyframes pulse-badge {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Dashboard Card Link */
.dash-card-link {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--teal);
    background: var(--teal-pale);
    border: none;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.dash-card-link:hover {
    background: var(--teal);
    color: #fff;
    transform: translateX(3px);
}

/* Activity List */
.activity-list {
    padding: 0.75rem;
    max-height: 320px;
    overflow-y: auto;
}

.activity-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text3);
    font-size: 0.8rem;
}

.activity-empty i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
    border: 1px solid transparent;
}

.activity-item:hover {
    background: var(--surface3);
    border-color: var(--border);
}

.activity-item+.activity-item {
    border-top: 1px solid var(--border);
}

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

.activity-icon.teal {
    background: var(--teal-pale);
    color: var(--teal);
}

.activity-icon.violet {
    background: var(--violet-pale);
    color: var(--violet);
}

.activity-icon.amber {
    background: var(--amber-pale);
    color: var(--amber);
}

.activity-icon.green {
    background: var(--green-pale);
    color: var(--green);
}

.activity-body {
    flex: 1;
    min-width: 0;
}

.activity-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-meta {
    font-size: 0.7rem;
    color: var(--text3);
    font-weight: 500;
}

.activity-time {
    font-size: 0.68rem;
    color: var(--text3);
    white-space: nowrap;
    font-weight: 600;
}

/* Top Items List */
.top-items-list {
    padding: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
}

.top-items-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text3);
    font-size: 0.8rem;
}

.top-items-empty i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

.top-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.top-item:hover {
    background: var(--surface3);
}

.top-item+.top-item {
    border-top: 1px solid var(--border);
}

.top-item-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    flex-shrink: 0;
}

.top-item-rank.gold {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.top-item-rank.silver {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    color: #fff;
    box-shadow: 0 2px 8px rgba(156, 163, 175, 0.4);
}

.top-item-rank.bronze {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #fff;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.4);
}

.top-item-rank.default {
    background: var(--surface3);
    color: var(--text3);
}

.top-item-info {
    flex: 1;
    min-width: 0;
}

.top-item-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.top-item-sub {
    font-size: 0.7rem;
    color: var(--text3);
    font-weight: 500;
}

.top-item-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    white-space: nowrap;
}

.top-item-badge.views {
    background: var(--teal-pale);
    color: var(--teal);
}

.top-item-badge.margin {
    background: var(--violet-pale);
    color: var(--violet);
}

/* Quick Actions */
.quick-actions {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.qa-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(145deg, var(--surface3) 0%, var(--bg) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.qa-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    transition: left 0.5s ease;
}

.qa-btn:hover::before {
    left: 100%;
}

.qa-btn:hover {
    background: var(--surface);
    border-color: var(--border2);
    transform: translateX(6px);
    box-shadow: var(--shadow-md);
}

.qa-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.qa-btn:hover .qa-icon {
    transform: scale(1.1);
}

.qa-icon.teal {
    background: linear-gradient(145deg, var(--teal-pale2) 0%, var(--teal-pale) 100%);
    color: var(--teal);
    box-shadow: 0 3px 10px rgba(13, 148, 136, 0.15);
}

.qa-icon.violet {
    background: linear-gradient(145deg, #ddd6fe 0%, var(--violet-pale) 100%);
    color: var(--violet);
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.15);
}

.qa-icon.amber {
    background: linear-gradient(145deg, var(--amber-pale2) 0%, var(--amber-pale) 100%);
    color: var(--amber);
    box-shadow: 0 3px 10px rgba(217, 119, 6, 0.15);
}

.qa-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.qa-sub {
    font-size: 0.75rem;
    color: var(--text3);
    font-weight: 500;
    margin-top: 2px;
}

/* Flow Steps */
.flow-steps {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.flow-step {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding-bottom: 1.5rem;
    position: relative;
}

.flow-step:last-child {
    padding-bottom: 0;
}

.flow-num {
    width: 40px;
    height: 40px;
    background: linear-gradient(145deg, var(--teal) 0%, var(--teal-d) 100%);
    color: #fff;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 900;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
    position: relative;
    z-index: 1;
}

.flow-line {
    position: absolute;
    left: 20px;
    top: 40px;
    width: 2px;
    height: calc(100% - 12px);
    background: linear-gradient(to bottom, var(--teal-pale2), var(--border));
}

.flow-body {
    padding-top: 4px;
}

.flow-title {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 4px;
}

.flow-desc {
    font-size: 0.8rem;
    color: var(--text3);
    line-height: 1.6;
    font-weight: 500;
}


/* ============================================================
   SECTION PAGES
   ============================================================ */
.section-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    animation: fade-up 0.5s ease;
    gap: 1rem;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: -0.035em;
    color: var(--text);
    margin: 0 0 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.section-icon.teal {
    background: linear-gradient(145deg, var(--teal-pale2), var(--teal-pale));
    color: var(--teal);
    box-shadow: 0 3px 10px rgba(13, 148, 136, 0.15);
}

.section-icon.violet {
    background: linear-gradient(145deg, #ddd6fe, var(--violet-pale));
    color: var(--violet);
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.15);
}

.section-icon.amber {
    background: linear-gradient(145deg, var(--amber-pale2), var(--amber-pale));
    color: var(--amber);
    box-shadow: 0 3px 10px rgba(217, 119, 6, 0.15);
}

.section-sub {
    font-size: 0.85rem;
    color: var(--text3);
    margin: 0;
    font-weight: 500;
    padding-left: calc(44px + 0.75rem);
}

/* Search and Filter Bar */
.search-filter-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 350px;
}

.search-input-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text3);
    font-size: 1rem;
}

.search-input-wrap input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text);
    outline: none;
    transition: var(--transition);
}

.search-input-wrap input:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.search-input-wrap input::placeholder {
    color: var(--text3);
    font-weight: 400;
}

.filter-chips {
    display: flex;
    gap: 0.5rem;
}

.filter-chip {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text2);
    cursor: pointer;
    transition: var(--transition);
}

.filter-chip:hover {
    border-color: var(--violet);
    color: var(--violet);
}

.filter-chip.active {
    background: linear-gradient(145deg, var(--violet) 0%, var(--violet-d) 100%);
    border-color: var(--violet);
    color: #fff;
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.3);
}

/* Sort Dropdown */
.sort-dropdown {
    position: relative;
}

.sort-dropdown select {
    padding: 0.5rem 2rem 0.5rem 0.875rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text2);
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2357534e' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 10px) center;
    padding-right: 30px;
}

.sort-dropdown select:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
    outline: none;
}

.sort-dropdown select:hover {
    border-color: var(--violet);
}

/* Primary action button */
.btn-primary-action {
    background: linear-gradient(145deg, var(--teal) 0%, var(--teal-d) 100%);
    color: #fff;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3), 0 2px 4px rgba(13, 148, 136, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-primary-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary-action:hover::before {
    left: 100%;
}

.btn-primary-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.35), 0 4px 8px rgba(13, 148, 136, 0.25);
}

.btn-primary-action:active {
    transform: translateY(0);
}

/* Danger action button */
.btn-danger-action {
    background: linear-gradient(145deg, var(--red) 0%, #b91c1c 100%);
    color: #fff;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3), 0 2px 4px rgba(220, 38, 38, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-danger-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-danger-action:hover::before {
    left: 100%;
}

.btn-danger-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.35), 0 4px 8px rgba(220, 38, 38, 0.25);
}

.btn-danger-action:active {
    transform: translateY(0);
}

/* Content card */
.content-card {
    background: linear-gradient(145deg, var(--surface) 0%, var(--surface2) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    animation: fade-up 0.5s ease 0.1s backwards;
    box-shadow: var(--shadow-sm);
}

/* Data table */
.data-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
}

.data-table thead th {
    padding: 1rem 1.5rem;
    background: linear-gradient(180deg, var(--surface2) 0%, var(--surface3) 100%);
    border-bottom: 1px solid var(--border);
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.data-table tbody td {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text);
    font-weight: 500;
    vertical-align: middle;
    transition: background 0.2s ease;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover td {
    background: linear-gradient(90deg, var(--teal-pale) 0%, transparent 50%);
}

/* Empty state */
.empty-state {
    padding: 5rem 2rem;
    text-align: center;
}

.empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--surface3) 0%, var(--bg) 100%);
    border: 2px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text3);
    margin-bottom: 1.25rem;
    animation: empty-float 3s ease-in-out infinite;
    box-shadow: var(--shadow-md);
}

@keyframes empty-float {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-10px) scale(1.02);
    }
}

.empty-state p {
    font-size: 0.9rem;
    color: var(--text3);
    font-weight: 500;
    margin: 0;
    max-width: 300px;
    margin: 0 auto;
}

/* Badges */
.badge-cost {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(145deg, var(--teal-pale2) 0%, var(--teal-pale) 100%);
    color: var(--teal-d);
    border: 1px solid rgba(13, 148, 136, 0.2);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35em 0.75em;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.1);
}

.badge-margin {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(145deg, var(--amber-pale2) 0%, var(--amber-pale) 100%);
    color: var(--amber-d);
    border: 1px solid rgba(217, 119, 6, 0.2);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.35em 0.75em;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.1);
}

/* Icon action buttons */
.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
    flex-shrink: 0;
    background: transparent;
}

.btn-icon.edit {
    background: linear-gradient(145deg, rgba(13, 148, 136, 0.08) 0%, rgba(13, 148, 136, 0.05) 100%);
    border-color: rgba(13, 148, 136, 0.15);
    color: var(--teal);
    box-shadow: 0 2px 6px rgba(13, 148, 136, 0.1);
}

.btn-icon.edit:hover {
    background: linear-gradient(145deg, var(--teal) 0%, var(--teal-d) 100%);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
}

.btn-icon.delete {
    background: linear-gradient(145deg, rgba(220, 38, 38, 0.08) 0%, rgba(220, 38, 38, 0.05) 100%);
    border-color: rgba(220, 38, 38, 0.15);
    color: var(--red);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.1);
}

.btn-icon.delete:hover {
    background: linear-gradient(145deg, var(--red) 0%, #b91c1c 100%);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.btn-icon.copy {
    background: linear-gradient(145deg, rgba(217, 119, 6, 0.08) 0%, rgba(217, 119, 6, 0.05) 100%);
    border-color: rgba(217, 119, 6, 0.15);
    color: var(--amber);
    box-shadow: 0 2px 6px rgba(217, 119, 6, 0.1);
}

.btn-icon.copy:hover {
    background: linear-gradient(145deg, var(--amber) 0%, var(--amber-d) 100%);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

/* ── Client Table Overrides ── */
#section-clients .data-table {
    min-width: 640px;
}

#section-clients .data-table thead th {
    padding: 0.85rem 1rem;
    font-size: 0.65rem;
}

#section-clients .data-table tbody td {
    padding: 0.9rem 1rem;
    font-size: 0.82rem;
}

/* Client name column */
#section-clients .data-table tbody td:first-child {
    min-width: 160px;
    max-width: 220px;
}

#section-clients .data-table tbody td:first-child>div {
    max-width: 210px;
}

#section-clients .data-table tbody td:first-child span.fw-semibold {
    display: inline-block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

#section-clients .data-table tbody td:first-child>div:hover span.fw-semibold {
    color: var(--teal) !important;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
}

/* Personalization button */
.btn-icon.personalize {
    background: linear-gradient(145deg, rgba(124, 58, 237, 0.08) 0%, rgba(124, 58, 237, 0.05) 100%);
    border-color: rgba(124, 58, 237, 0.15);
    color: var(--violet);
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.1);
}

.btn-icon.personalize:hover {
    background: linear-gradient(145deg, var(--violet) 0%, var(--violet-d) 100%);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

/* GST badge */
.badge-gst {
    display: inline-flex;
    align-items: center;
    font-size: 0.73rem;
    font-weight: 700;
    padding: 0.3em 0.65em;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.badge-gst.has-gst {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.12), rgba(13, 148, 136, 0.06));
    color: #0d9488;
    border: 1px solid rgba(13, 148, 136, 0.2);
    box-shadow: 0 1px 4px rgba(13, 148, 136, 0.08);
}

.badge-gst.no-gst {
    color: var(--text3);
    font-size: 0.72rem;
    font-weight: 500;
}

/* Magic link cell */
.magic-link-cell {
    display: inline-block;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.68rem !important;
    color: var(--primary, var(--violet));
    background: rgba(99, 102, 241, 0.06);
    padding: 0.25em 0.55em;
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.12);
    cursor: help;
    transition: var(--transition);
}

.magic-link-cell:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.25);
}

/* Client date filter inputs */
#section-clients .search-filter-bar input[type="date"] {
    padding: 0.4rem 0.5rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text2);
    font-weight: 500;
    transition: var(--transition);
}

#section-clients .search-filter-bar input[type="date"]:focus {
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08);
    outline: none;
}

/* Client views badge */
.client-views-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text2);
}

.client-views-count {
    font-weight: 800;
    color: var(--violet);
}

/* Client date display */
.client-date {
    font-size: 0.76rem;
    color: var(--text2);
    font-weight: 500;
    white-space: nowrap;
}

/* ═══ CLIENT SUB-INFO & NOTES ═══ */
.client-sub-info {
    font-size: 0.68rem;
    color: var(--text3);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    line-height: 1.4;
}

.client-sub-info i {
    font-size: 0.55rem;
    opacity: 0.6;
    flex-shrink: 0;
}

.client-sub-info a:hover {
    color: var(--primary) !important;
    text-decoration: underline !important;
}

.client-notes-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    background: rgba(245, 158, 11, 0.12);
    color: var(--amber);
    font-size: 0.55rem;
    vertical-align: middle;
    margin-left: 0.3rem;
    cursor: help;
    transition: all 0.2s ease;
}

.client-notes-badge:hover {
    background: rgba(245, 158, 11, 0.25);
    transform: scale(1.15);
}

