/* LFC Ads - Purple/Lavender Theme */
:root {
    --primary: #6C5CE7;
    --primary-dark: #5A4BD1;
    --primary-darker: #4C3D99;
    --lavender: #A29BFE;
    --lavender-light: #DDD6FE;
    --lavender-bg: #F5F3FF;
    --white: #FFFFFF;
    --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;
    --accent: #F59E0B;
    --accent-light: #FCD34D;
    --success: #10B981;
    --danger: #EF4444;
    --danger-dark: #DC2626;
    --info: #3B82F6;
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    --radius: 8px;
    --radius-lg: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--lavender-bg);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); text-decoration: underline; }

/* Top Navigation */
.topnav {
    background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary) 100%);
    color: white;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.topnav .logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.02em;
}

.topnav .logo:hover { text-decoration: none; }

.topnav .logo svg {
    width: 28px;
    height: 28px;
}

.topnav nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.topnav nav a {
    color: rgba(255,255,255,0.85);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
}

.topnav nav a:hover {
    background: rgba(255,255,255,0.15);
    color: white;
    text-decoration: none;
}

.topnav nav a.active {
    background: rgba(255,255,255,0.2);
    color: white;
}

.topnav .user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: rgba(255,255,255,0.85);
    font-size: 0.9rem;
}

.topnav .user-info a {
    color: rgba(255,255,255,0.85);
    font-size: 0.85rem;
}

.settings-link { display: flex; align-items: center; }
.settings-link svg { width: 18px; height: 18px; opacity: 0.75; transition: opacity 0.15s; }
.settings-link:hover svg { opacity: 1; }
.settings-link:hover { text-decoration: none; }

.settings-heading { margin: 0 0 0.25rem; font-size: 1.1rem; }
.settings-subtext { color: var(--gray-500); font-size: 0.88rem; margin: 0 0 1.25rem; }

/* Email Template Editor */
.email-template-editor {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    tab-size: 4;
    white-space: pre-wrap;
    min-height: 280px;
    resize: vertical;
}
.email-preview-frame {
    width: 100%;
    min-height: 500px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    background: #F5F3FF;
}
.email-var-ref {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.email-var-ref code {
    background: var(--lavender-bg);
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    border: 1px solid var(--lavender-light);
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.email-var-ref code:hover {
    background: var(--lavender-light);
}

/* Main Content */
.main-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--lavender-light);
}

.card-header h2 {
    font-size: 1.25rem;
    color: var(--primary-darker);
    font-weight: 600;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.75rem;
    color: var(--primary-darker);
    font-weight: 700;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.2rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    line-height: 1.4;
}

.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-md); }

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

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; color: white; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: var(--danger-dark); color: white; }

.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); color: var(--gray-800); }

.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
}

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

table th {
    background: var(--lavender-bg);
    color: var(--primary-darker);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--lavender-light);
}

table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.9rem;
    vertical-align: middle;
}

table tr:hover td {
    background: var(--lavender-bg);
}

table .actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: nowrap;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-700);
    margin-bottom: 0.35rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: var(--white);
}

.form-group select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    height: 42px;
    padding: 0 0.85rem;
    line-height: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    padding-right: 2.5rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--lavender);
    box-shadow: 0 0 0 3px rgba(162, 155, 254, 0.25);
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-700);
    cursor: pointer;
    padding-bottom: 0.6rem;
}
.checkbox-inline input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.form-row-4 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
}

/* Flash Messages */
.flash {
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.flash-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.flash-error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.flash-info {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary) 40%, var(--lavender) 100%);
}

.login-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    margin: 1rem;
}

.login-card h1 {
    text-align: center;
    color: var(--primary-darker);
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.login-card .subtitle {
    text-align: center;
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.login-card .btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
    font-size: 1rem;
}

.login-logo {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-logo svg {
    width: 56px;
    height: 56px;
}

.forgot-link {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
}
.forgot-link a {
    color: var(--gray-500);
}
.forgot-link a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray-600);
    cursor: pointer;
    margin-bottom: 1rem;
}
.remember-me input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
}

