:root {
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --secondary: #6c757d;
    --success: #198754;
    --danger: #dc3545;
    --warning: #ffc107;
    --dark: #212529;
    --light: #f8f9fa;
    --gray: #dee2e6;
    --bg-gradient: linear-gradient(135deg, #1a1c2e 0%, #16213e 50%, #0f3460 100%);
    --card-bg: rgba(255,255,255,0.95);
    --shadow: 0 10px 40px rgba(0,0,0,0.2);
}

* { margin:0; padding:0; box-sizing:border-box; }
body{
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--dark);
}

.login-container{
    display:flex; justify-content:center; align-items:center;
    min-height: 100vh; padding: 1rem;
}
.login-card{
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem; width: 100%; max-width: 400px;
    box-shadow: var(--shadow);
    animation: fadeUp 0.5s ease-out;
}
@keyframes fadeUp{
    from { opacity:0; transform: translateY(20px); }
    to { opacity:1; transform: translateY(0); }
}
.login-card .logo{
    font-size: 4rem; text-align:center; margin-bottom:0.3rem;
}
.login-card h1{
    text-align:center; font-size:1.8rem; color: var(--dark); margin-bottom:0.2rem;
}
.login-card h1 span{ color: var(--primary); }
.login-card .subtitle{
    text-align:center; color: var(--secondary); font-size:0.95rem; margin-bottom:1.5rem;
}

