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

/* Base */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1a1a2e;
    background: #f0f2f5;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background: #fff;
    border-bottom: 1px solid #e4e6eb;
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-brand {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.3px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: #555;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-link:hover { background: #f0f2f5; color: #1a1a2e; }
.nav-link.active { background: #e8f0fe; color: #1967d2; }
.logout-btn { color: #c62828; }
.logout-btn:hover { background: #fbe9e7; }

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 16px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}
.alert-error { background: #fce4ec; color: #c62828; border: 1px solid #ef9a9a; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.alert-info { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    gap: 6px;
}
.btn-primary { background: #1967d2; color: #fff; }
.btn-primary:hover { background: #1557b0; }
.btn-secondary { background: #e4e6eb; color: #333; }
.btn-secondary:hover { background: #d4d6db; }
.btn-danger { background: #fce4ec; color: #c62828; }
.btn-danger:hover { background: #ef9a9a; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-full { width: 100%; }
.btn-link { background: none; color: #1967d2; padding: 6px 12px; }
.btn-link:hover { background: #e8f0fe; }
.btn-retry { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.btn-retry:hover { background: #ffe0b2; }
.btn-retry:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-protocol { background: #38b2ac; color: #fff; font-size: 12px; padding: 5px 11px; border-radius: 8px; }
.btn-protocol:hover { background: #2c9e99; }
.btn-analytics { background: #9f7aea; color: #fff; font-size: 12px; padding: 5px 11px; border-radius: 8px; }
.btn-analytics:hover { background: #805ad5; }
.btn-report-legacy { background: #edf2f7; color: #718096; font-size: 12px; padding: 5px 11px; border-radius: 8px; }
.btn-report-legacy:hover { background: #e2e8f0; }
.btn-ba { background: #4299e1; color: #fff; font-size: 12px; padding: 5px 11px; border-radius: 8px; }
.btn-ba:hover { background: #3182ce; }
.btn-kp { background: #48bb78; color: #fff; font-size: 12px; padding: 5px 11px; border-radius: 8px; }
.btn-kp:hover { background: #38a169; }
.btn-doc-disabled { background: #f7fafc; color: #cbd5e0; font-size: 12px; padding: 5px 11px; border-radius: 8px; cursor: default; border: 1px dashed #e2e8f0; }

/* Login */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.login-title {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.login-subtitle {
    color: #888;
    font-size: 14px;
    margin-bottom: 32px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e4e6eb;
    border-radius: 10px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s;
    background: #fafbfc;
}
.form-input:focus { border-color: #1967d2; background: #fff; }

/* Page header */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
}
.page-header-text h1 {
    font-size: 24px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 2px;
}
.page-header-subtitle {
    font-size: 13px;
    color: #a0aec0;
    font-weight: 400;
}
/* Legacy fallback if no wrapper used */
.page-header h1 {
    font-size: 24px;
    font-weight: 800;
}

/* Reports table */
.reports-table-wrapper {
    background: #fff;
    border-radius: 14px;
    overflow-x: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07), 0 0 0 1px rgba(0,0,0,0.04);
}
.reports-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}
.reports-table th:nth-child(1) { width: 4%; }
.reports-table th:nth-child(2) { width: 10%; }
.reports-table th:nth-child(3) { width: 17%; }
.reports-table th:nth-child(4) { width: 11%; }
.reports-table th:nth-child(5) { width: 22%; }
.reports-table th:nth-child(6) { width: 8%; }
.reports-table th:nth-child(7) { width: 10%; }
.reports-table th:nth-child(8) { width: 8%; }
.reports-table th:nth-child(9) { width: 6%; }
.reports-table th {
    text-align: left;
    padding: 14px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #a0aec0;
    background: #f8f9fc;
    border-bottom: 1px solid #edf2f7;
    white-space: nowrap;
}
.reports-table td {
    padding: 10px 10px;
    border-bottom: 1px solid #f0f4f8;
    font-size: 14px;
    color: #2d3748;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}
.reports-table tbody tr:last-child td { border-bottom: none; }
.reports-table tbody tr {
    transition: background 0.12s ease;
}
.reports-table tbody tr:hover {
    background: #f0f7ff;
}
.filename {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #4a5568;
    font-size: 13px;
}

/* Dialog type pills */
.dialog-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    color: #fff;
    letter-spacing: 0.2px;
}
/* Named types — white text on colored background */
.pill-sales              { background: #48bb78; }
.pill-it_consultation    { background: #4299e1; }
.pill-contractor_eval    { background: #9f7aea; }
.pill-hr_interview       { background: #ed64a6; }
.pill-tech_support       { background: #ed8936; }
.pill-consultation       { background: #38b2ac; }
.pill-onboarding         { background: #00b5d8; }
.pill-general_meeting    { background: #a0aec0; }
.pill-first_meeting      { background: #dbeafe; color: #1565C0; }
.pill-mixed              { background: #90cdf4; color: #1a365d; }
/* Legacy */
.pill-technical          { background: #ed8936; }
/* Fallback for unknown types */
.dialog-pill:not([class*="pill-"]) { background: #a0aec0; }

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}
.status-done {
    background: #c6f6d5;
    color: #22543d;
}
.status-done::before { content: '\2713'; font-size: 11px; }
.status-processing {
    background: #bee3f8;
    color: #1a365d;
    animation: pulse-badge 1.6s ease-in-out infinite;
}
.status-processing::before {
    content: '\25CF';
    font-size: 8px;
}
.status-error {
    background: #fed7d7;
    color: #822727;
}
.status-error::before { content: '\00D7'; font-size: 13px; }
@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

/* Error hint tooltip */
.error-hint {
    display: inline-block;
    margin-left: 4px;
    cursor: help;
    color: #c62828;
    font-size: 13px;
}

/* Actions cell */
.actions-cell { white-space: nowrap; }
.actions-cell .btn { margin-right: 4px; padding: 3px 8px; font-size: 11px; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    background: #fff;
    border-radius: 14px;
    color: #a0aec0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07), 0 0 0 1px rgba(0,0,0,0.04);
}
.empty-state-icon {
    font-size: 52px;
    margin-bottom: 16px;
    display: block;
    opacity: 0.5;
}
.empty-state-title {
    font-size: 18px;
    font-weight: 700;
    color: #4a5568;
    margin-bottom: 6px;
}
.empty-state-hint {
    font-size: 14px;
    color: #a0aec0;
    margin-bottom: 24px;
}
.empty-state p { margin-bottom: 16px; font-size: 16px; }

/* Upload */
.upload-container {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.drop-zone {
    border: 2px dashed #d4d6db;
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafbfc;
}
.drop-zone:hover, .drop-zone.drag-over {
    border-color: #1967d2;
    background: #e8f0fe;
}
.drop-icon { font-size: 48px; margin-bottom: 12px; }
.drop-text { font-size: 18px; font-weight: 600; color: #333; }
.drop-hint { font-size: 14px; color: #888; margin-top: 4px; }
.drop-formats { font-size: 12px; color: #aaa; margin-top: 12px; text-transform: uppercase; letter-spacing: 0.5px; }

/* URL section */
.url-section { margin-top: 24px; }
.or-divider {
    text-align: center;
    color: #aaa;
    font-size: 13px;
    margin-bottom: 12px;
    position: relative;
}
.or-divider::before, .or-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: #e4e6eb;
}
.or-divider::before { left: 0; }
.or-divider::after { right: 0; }
.url-input-group {
    display: flex;
    gap: 8px;
}
.url-input-group .form-input { flex: 1; }
.url-hint { font-size: 12px; color: #aaa; margin-top: 6px; }

/* File info */
.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #e8f0fe;
    border-radius: 10px;
    margin-bottom: 16px;
}
.file-name { font-weight: 600; flex: 1; }
.file-size { color: #888; font-size: 13px; }

/* Progress */
.progress-container { margin-top: 24px; }
.progress-bar-wrapper {
    height: 8px;
    background: #e4e6eb;
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #1967d2, #4285f4);
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}
.progress-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 14px;
}
.progress-percent { font-weight: 700; color: #1967d2; }
.progress-message { color: #888; }

/* Progress stages */
.progress-stages {
    display: flex;
    gap: 4px;
    margin-top: 16px;
}
.stage {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    font-size: 11px;
    font-weight: 600;
    color: #aaa;
    background: #f0f2f5;
    border-radius: 8px;
    transition: all 0.3s;
}
.stage.active { background: #e8f0fe; color: #1967d2; }
.stage.completed { background: #e8f5e9; color: #2e7d32; }

/* Result */
.result-container { margin-top: 24px; text-align: center; }
.result-success h3 { font-size: 20px; margin-bottom: 16px; color: #2e7d32; }
.result-success .btn { margin: 0 8px; }


.result-docs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
}

.result-nav {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.btn-outline {
    background: transparent;
    border: 2px solid #3b82f6;
    color: #3b82f6;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.btn-outline:hover {
    background: #3b82f6;
    color: white;
}

/* Error container */
.error-container { margin-top: 24px; }

/* Drop overlay (global drag-and-drop) */
.drop-overlay {
    position: fixed;
    inset: 0;
    background: rgba(25, 103, 210, 0.15);
    backdrop-filter: blur(2px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}
.drop-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}
.drop-overlay-content {
    background: #fff;
    border: 3px dashed #1967d2;
    border-radius: 24px;
    padding: 60px 80px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(25, 103, 210, 0.25);
    pointer-events: none;
}
.drop-overlay-content .drop-icon {
    font-size: 64px;
    margin-bottom: 16px;
    display: block;
}
.drop-overlay-content p {
    font-size: 22px;
    font-weight: 700;
    color: #1967d2;
}

/* Responsive */
@media (max-width: 768px) {
    /* Hide "Файл" (col 3) and "Длительность" (col 7) on mobile (ID added as col 1) */
    .reports-table th:nth-child(3),
    .reports-table td:nth-child(3),
    .reports-table th:nth-child(7),
    .reports-table td:nth-child(7) { display: none; }
}

@media (max-width: 640px) {
    .container { padding: 16px 12px; }
    .login-card { padding: 24px; }
    .page-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .reports-table { font-size: 13px; min-width: 0; }
    .reports-table th, .reports-table td { padding: 10px 12px; }
    .reports-table-wrapper { border-radius: 10px; }
    .url-input-group { flex-direction: column; }
    .progress-stages { flex-wrap: wrap; }
    .stage { flex: unset; width: calc(33% - 4px); }
}

@media print {
    .navbar, .btn, .delete-btn { display: none; }
}

/* Dashboard utility styles */
.client-unknown { color: #a0aec0; font-style: italic; font-size: 13px; }
.text-muted { color: #a0aec0; font-size: 13px; }
.docs-cell { white-space: nowrap; }
.docs-cell .btn { margin-right: 4px; }
.docs-group { display: flex; gap: 4px; flex-wrap: wrap; }
.docs-group .btn { padding: 3px 8px; font-size: 11px; white-space: nowrap; }
.status-done { background: #e8f5e9; color: #2e7d32; }

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    border-top: 4px solid #9e9e9e;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.stat-card.stat-done   { border-top-color: #34a853; }
.stat-card.stat-processing { border-top-color: #1967d2; }
.stat-card.stat-error  { border-top-color: #ea4335; }
.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #202124;
    line-height: 1;
}
.stat-label {
    font-size: 13px;
    color: #5f6368;
    margin-top: 6px;
}
@media (max-width: 640px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =============================================
   Dashboard Controls — Search + Filter Pills
   ============================================= */
.dashboard-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.search-bar {
    position: relative;
}
.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 12px center;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    color: #2d3748;
}
.search-bar input::placeholder { color: #a0aec0; }
.search-bar input:focus {
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.12);
}

/* Filter pills row */
.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.filter-pill {
    padding: 5px 13px;
    border-radius: 20px;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    color: #718096;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.filter-pill:hover {
    border-color: #4299e1;
    color: #2b6cb0;
    background: #ebf8ff;
}
.filter-pill.active {
    background: #4299e1;
    border-color: #4299e1;
    color: #fff;
}
/* Type-specific accent colors when active */
.filter-pill[data-type="sales"].active          { background: #48bb78; border-color: #48bb78; }
.filter-pill[data-type="it_consultation"].active { background: #4299e1; border-color: #4299e1; }
.filter-pill[data-type="contractor_eval"].active { background: #9f7aea; border-color: #9f7aea; }
.filter-pill[data-type="hr_interview"].active    { background: #ed64a6; border-color: #ed64a6; }
.filter-pill[data-type="tech_support"].active    { background: #ed8936; border-color: #ed8936; }
.filter-pill[data-type="consultation"].active    { background: #38b2ac; border-color: #38b2ac; }
.filter-pill[data-type="onboarding"].active      { background: #00b5d8; border-color: #00b5d8; }
.filter-pill[data-type="general_meeting"].active { background: #a0aec0; border-color: #a0aec0; }
.filter-pill[data-type="first_meeting"].active   { background: #1565C0; border-color: #1565C0; }

/* No-results row */
.no-results-msg {
    text-align: center;
    padding: 40px 16px;
    color: #a0aec0;
    font-size: 14px;
    font-style: italic;
}

/* Responsive: stack controls on mobile */
@media (max-width: 640px) {
    .dashboard-controls { gap: 8px; }
    .filter-pills { gap: 4px; }
    .filter-pill { font-size: 11px; padding: 4px 10px; }
}

/* Notes icon in dashboard */
.notes-icon { cursor: help; margin-left: 4px; font-size: 14px; }

/* Notes section on upload page */
.notes-section { margin: 16px 0; }
.notes-section label { display: block; font-weight: 600; margin-bottom: 6px; color: #333; }
.notes-section textarea { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; resize: vertical; font-family: inherit; }
.notes-section textarea:focus { border-color: #4a90d9; outline: none; box-shadow: 0 0 0 2px rgba(74,144,217,0.2); }

/* ============================================================
   PROMO STYLES
   ============================================================ */

/* --- Header --- */
.promo-header {
    background: #fff;
    border-bottom: 1px solid #e4e6eb;
    padding: 20px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.promo-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.3px;
}

/* --- Toolbar --- */
.promo-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: #f8f9fb;
    border-bottom: 1px solid #e4e6eb;
    flex-wrap: wrap;
}
.promo-toolbar .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, box-shadow 0.15s;
    text-decoration: none;
}
.promo-toolbar .btn-primary {
    background: #4a90d9;
    color: #fff;
    border-color: #4a90d9;
}
.promo-toolbar .btn-primary:hover { background: #357abd; border-color: #357abd; box-shadow: 0 2px 6px rgba(74,144,217,0.3); }
.promo-toolbar .btn-secondary {
    background: #fff;
    color: #444;
    border-color: #d1d5db;
}
.promo-toolbar .btn-secondary:hover { background: #f3f4f6; }

/* --- Filters --- */
.promo-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    background: #fff;
    border-bottom: 1px solid #e4e6eb;
    flex-wrap: wrap;
}
.promo-filters label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    white-space: nowrap;
}
.promo-filters select,
.promo-filters input[type="text"],
.promo-filters input[type="date"],
.promo-filters input[type="search"] {
    padding: 7px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    color: #1a1a2e;
    background: #f8f9fb;
    transition: border-color 0.15s, box-shadow 0.15s;
    min-width: 120px;
}
.promo-filters select:focus,
.promo-filters input:focus {
    border-color: #4a90d9;
    outline: none;
    box-shadow: 0 0 0 2px rgba(74,144,217,0.18);
    background: #fff;
}
.promo-filters .filter-reset {
    font-size: 12px;
    color: #888;
    cursor: pointer;
    text-decoration: underline;
    margin-left: auto;
}
.promo-filters .filter-reset:hover { color: #e53e3e; }

/* --- Table --- */
.promo-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    font-size: 14px;
}
.promo-table thead tr {
    background: #f8f9fb;
    border-bottom: 2px solid #e4e6eb;
}
.promo-table th {
    padding: 11px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    user-select: none;
    cursor: pointer;
}
.promo-table th:hover { color: #4a90d9; }
.promo-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f2f5;
    color: #333;
    vertical-align: middle;
}
.promo-table tbody tr:hover { background: #f8f9fb; }
.promo-table tbody tr:last-child td { border-bottom: none; }

/* --- Type Badge --- */
.promo-type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
}
.promo-type-badge.license    { background: #dbeafe; color: #1d4ed8; }
.promo-type-badge.marketplace { background: #ede9fe; color: #6d28d9; }
.promo-type-badge.service    { background: #d1fae5; color: #065f46; }
.promo-type-badge.support    { background: #fef3c7; color: #92400e; }
.promo-type-badge.package    { background: #fce7f3; color: #9d174d; }

/* --- Status --- */
.promo-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.promo-status::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.promo-status.active  { background: #d1fae5; color: #065f46; }
.promo-status.active::before  { background: #10b981; animation: promo-pulse 1.8s ease-in-out infinite; }
.promo-status.pending { background: #fef9c3; color: #854d0e; }
.promo-status.pending::before { background: #f59e0b; }
.promo-status.expired { background: #fee2e2; color: #991b1b; }
.promo-status.expired::before { background: #ef4444; }
.promo-status.archived { background: #f3f4f6; color: #6b7280; }
.promo-status.archived::before { background: #9ca3af; }

@keyframes promo-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(1.35); }
}

/* --- Discount --- */
.promo-discount {
    display: inline-block;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #e53e3e;
    background: #fff5f5;
    border: 1px solid #fed7d7;
}
.promo-discount.zero { color: #9ca3af; background: #f9fafb; border-color: #e5e7eb; }

/* --- Actions --- */
.promo-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.promo-actions .action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid #e4e6eb;
    background: #fff;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-decoration: none;
}
.promo-actions .action-btn:hover { background: #f0f2f5; color: #1a1a2e; border-color: #c8ccd4; }
.promo-actions .action-btn.danger:hover { background: #fff5f5; color: #e53e3e; border-color: #fed7d7; }

/* --- Alert --- */
.promo-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.promo-alert .alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.promo-alert.info    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.promo-alert.success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.promo-alert.warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.promo-alert.error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* --- Stats --- */
.promo-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    padding: 20px 28px;
}
.promo-stat-card {
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.promo-stat-card .stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.promo-stat-card .stat-value {
    font-size: 26px;
    font-weight: 800;
    color: #1a1a2e;
    letter-spacing: -0.5px;
    line-height: 1.1;
}
.promo-stat-card .stat-sub {
    font-size: 12px;
    color: #aaa;
}
.promo-stat-card.highlight { border-color: #bfdbfe; background: #eff6ff; }
.promo-stat-card.highlight .stat-value { color: #1d4ed8; }

/* --- Modal --- */
.promo-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: promo-fade-in 0.15s ease;
}
.promo-modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    animation: promo-slide-up 0.2s ease;
}
.promo-modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e4e6eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.promo-modal-header h2 { font-size: 17px; font-weight: 700; color: #1a1a2e; }
.promo-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #f0f2f5;
    color: #666;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.promo-modal-close:hover { background: #e4e6eb; }
.promo-modal-body { padding: 20px 24px; }
.promo-modal-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid #e4e6eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
@keyframes promo-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes promo-slide-up { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* --- Form --- */
.promo-form .form-group {
    margin-bottom: 16px;
}
.promo-form .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 6px;
}
.promo-form .form-group label .required { color: #e53e3e; margin-left: 2px; }
.promo-form input[type="text"],
.promo-form input[type="number"],
.promo-form input[type="date"],
.promo-form input[type="email"],
.promo-form textarea,
.promo-form select {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a2e;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
.promo-form input:focus,
.promo-form textarea:focus,
.promo-form select:focus {
    border-color: #4a90d9;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74,144,217,0.18);
}
.promo-form textarea { resize: vertical; min-height: 80px; }
.promo-form .form-hint { font-size: 12px; color: #9ca3af; margin-top: 4px; }
.promo-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.promo-form .form-error {
    font-size: 12px;
    color: #e53e3e;
    margin-top: 4px;
    display: none;
}
.promo-form .has-error input,
.promo-form .has-error select,
.promo-form .has-error textarea {
    border-color: #fca5a5;
    background: #fff5f5;
}
.promo-form .has-error .form-error { display: block; }

/* --- Multi-Select Container --- */
.ms-container {
    position: relative;
}
.ms-container .ms-toggle {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a2e;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.ms-container .ms-toggle:focus,
.ms-container.open .ms-toggle {
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74,144,217,0.18);
    outline: none;
}
.ms-container .ms-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e4e6eb;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
    z-index: 400;
    max-height: 220px;
    overflow-y: auto;
    animation: promo-fade-in 0.12s ease;
}
.ms-container .ms-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background 0.1s;
}
.ms-container .ms-option:hover { background: #f0f6ff; }
.ms-container .ms-option input[type="checkbox"] { accent-color: #4a90d9; width: 15px; height: 15px; }
.ms-container .ms-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    font-size: 12px;
    color: #1d4ed8;
    font-weight: 600;
}
.ms-container .ms-tag .ms-tag-remove {
    cursor: pointer;
    color: #93c5fd;
    font-size: 13px;
    line-height: 1;
    transition: color 0.1s;
}
.ms-container .ms-tag .ms-tag-remove:hover { color: #e53e3e; }

/* --- Toast --- */
.promo-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.promo-toast-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.14);
    pointer-events: all;
    animation: promo-toast-in 0.25s ease;
    min-width: 240px;
    max-width: 380px;
    border: 1px solid transparent;
}
.promo-toast-item.success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.promo-toast-item.error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.promo-toast-item.info    { background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8; }
.promo-toast-item.warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.promo-toast-item .toast-icon { font-size: 18px; flex-shrink: 0; }
.promo-toast-item .toast-close {
    margin-left: auto;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
    font-size: 16px;
    flex-shrink: 0;
    transition: opacity 0.1s;
}
.promo-toast-item .toast-close:hover { opacity: 1; }
@keyframes promo-toast-in {
    from { transform: translateX(30px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* --- Responsive promo layout --- */
@media (max-width: 768px) {
    .promo-header  { padding: 14px 16px; }
    .promo-toolbar { padding: 10px 16px; }
    .promo-filters { padding: 10px 16px; }
    .promo-stats   { padding: 14px 16px; grid-template-columns: repeat(2, 1fr); }
    .promo-form .form-row { grid-template-columns: 1fr; }
    .promo-modal   { max-width: 100%; border-radius: 10px; }
    .promo-toast   { bottom: 16px; right: 16px; left: 16px; }
    .promo-toast-item { max-width: 100%; }
}
.notes-hint { color: #888; font-size: 12px; margin-top: 4px; display: block; }