/* Dashboard Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.stat-icon.purple { background: var(--lavender-light); color: var(--primary); }
.stat-icon.amber { background: #FEF3C7; color: #D97706; }
.stat-icon.green { background: #D1FAE5; color: #059669; }
.stat-icon.blue { background: #DBEAFE; color: #2563EB; }

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

.stat-info p {
    font-size: 0.8rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    margin-top: 0.25rem;
}

/* Admin Panel Layout */
.admin-featured-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.75rem 2rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.25rem;
    text-decoration: none;
    color: inherit;
    border-left: 4px solid var(--accent);
    transition: box-shadow 0.15s, transform 0.15s;
}
.admin-featured-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
    text-decoration: none;
    color: inherit;
}
.admin-featured-card .stat-icon {
    width: 56px;
    height: 56px;
}
.admin-featured-card .stat-icon svg {
    width: 28px;
    height: 28px;
}
.admin-featured-card .stat-info h3 {
    font-size: 1.5rem;
}

.admin-primary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}
.admin-primary-grid .stat-card {
    transition: box-shadow 0.15s, transform 0.15s;
}
.admin-primary-grid .stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}

.admin-secondary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.admin-secondary-grid .stat-card {
    padding: 1rem 1.25rem;
    transition: box-shadow 0.15s, transform 0.15s;
}
.admin-secondary-grid .stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
}
.admin-secondary-grid .stat-icon {
    width: 40px;
    height: 40px;
}
.admin-secondary-grid .stat-icon svg {
    width: 20px;
    height: 20px;
}
.admin-secondary-grid .stat-info h3 {
    font-size: 1.25rem;
}
.admin-secondary-grid .stat-info p {
    font-size: 0.75rem;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-admin { background: var(--lavender-light); color: var(--primary-darker); }
.badge-podcaster { background: #D1FAE5; color: #065F46; }
.badge-advertiser { background: #FEF3C7; color: #92400E; }

/* Confirm Dialog */
.confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.confirm-overlay.active {
    display: flex;
}

.confirm-dialog {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.confirm-dialog h3 {
    margin-bottom: 0.5rem;
    color: var(--gray-800);
}

.confirm-dialog p {
    color: var(--gray-500);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.confirm-dialog .btn-group {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* YT Simulcast Toggle */
.toggle-yes { color: var(--success); font-weight: 600; }
.toggle-no { color: var(--gray-400); }

/* Typeahead / Autocomplete */
.typeahead-wrap {
    position: relative;
}

.typeahead-wrap input[type="text"] {
    width: 100%;
    padding: 0.6rem 0.85rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: var(--white);
}

.typeahead-wrap input[type="text"]:focus {
    outline: none;
    border-color: var(--lavender);
    box-shadow: 0 0 0 3px rgba(162, 155, 254, 0.25);
}

.typeahead-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    border: 1.5px solid var(--lavender);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    max-height: 220px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: var(--shadow-md);
    display: none;
}

.typeahead-list.open { display: block; }

.typeahead-list .ta-item {
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--gray-100);
    transition: background 0.1s;
}

.typeahead-list .ta-item:last-child { border-bottom: none; }
.typeahead-list .ta-item:hover,
.typeahead-list .ta-item.active {
    background: var(--lavender-bg);
    color: var(--primary-darker);
}

.typeahead-list .ta-item.ta-new {
    color: var(--primary);
    font-weight: 600;
    font-style: italic;
}

.typeahead-selected {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    background: var(--lavender-bg);
    border: 1.5px solid var(--lavender);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.typeahead-selected .ta-clear {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 0.25rem;
    line-height: 1;
}

.typeahead-selected .ta-clear:hover { color: var(--danger); }

/* Multi-select typeahead tags */
.ta-multi-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}
.ta-multi-tags:empty { margin-bottom: 0; }
.ta-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.5rem;
    background: var(--lavender-bg);
    border: 1px solid var(--lavender);
    border-radius: 4px;
    font-size: 0.82rem;
    line-height: 1.3;
    white-space: nowrap;
}
.ta-tag-remove {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
}
.ta-tag-remove:hover { color: var(--danger); }

/* Modal Overlay (for new advertiser) */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h2 {
    color: var(--primary-darker);
    margin-bottom: 1.25rem;
    font-size: 1.2rem;
}

/* Breadcrumbs */
.breadcrumbs {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}
.breadcrumbs a { color: var(--primary); }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { margin: 0 0.35rem; color: var(--gray-400); }

/* Sortable Table Headers */
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--primary); }
th.sortable a { color: inherit; text-decoration: none; }
th.sortable a:hover { text-decoration: none; }
th .sort-arrow { margin-left: 0.25rem; font-size: 0.7rem; color: var(--gray-400); }
th.sorted-asc .sort-arrow,
th.sorted-desc .sort-arrow { color: var(--primary); }

/* Report Tables */
.report-total-row td {
    font-weight: 700;
    border-top: 2px solid var(--lavender-light);
    background: var(--lavender-bg);
}

/* Month Selector */
.month-selector {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.month-selector select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    height: 38px;
    padding: 0 2.5rem 0 0.85rem;
    line-height: 38px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E") no-repeat right 0.85rem center;
}
.month-selector select:focus {
    outline: none;
    border-color: var(--lavender);
    box-shadow: 0 0 0 3px rgba(162, 155, 254, 0.25);
}

/* Impersonation Bar */
.impersonate-bar {
    background: #D97706;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    position: sticky;
    top: 0;
    z-index: 101;
}
.impersonate-bar strong { font-weight: 700; }
.impersonate-exit {
    color: white;
    font-size: 1.3rem;
    line-height: 1;
    text-decoration: none;
    opacity: 0.85;
    padding: 0 0.3rem;
    font-weight: 700;
}
.impersonate-exit:hover { opacity: 1; color: white; }
.impersonating .topnav { top: 33px; }

/* Vetting: row fade + undo toast */
.vetting-fade { opacity: 0; transition: opacity 0.3s ease; }

.vetting-toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--gray-800, #1F2937);
    color: white;
    padding: 0.55rem 1rem;
    border-radius: var(--radius);
    font-size: 0.88rem;
    font-weight: 500;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-lg, 0 4px 16px rgba(0,0,0,0.15));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.vetting-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.vetting-toast-undo {
    background: none;
    border: none;
    color: var(--lavender-light, #C4B5FD);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.vetting-toast-undo:hover { color: white; }
.vetting-toast-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.15rem;
    font-weight: 700;
}
.vetting-toast-close:hover { color: white; }

/* Quill Editor Overrides */
.ql-toolbar.ql-snow { border-radius: var(--radius) var(--radius) 0 0; border-color: var(--gray-300); }
.ql-container.ql-snow { border-radius: 0 0 var(--radius) var(--radius); border-color: var(--gray-300); font-size: 0.9rem; font-family: inherit; }
.ql-editor { min-height: 100px; transition: min-height 0.2s ease; }
.ql-editor.ql-expanded { min-height: 250px; }
.ql-editor.ql-blank::before { font-style: normal; color: var(--gray-400); }
.ql-container.ql-snow.no-bottom-radius { border-radius: 0; }

/* Show Grid (podcaster homepage) */
.show-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.show-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--gray-800);
    transition: box-shadow 0.15s, transform 0.15s;
}
.show-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}
.show-card-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lavender-bg);
    color: var(--primary);
    border-radius: var(--radius);
}
.show-card-icon svg { width: 22px; height: 22px; }
.show-card h3 { font-size: 0.95rem; font-weight: 600; margin: 0; }
.show-card-icon.amber-bg { background: #FEF3C7; color: var(--accent); }
.show-card-icon.green-bg { background: #D1FAE5; color: var(--success); }

/* Active-ad dot on show cards */
.active-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    margin-left: 0.4rem;
    vertical-align: middle;
}

/* Report period toggle */
.report-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.period-toggle {
    display: inline-flex;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    overflow: hidden;
}
.period-btn {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--gray-600);
    background: var(--white);
    text-decoration: none;
    border-right: 1px solid var(--gray-300);
    transition: background 0.15s, color 0.15s;
}
.period-btn:last-child { border-right: none; }
.period-btn:hover { background: var(--lavender-bg); color: var(--primary); text-decoration: none; }
.period-btn.active { background: var(--primary); color: white; }
.period-btn.active:hover { background: var(--primary-dark, #5a4bd1); color: white; text-decoration: none; }

/* Report comparison / delta columns */
.prev-period-col { color: var(--gray-400); font-size: 0.85rem; }
.delta-col { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.delta-positive { color: var(--success, #10B981); }
.delta-negative { color: var(--danger, #EF4444); }
.delta-na { color: var(--gray-300); }

/* Editable impressions */
.editable-imps {
    cursor: pointer;
    padding: 0.15rem 0.3rem;
    border-radius: 4px;
    border: 1px dashed var(--gray-300);
    background: var(--gray-50);
    transition: border-color 0.15s, background 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.editable-imps::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background: currentColor;
    opacity: 0.3;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z'/%3E%3Cpath d='m15 5 4 4'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z'/%3E%3Cpath d='m15 5 4 4'/%3E%3C/svg%3E") center/contain no-repeat;
    flex-shrink: 0;
}
.editable-imps:hover {
    border-color: var(--primary);
    background: var(--lavender-bg);
}
.editable-imps:hover::after {
    opacity: 0.6;
}
.imps-input {
    width: 100px;
    padding: 0.2rem 0.4rem;
    font-size: 0.85rem;
    border: 1.5px solid var(--primary);
    border-radius: 4px;
    outline: none;
    background: white;
}

/* Copy / Pixel detail links */
.detail-link { font-size: 0.85rem; font-weight: 500; }
.detail-empty { color: var(--gray-300); }
.detail-content { display: none; }
.detail-body {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    line-height: 1.6;
}

/* Vetting badges on homepage */
.vetting-badge { font-size: 0.8rem; color: var(--accent); font-weight: 600; }
.vetting-done { font-size: 0.8rem; color: var(--success); font-weight: 500; }

/* Vetting page */
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.status-pill {
    display: inline-block;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}
.status-approved { background: #D1FAE5; color: #065F46; }
.status-rejected { background: #FEE2E2; color: #991B1B; }

.ext-link {
    color: var(--gray-400);
    text-decoration: none;
    font-size: 0.85rem;
    margin-left: 0.3rem;
}
.ext-link:hover { color: var(--primary); }

/* Checkbox Grid (podcast access) */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.25rem 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--gray-50);
}
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.25rem;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 4px;
}
.checkbox-label:hover { background: var(--lavender-bg); }
.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    flex-shrink: 0;
}

/* Ad Copy Template UI */
.template-legend {
    background: var(--lavender-bg);
    border: 1px solid var(--lavender-light);
    border-top: 1px solid var(--gray-300);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 0.75rem 1rem;
    margin-top: 0;
    font-size: 0.85rem;
}
.template-legend-title {
    font-weight: 600;
    color: var(--primary-darker);
    margin-bottom: 0.4rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.template-var-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0;
    color: var(--gray-700);
}
.template-var-row code {
    background: var(--white);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--gray-200);
    font-size: 0.82rem;
    color: var(--primary);
    font-weight: 500;
}
.promo-code-notice {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #FEF3C7;
    border: 1px solid #FCD34D;
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: #92400E;
}
.inline-promo-save {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.35rem;
}
.inline-input {
    padding: 0.35rem 0.6rem;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.85rem;
    width: 160px;
}
.inline-input:focus {
    outline: none;
    border-color: var(--lavender);
    box-shadow: 0 0 0 3px rgba(162, 155, 254, 0.25);
}
.template-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-top: 0.75rem;
    background: #DBEAFE;
    border: 1px solid #BFDBFE;
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: #1E40AF;
}
.template-banner-icon {
    font-size: 1.1rem;
    line-height: 1;
    flex-shrink: 0;
}
.apply-to-all-wrap {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.85rem;
}
.apply-to-all-wrap .checkbox-label {
    flex-wrap: wrap;
    gap: 0.35rem;
}
.inline-date-input {
    width: 90px !important;
    padding: 0.25rem 0.5rem !important;
    border: 1.5px solid var(--gray-300);
    border-radius: 4px !important;
    font-size: 0.82rem !important;
    text-align: center;
    font-family: inherit;
    height: auto !important;
    line-height: normal !important;
}
.inline-date-input:focus {
    outline: none;
    border-color: var(--lavender);
    box-shadow: 0 0 0 3px rgba(162, 155, 254, 0.25);
}

/* Apply-to-all inside template legend */
.apply-to-all-inner {
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--lavender-light);
    font-size: 0.85rem;
}
.apply-to-all-inner label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    margin: 0;
    flex-wrap: wrap;
}
.apply-to-all-inner input[type="checkbox"] {
    width: auto !important;
    height: auto !important;
    flex-shrink: 0;
}

/* Ad copy file upload */
.copy-file-upload { margin-bottom: 0.5rem; }
.copy-file-upload-inner {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    text-align: center;
    background: var(--gray-50);
    transition: border-color 0.15s, background 0.15s;
}
.copy-file-upload-inner.drag-over {
    border-color: var(--lavender);
    background: var(--lavender-bg);
}
.copy-file-hint {
    color: var(--gray-400);
    font-size: 0.82rem;
    margin-left: 0.5rem;
}
.copy-file-current,
.copy-file-new {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 0.88rem;
}
.copy-file-icon { font-size: 1.1rem; }
.copy-file-name { font-weight: 500; color: var(--primary); text-decoration: none; }
a.copy-file-name:hover { text-decoration: underline; }
.copy-file-remove {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0 0.25rem;
}
.copy-file-remove:hover { color: var(--danger, #EF4444); }

/* Completed campaign rows */
tr.row-completed td { color: var(--gray-400); }
tr.row-completed td strong { color: var(--gray-400); font-weight: 600; }
tr.row-completed td a:not(.detail-link) { color: var(--gray-400); }

/* Paid rows — pale green background */
tr.row-paid td { background-color: #f0faf0; }
/* Invoiced but unpaid rows — light yellow background */
tr.row-invoiced-unpaid td { background-color: #fffbe6; }

/* Campaign filter inline */
.campaign-filter { font-size: 0.92rem; color: var(--gray-600); }

/* Ads table — compact */
.ads-table table { font-size: 0.82rem; }
.ads-table th { font-size: 0.78rem; white-space: nowrap; }
.ads-table td { padding: 0.45rem 0.5rem; }

/* Ads filter bar */
.ads-filter-bar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.ads-filter-bar .month-selector { margin-bottom: 0; }
.adv-filter-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.92rem;
    color: var(--gray-600);
}
.adv-filter-label { font-weight: 500; white-space: nowrap; }
.adv-filter-group .typeahead-wrap { width: 200px; display: inline-block; position: relative; }
.adv-filter-group .typeahead-wrap input[type="text"] {
    height: 38px;
    font-size: 0.88rem;
    padding: 0 0.75rem;
}
.adv-filter-group .typeahead-selected {
    display: inline-flex;
    font-size: 0.88rem;
    padding: 0.35rem 0.75rem;
}
.paid-filter-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.92rem;
    color: var(--gray-600);
}
.paid-filter-select {
    height: 38px;
    font-size: 0.88rem;
    padding: 0 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: var(--white);
    cursor: pointer;
}

/* Invoiced inline dropdown */
.invoiced-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 1.5px solid var(--gray-300);
    border-radius: 4px;
    padding: 0.2rem 1.6rem 0.2rem 0.5rem;
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23999' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E") no-repeat right 0.45rem center;
    transition: border-color 0.15s;
}
.invoiced-select:focus {
    outline: none;
    border-color: var(--lavender);
    box-shadow: 0 0 0 3px rgba(162, 155, 254, 0.25);
}
.invoiced-select.is-yes { color: var(--success); }
.invoiced-select.is-no { color: var(--gray-400); }

/* Editable inline date */
.editable-date {
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    border: 1px dashed var(--gray-300);
    background: var(--gray-50);
    transition: border-color 0.15s, background 0.15s;
    white-space: nowrap;
}
.editable-date:hover {
    border-color: var(--primary);
    background: var(--lavender-bg);
}
.editable-amount {
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    border: 1px dashed var(--gray-300);
    background: var(--gray-50);
    transition: border-color 0.15s, background 0.15s;
    white-space: nowrap;
}
.editable-amount:hover {
    border-color: var(--primary);
    background: var(--lavender-bg);
}

/* Inline edit controls */
.inline-edit-input {
    width: 140px;
    padding: 0.2rem 0.35rem;
    font-size: 0.85rem;
    border: 1.5px solid var(--primary);
    border-radius: 4px;
    outline: none;
    background: white;
    font-family: inherit;
}
.inline-edit-select {
    padding: 0.2rem 0.35rem;
    font-size: 0.85rem;
    border: 1.5px solid var(--primary);
    border-radius: 4px;
    outline: none;
    background: white;
    font-family: inherit;
}

/* Responsive */
@media (max-width: 768px) {
    .topnav { padding: 0 1rem; }
    .main-content { padding: 1rem; }
    .form-row, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .stats-grid { grid-template-columns: 1fr; }
    .admin-primary-grid { grid-template-columns: 1fr; }
    .admin-secondary-grid { grid-template-columns: 1fr; }
    .topnav nav { display: none; }
}