.form-group{
    margin-bottom:1rem;
}
.form-group label{
    display:block; font-size:0.85rem; font-weight:600; margin-bottom:0.35rem; color: var(--secondary);
}
.form-group input{
    width:100%; padding:0.75rem 1rem; border: 2px solid var(--gray); border-radius:10px;
    font-size:1rem; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus{
    outline:none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(13,110,253,0.15);
}
.form-group select{
    width:100%; padding:0.75rem 1rem; border: 2px solid var(--gray); border-radius:10px;
    font-size:1rem; background:#fff; cursor:pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group select:focus{
    outline:none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(13,110,253,0.15);
}
code{
    background:#e9ecef; padding:0.15rem 0.4rem; border-radius:4px;
    font-family: monospace; font-size:0.85rem; color:#495057;
}

.btn-primary{
    width:100%; background: var(--primary); color:#fff; border:none;
    padding:0.85rem; border-radius:10px; font-size:1rem; font-weight:600; cursor:pointer;
    display:flex; justify-content:center; align-items:center; gap:0.5rem;
    transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover{ background: var(--primary-dark); }
.btn-primary:active{ transform: scale(0.98); }
.btn-primary:disabled{ opacity:0.6; cursor:not-allowed; }

.btn-success{
    background: var(--success); color:#fff; border:none;
    padding:0.5rem 1rem; border-radius:8px; font-weight:500; cursor:pointer; display:inline-flex; gap:0.35rem; align-items:center;
}
.btn-success:hover{ background: #157347; }

.btn-danger{
    background: var(--danger); color:#fff; border:none;
    padding:0.5rem 1rem; border-radius:8px; font-weight:500; cursor:pointer; display:inline-flex; gap:0.35rem; align-items:center;
}
.btn-danger:hover{ background: #bb2d3b; }

.btn-secondary{
    background: var(--secondary); color:#fff; border:none;
    padding:0.5rem 1rem; border-radius:8px; font-weight:500; cursor:pointer;
}
.btn-secondary:hover{ background: #5c636a; }

.btn-sm{ padding:0.35rem 0.7rem; font-size:0.85rem; }

.error-msg{
    color: var(--danger); font-size:0.9rem; text-align:center; margin-top:0.75rem; min-height:1.2rem;
}

.spinner{
    display:inline-block; width:18px; height:18px; border: 2px solid rgba(255,255,255,0.3); border-top-color:#fff; border-radius:50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin{ to{ transform: rotate(360deg); } }

/* Dashboard */
.dashboard-layout{
    display:flex; min-height:100vh;
}
.sidebar{
    width:260px; background:#111827; color:#fff;
    display:flex; flex-direction:column; position:fixed; height:100vh; z-index:100;
    transition: transform 0.3s;
}
.sidebar-header{
    padding:1.5rem; display:flex; align-items:center; gap:0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-header h2{ font-size:1.3rem; }
.sidebar-header h2 span{ color: var(--primary); }
.sidebar-nav{ padding:1rem 0; flex:1; overflow-y:auto; }
.nav-item{
    display:flex; align-items:center; gap:0.6rem;
    padding:0.75rem 1.5rem; color:#9ca3af; cursor:pointer;
    text-decoration:none; font-size:0.95rem; border-left:3px solid transparent;
    transition: all 0.2s;
}
.nav-item:hover, .nav-item.active{
    color:#fff; background:rgba(255,255,255,0.05); border-left-color: var(--primary);
}
.nav-icon{ width:22px; text-align:center; font-size:1.1rem; }
.sidebar-footer{
    padding:1rem 1.5rem; border-top:1px solid rgba(255,255,255,0.1); font-size:0.85rem; color:#9ca3af;
}
.main-content{
    flex:1; margin-left:260px; padding:2rem; background: #f3f4f6; min-height:100vh;
}
.content-header{
    display:flex; justify-content:space-between; align-items:center; margin-bottom:2rem;
}
.content-header h1{ font-size:1.6rem; color: var(--dark); }

.panel{
    background:#fff; border-radius:14px; padding:1.5rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05); margin-bottom:1.5rem;
}

.table-responsive{ overflow-x:auto; }
table{
    width:100%; border-collapse:collapse; font-size:0.9rem;
}
th, td{ padding:0.8rem 1rem; text-align:left; }
thead{ border-bottom: 2px solid var(--gray); }
tbody tr{ border-bottom: 1px solid var(--gray); transition: background 0.1s; }
tbody tr:hover{ background: rgba(13,110,253,0.03); }
th{ font-weight:600; color: var(--secondary); font-size:0.8rem; text-transform:uppercase; letter-spacing:0.03em; }

.badge-admin{ background:#0d6efd; color:#fff; padding:0.15rem 0.5rem; border-radius:20px; font-size:0.7rem; font-weight:600; }
.badge-user{ background: var(--secondary); color:#fff; padding:0.15rem 0.5rem; border-radius:20px; font-size:0.7rem; }

.status-pending{ color: var(--warning); font-weight:600; }
.status-processing{ color: var(--primary); font-weight:600; }
.status-completed{ color: var(--success); font-weight:600; }
.status-failed{ color: var(--danger); font-weight:600; }

.empty-state{
    text-align:center; padding:3rem; color: var(--secondary);
}
.empty-state .emoji{ font-size:3rem; margin-bottom:0.5rem; display:block; }

/* Modal */
.modal-overlay{
    position:fixed; inset:0; background: rgba(0,0,0,0.5); display:flex; justify-content:center; align-items:center; z-index:200;
}
.modal-content{
    background:#fff; border-radius:14px; width:100%; max-width:500px; padding:1.5rem;
    box-shadow: var(--shadow); max-height:90vh; overflow-y:auto;
}
.modal-header{
    display:flex; justify-content:space-between; align-items:center; margin-bottom:1rem;
}
.modal-header h2{ font-size:1.2rem; }
.modal-close{ background:none; border:none; font-size:1.5rem; color: var(--secondary); cursor:pointer; padding:0.25rem; }
.modal-close:hover{ color: var(--danger); }

.form-row{ margin-bottom:0.75rem; }
.modal-actions{ display:flex; gap:0.5rem; justify-content:flex-end; margin-top:1rem; }

/* Audio player in detail */
.audio-player{ width:100%; margin:1rem 0; }
.transcript-box{
    background: var(--light); border: 1px solid var(--gray); border-radius:8px;
    padding:1rem; min-height:100px; max-height:300px; overflow-y:auto;
    white-space: pre-wrap; font-family: system-ui, sans-serif; line-height:1.6;
}
.transcript-actions{ display:flex; gap:0.5rem; margin:0.5rem 0; flex-wrap:wrap; }

/* Upload area */
.upload-area{
    border: 2px dashed var(--primary); border-radius:14px; padding:2rem;
    text-align:center; cursor:pointer; transition: all 0.2s; background: rgba(13,110,253,0.02);
}
.upload-area:hover{ background: rgba(13,110,253,0.05); border-color: var(--primary-dark); }

/* Responsive */
@media (max-width: 768px){
    .sidebar{ transform: translateX(-100%); }
    .sidebar.open{ transform: translateX(0); }
    .main-content{ margin-left:0; padding:1rem; }
    .content-header{ flex-direction:column; align-items:flex-start; gap:0.5rem; }
}

/* Toast */
.toast-container{
    position:fixed; top:1rem; right:1rem; z-index:300; display:flex; flex-direction:column; gap:0.5rem;
}
.toast{
    background:#fff; border-left:4px solid var(--success); padding:0.75rem 1rem;
    border-radius:8px; box-shadow: 0 4px 16px rgba(0,0,0,0.1); min-width:250px;
    animation: toastIn 0.3s ease-out;
}
.toast.error{ border-left-color: var(--danger); }
.toast.warning{ border-left-color: var(--warning); }
@keyframes toastIn{
    from { opacity:0; transform: translateX(20px); }
    to { opacity:1; transform: translateX(0); }
}
.toast-exit{
    animation: toastOut 0.3s ease-in forwards;
}
@keyframes toastOut{
    from { opacity:1; transform: translateX(0); }
    to { opacity:0; transform: translateX(20px); }
}

/* === Tier System Styles === */
.tier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 0;
}

.tier-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 16px rgba(0,0,0,0.06);
    border: 2px solid #e5e7eb;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tier-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.tier-card.tier-1 { border-left: 4px solid #6b7280; }
.tier-card.tier-2 { border-left: 4px solid #3b82f6; }
.tier-card.tier-3 { border-left: 4px solid #f59e0b; }

.tier-panel {
    max-width: 900px;
    margin: 0 auto;
}

.tier-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-box {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.stat-label {
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.stat-sub {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

progress {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    margin-top: 0.5rem;
    overflow: hidden;
}

progress::-webkit-progress-bar {
    background: #e2e8f0;
    border-radius: 4px;
}

progress::-webkit-progress-value {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 4px;
    transition: width 0.3s;
}

progress::-moz-progress-bar {
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 4px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: #e0e7ff;
    color: #4338ca;
}

.badge-tier-1 { background: #f3f4f6; color: #4b5563; }
.badge-tier-2 { background: #dbeafe; color: #1e40af; }
.badge-tier-3 { background: #fef3c7; color: #92400e; }

.tier-info-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.tier-info-row:last-child {
    border-bottom: none;
}

.tier-info-label {
    font-weight: 600;
    color: #475569;
}

.tier-info-value {
    color: #64748b;
}

.tier-users-list {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.tier-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 0.85rem;
    margin: 0.25rem;
}

/* Tier select in users table */
.tier-select {
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #d1d5db;
    font-size: 0.85rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}
.tier-select:hover {
    border-color: #3b82f6;
}
.tier-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.tier-select:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Tier info в sidebar */
#userTierInfo {
    display: block !important;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    font-size: 0.75rem;
    min-height: 2.5rem;
}

#userTierInfo:empty::after {
    content: '⏳ Зареждам tier...';
    color: #9ca3af;
    font-style: italic;
}

#userTierInfo div:first-child {
    font-weight: 600;
    color: #fbbf24;
    margin-bottom: 0.25rem;
}

.sidebar-footer {
    min-height: 100px; /* За да има място за tier info */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* ========== MOBILE RESPONSIVE STYLES ========== */

/* Mobile Header */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #111827;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 90;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.hamburger-btn {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    width: 40px;
    height: 40px;
    justify-content: center;
    align-items: center;
}

.hamburger-btn span {
    display: block;
    width: 22px;
    height: 2.5px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s;
}

.hamburger-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

.mobile-logo {
    font-size: 1.1rem;
    font-weight: 600;
}

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

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

/* ===== RESPONSIVE BREAKPOINTS ===== */

@media (max-width: 768px) {
    /* Show mobile header */
    .mobile-header {
        display: flex;
    }

    /* Sidebar becomes slide-out drawer — 75% от екрана */
    .sidebar {
        width: min(75vw, 240px);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 100;
        box-shadow: 2px 0 20px rgba(0,0,0,0.4);
    }

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

    /* Sidebar overlay must be full screen and block clicks */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.6);
        z-index: 99;
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
    }
    .sidebar-overlay.active {
        display: block;
    }

    /* Main content full width, no margin */
    .main-content {
        margin-left: 0;
        padding: 0.75rem;
        padding-top: 0;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .content-header h1 {
        font-size: 1.25rem;
    }

    /* Panels less padding */
    .panel {
        padding: 1rem;
        margin-bottom: 1rem;
        border-radius: 10px;
    }

    /* Tables: horizontal scroll with snap */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .table-responsive::-webkit-scrollbar {
        height: 6px;
    }

    .table-responsive::-webkit-scrollbar-thumb {
        background: #c1c1c1;
        border-radius: 3px;
    }

    table {
        min-width: 600px;
        font-size: 0.85rem;
    }

    th, td {
        padding: 0.6rem 0.75rem;
        white-space: nowrap;
    }

    /* Action buttons: stack or smaller */
    td .btn-sm {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }

    /* Upload area */
    .upload-area {
        padding: 1.5rem 1rem;
    }

    .upload-area p:first-of-type {
        font-size: 1.5rem !important;
    }

    /* Modals: full screen on small phones */
    .modal-content {
        max-width: 95vw;
        padding: 1rem;
        border-radius: 12px;
        max-height: 85vh;
    }

    .modal-header h2 {
        font-size: 1.1rem;
    }

    /* Forms in modals */
    .form-row {
        margin-bottom: 0.6rem;
    }

    .form-row input,
    .form-row select {
        padding: 0.6rem;
        font-size: 16px; /* Prevent iOS zoom */
    }

    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-actions button {
        width: 100%;
        justify-content: center;
    }

    /* Toast: wider on mobile */
    .toast-container {
        left: 0.5rem;
        right: 0.5rem;
        top: 0.5rem;
    }

    .toast {
        min-width: unset;
        width: 100%;
    }

    /* Tier cards */
    .tier-card {
        padding: 1rem;
    }

    .tier-stats {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-box {
        padding: 1rem;
    }

    /* Empty state */
    .empty-state {
        padding: 2rem 1rem;
    }

    .empty-state .emoji {
        font-size: 2.5rem;
    }

    /* Login page */
    .login-card {
        padding: 1.5rem;
        margin: 0.5rem;
        border-radius: 16px;
    }

    .login-card .logo {
        font-size: 3rem;
    }

    .login-card h1 {
        font-size: 1.5rem;
    }

    /* Transcript box */
    .transcript-box {
        padding: 0.75rem;
        font-size: 0.9rem;
        min-height: 80px;
    }

    .transcript-actions {
        flex-wrap: wrap;
        gap: 0.4rem;
    }

    .transcript-actions button {
        flex: 1;
        min-width: 120px;
        justify-content: center;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .content-header h1 {
        font-size: 1.1rem;
    }

    /* Stats cards — compact 2-column grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    .stat-card {
        padding: 0.75rem;
        border-radius: 10px;
    }
    .stat-value {
        font-size: 1.35rem !important;
    }
    .stat-label {
        font-size: 0.7rem !important;
    }
    progress {
        height: 6px;
    }

    /* Cards view instead of table */
    .table-responsive {
        display: none;
    }
    
    .mobile-card-list {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .mobile-card {
        background: #fff;
        border-radius: 12px;
        padding: 1rem;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
        border: 1px solid #e5e7eb;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .mobile-card-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .mobile-card-title {
        font-weight: 600;
        font-size: 0.95rem;
        color: #1f2937;
        word-break: break-word;
        flex: 1;
    }
    
    .mobile-card-meta {
        display: flex;
        gap: 0.5rem;
        align-items: center;
        font-size: 0.8rem;
        color: #6b7280;
        flex-wrap: wrap;
    }
    
    .mobile-card-status {
        font-weight: 600;
        font-size: 0.8rem;
    }
    
    .mobile-card-actions {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid #f3f4f6;
    }
    
    .mobile-card-actions button {
        flex: 1 1 calc(50% - 0.25rem);
        min-height: 44px;
        font-size: 0.85rem;
        justify-content: center;
    }

    .btn-sm {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
        min-height: 44px;
    }

    .panel {
        padding: 0.75rem;
    }

    .upload-area {
        padding: 1.25rem 0.75rem;
        min-height: 140px;
    }

    .modal-content {
        max-width: 98vw;
        max-height: 92vh;
        padding: 0.875rem;
    }

    .tier-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Touch improvements */
    button, .nav-item, .form-group input, .form-group select {
        min-height: 44px;
    }
    
    audio::-webkit-media-controls-panel {
        min-height: 44px;
    }
}

/* Show table on desktop */
.mobile-card-list {
    display: none;
}

/* Landscape phones: slightly more room */
@media (max-width: 768px) and (orientation: landscape) {
    .sidebar {
        width: 240px;
    }

    .modal-content {
        max-height: 80vh;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .nav-item {
        padding: 0.85rem 1.5rem;
    }

    .btn-primary,
    .btn-success,
    .btn-danger,
    .btn-secondary {
        min-height: 44px;
    }

    .form-group input,
    .form-group select {
        min-height: 44px;
    }

    .upload-area {
        min-height: 120px;
    }

    .modal-close {
        min-width: 44px;
        min-height: 44px;
    }
}

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

.stat-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

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

.stat-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(13,110,253,0.1);
}

.stat-icon-blue { background: rgba(13,110,253,0.1); }
.stat-icon-green { background: rgba(25,135,84,0.1); }
.stat-icon-purple { background: rgba(111,66,193,0.1); }
.stat-icon-orange { background: rgba(255,152,0,0.1); }
.stat-icon-red { background: rgba(220,53,69,0.1); }

.stat-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
}

.stat-subtext {
    font-size: 0.8rem;
    color: #9ca3af;
}

/* ===== Progress Bars ===== */
.progress-container {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-fill.blue { background: var(--primary); }
.progress-fill.green { background: var(--success); }
.progress-fill.purple { background: #6f42c1; }
.progress-fill.orange { background: #ff9800; }

/* ===== Modern Upload Area ===== */
.upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    background: #fafbfc;
}

.upload-area:hover {
    border-color: var(--primary);
    background: rgba(13,110,253,0.02);
}

.upload-area.dragover {
    border-color: var(--primary);
    background: rgba(13,110,253,0.05);
}

.upload-area-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.upload-area-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.25rem;
}

.upload-area-subtitle {
    font-size: 0.85rem;
    color: #9ca3af;
}

/* ===== Recent Activity ===== */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
    border-radius: 8px;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.activity-item:hover {
    background: rgba(13,110,253,0.02);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(13,110,253,0.1);
    flex-shrink: 0;
    font-size: 1.1rem;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--dark);
}

.activity-time {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.15rem;
}

/* ===== Quick Action Buttons ===== */
.quick-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    background: #fff;
    color: var(--dark);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    text-decoration: none;
}

.quick-action-btn:hover {
    border-color: var(--primary);
    background: rgba(13,110,253,0.03);
    transform: translateY(-1px);
}

.quick-action-btn.primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.quick-action-btn.primary:hover {
    background: var(--primary-dark);
}

/* ===== Tiers Grid ===== */
.tier-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.tier-card {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tier-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.tier-card.tier-1 { border-top: 4px solid #6c757d; }
.tier-card.tier-2 { border-top: 4px solid var(--primary); }
.tier-card.tier-3 { border-top: 4px solid var(--success); }

/* ===== Sidebar overlay ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
}

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

/* ===== Responsive dashboard ===== */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    .stat-card {
        padding: 0.875rem;
    }
    .stat-value {
        font-size: 1.25rem;
    }
    .quick-actions {
        gap: 0.5rem;
    }
    .quick-action-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.85rem;
    }
}

/* ===== Action Buttons (Table) ===== */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s;
    background: #f8f9fa;
    color: #495057;
    padding: 0;
}

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

.action-details:hover { background: #e7f1ff; color: #0d6efd; }
.action-transcript:hover { background: #d1f2eb; color: #198754; }
.action-bonus:hover { background: #fef3c7; color: #d97706; }
.action-remove-bonus:hover { background: #fee2e2; color: #dc2626; }
.action-add-bonus:hover { background: #ede9fe; color: #7c3aed; }
.action-download:hover { background: #e0f2fe; color: #0288d1; }
.action-delete:hover { background: #fee2e2; color: #dc2626; }

@media (max-width: 768px) {
    .btn-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

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