/* =============================================================================
   Instagram Reels Downloader - Modern Dashboard Styles
   Fully Responsive for Mobile & Desktop
   ============================================================================= */

:root {
    --primary: #e1306c;
    --primary-dark: #c13584;
    --primary-light: rgba(225, 48, 108, 0.15);
    --secondary: #405de6;
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.15);
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.15);
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.15);
    --dark: #0f172a;
    --darker: #020617;
    --card-bg: #1e293b;
    --card-hover: #334155;
    --light: #f8fafc;
    --gray: #94a3b8;
    --gray-dark: #64748b;
    --border: #334155;
    --border-light: #475569;
    --sidebar-width: 240px;
    --sidebar-collapsed: 70px;
    --gradient-pink: linear-gradient(135deg, #ec4899, #f43f5e);
    --gradient-purple: linear-gradient(135deg, #8b5cf6, #a855f7);
    --gradient-blue: linear-gradient(135deg, #3b82f6, #6366f1);
    --gradient-green: linear-gradient(135deg, #10b981, #14b8a6);
    --gradient-gray: linear-gradient(135deg, #64748b, #475569);
}

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

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dark);
    color: var(--light);
    min-height: 100vh;
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

/* =============================================================================
   Sidebar - Desktop & Mobile
   ============================================================================= */

.sidebar {
    width: var(--sidebar-width);
    background: var(--darker);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 20px 0;
    border-right: 1px solid var(--border);
    z-index: 1000;
    transition: transform 0.3s ease, width 0.3s ease;
    display: flex;
    flex-direction: column;
}

.logo {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.logo h2 {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.nav-links {
    list-style: none;
    flex: 1;
}

.nav-links li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: var(--gray);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    gap: 12px;
}

.nav-links li a:hover,
.nav-links li.active a {
    background: var(--primary-light);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-links .icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* =============================================================================
   Main Content
   ============================================================================= */

.content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 20px;
    transition: margin-left 0.3s ease;
}

header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.main-content {
    max-width: 1400px;
    margin: 0 auto;
}

/* =============================================================================
   Status Banner
   ============================================================================= */

.status-banner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
}

.status-banner.status-success {
    background: var(--success-light);
    border-color: var(--success);
}

.status-banner.status-error {
    background: var(--danger-light);
    border-color: var(--danger);
}

.status-banner.status-warning {
    background: var(--warning-light);
    border-color: var(--warning);
}

.status-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray);
    flex-shrink: 0;
}

.status-indicator.success {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-indicator.error {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

/* =============================================================================
   Stats Grid - Responsive
   ============================================================================= */

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

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.gradient-pink::before { background: var(--gradient-pink); }
.stat-card.gradient-purple::before { background: var(--gradient-purple); }
.stat-card.gradient-blue::before { background: var(--gradient-blue); }
.stat-card.gradient-green::before { background: var(--gradient-green); }
.stat-card.gradient-gray::before { background: var(--gradient-gray); }

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-light);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.stat-card.status-active {
    border-color: var(--success);
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 15px 3px rgba(16, 185, 129, 0.2); }
}

.stat-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.stat-icon {
    font-size: 24px;
}

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

.stat-info h3 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-info p {
    color: var(--gray);
    font-size: 12px;
    font-weight: 500;
}

.stat-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* =============================================================================
   Dashboard Grid Layout - Responsive
   ============================================================================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

.dashboard-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

/* =============================================================================
   Cards
   ============================================================================= */

.card {
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
}

.card-header h2 {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.card-body {
    padding: 18px;
}

/* =============================================================================
   Badges
   ============================================================================= */

.badge {
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    background: var(--card-hover);
    color: var(--gray);
    white-space: nowrap;
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

.badge-gray {
    background: rgba(100, 116, 139, 0.2);
    color: var(--gray);
}

/* =============================================================================
   Progress Card
   ============================================================================= */

.progress-card {
    border-color: var(--success);
}

.progress-card .card-header {
    background: var(--success-light);
}

.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse-animation 1.5s ease-in-out infinite;
}

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

.progress-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.progress-percent {
    font-size: 20px;
    font-weight: 700;
    color: var(--success);
}

.progress-bar-wrapper {
    margin-bottom: 12px;
}

.progress-bar {
    height: 8px;
    background: var(--darker);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-green);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-fill.animated {
    animation: progress-shimmer 2s ease-in-out infinite;
}

@keyframes progress-shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.progress-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 14px;
}

/* =============================================================================
   Scheduler Card - Responsive
   ============================================================================= */

.scheduler-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.scheduler-status {
    display: flex;
    align-items: center;
    gap: 14px;
}

.scheduler-indicator {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(100, 116, 139, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.scheduler-indicator.active {
    background: var(--success-light);
}

.scheduler-indicator .indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--gray);
}

.scheduler-indicator.active .indicator-dot {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse-animation 2s ease-in-out infinite;
}

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

.scheduler-info p {
    font-size: 13px;
    margin-bottom: 2px;
}

.scheduler-next {
    color: var(--gray);
    font-size: 12px !important;
}

.scheduler-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.scheduler-controls form {
    flex: 1;
    min-width: 120px;
}

.time-form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.time-form label {
    font-size: 12px;
    color: var(--gray);
}

.time-input-group {
    display: flex;
    gap: 8px;
}

.time-input {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--darker);
    color: var(--light);
    font-size: 14px;
    flex: 1;
    min-width: 0;
}

.time-input:focus {
    outline: none;
    border-color: var(--primary);
}

.scheduler-actions {
    text-align: center;
}

.scheduler-actions .help-text {
    margin-top: 8px;
}

/* =============================================================================
   Downloads List - Responsive
   ============================================================================= */

.downloads-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.download-item {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--darker);
    border-radius: 10px;
    transition: all 0.2s;
}

.download-item:hover {
    background: var(--card-hover);
}

.download-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 150px;
}

.username-link {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 14px;
    color: var(--light);
}

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

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--gradient-pink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.download-count {
    color: var(--gray);
    font-size: 12px;
    margin-left: auto;
}

.download-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* =============================================================================
   Quick Actions - Responsive Grid
   ============================================================================= */

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 12px;
    background: var(--darker);
    border-radius: 10px;
    color: var(--light);
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
    min-height: 80px;
}

.action-btn:hover {
    background: var(--card-hover);
    color: var(--primary);
    transform: translateY(-2px);
}

.action-icon {
    font-size: 22px;
}

/* =============================================================================
   Telegram Status
   ============================================================================= */

.telegram-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-weight: 500;
    font-size: 14px;
}

.telegram-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.telegram-indicator.enabled {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.telegram-indicator.disabled {
    background: var(--gray);
}

/* =============================================================================
   Info List
   ============================================================================= */

.info-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

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

.info-label {
    color: var(--gray);
    font-size: 12px;
}

.info-value {
    font-weight: 500;
    font-size: 12px;
    text-align: right;
    word-break: break-word;
}

/* =============================================================================
   Buttons - Responsive
   ============================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    background: var(--card-bg);
    color: var(--light);
    border: 1px solid var(--border);
    white-space: nowrap;
}

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

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

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

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
}

.btn-ghost:hover {
    background: var(--card-hover);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-lg {
    padding: 14px 24px;
    font-size: 15px;
}

.btn-full {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 13px;
}

/* =============================================================================
   Forms - Responsive
   ============================================================================= */

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 13px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--darker);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--light);
    font-size: 14px;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-input::placeholder {
    color: var(--gray-dark);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-group input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

.help-text {
    color: var(--gray);
    font-size: 11px;
    margin-top: 4px;
}

.form-actions {
    margin-top: 24px;
}

/* =============================================================================
   Alerts
   ============================================================================= */

.alert {
    padding: 14px 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.alert-success {
    background: var(--success-light);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-warning {
    background: var(--warning-light);
    border: 1px solid var(--warning);
    color: var(--warning);
}

.alert-error {
    background: var(--danger-light);
    border: 1px solid var(--danger);
    color: var(--danger);
}

.alert-info {
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid #3b82f6;
    color: #60a5fa;
}

.close-alert {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    padding: 0 4px;
    flex-shrink: 0;
}

.close-alert:hover {
    opacity: 1;
}

/* =============================================================================
   Log Output
   ============================================================================= */

.log-output {
    background: var(--darker);
    border-radius: 8px;
    padding: 14px;
    max-height: 240px;
    overflow-y: auto;
    font-family: 'JetBrains Mono', 'Monaco', 'Consolas', monospace;
    font-size: 11px;
}

.log-line {
    padding: 5px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
    word-break: break-word;
}

.log-line:last-child {
    margin-bottom: 0;
}

.log-line.log-error {
    background: var(--danger-light);
    color: var(--danger);
}

.log-line.log-success {
    background: var(--success-light);
    color: var(--success);
}

/* =============================================================================
   Tables - Responsive
   ============================================================================= */

.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

.table th,
.table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    font-weight: 600;
    color: var(--gray);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* =============================================================================
   Logs Page - Responsive
   ============================================================================= */

.logs-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
}

.log-list {
    list-style: none;
}

.log-list li {
    border-bottom: 1px solid var(--border);
}

.log-list li:last-child {
    border-bottom: none;
}

.log-list li a {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    color: var(--gray);
    font-size: 13px;
}

.log-list li.active a,
.log-list li a:hover {
    color: var(--primary);
}

.log-viewer {
    background: var(--darker);
    padding: 16px;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    line-height: 1.7;
    white-space: pre-wrap;
    max-height: 500px;
    overflow-y: auto;
    word-break: break-word;
}

/* =============================================================================
   Video Grid - Responsive
   ============================================================================= */

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.video-card {
    background: var(--darker);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.video-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.video-card video {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #000;
}

.video-info {
    padding: 12px;
}

.video-date {
    color: var(--primary);
    font-size: 11px;
    font-weight: 600;
}

.video-name {
    font-size: 12px;
    color: var(--gray);
    margin: 4px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =============================================================================
   Empty State
   ============================================================================= */

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray);
}

.empty-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 12px;
}

.empty-state p {
    margin-bottom: 16px;
    font-size: 14px;
}

/* =============================================================================
   Code Block
   ============================================================================= */

code {
    background: var(--darker);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

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

/* Large Desktop */
@media (min-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Medium Desktop / Small Laptop */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 16px;
    }
}

/* Tablet */
@media (max-width: 900px) {
    :root {
        --sidebar-width: var(--sidebar-collapsed);
    }

    .sidebar {
        width: var(--sidebar-collapsed);
        padding: 16px 0;
    }

    .logo {
        text-align: center;
        padding: 0 8px 16px;
    }

    .logo h2 {
        font-size: 12px;
    }

    .nav-links li a {
        padding: 14px;
        justify-content: center;
    }

    .nav-links li a span:not(.icon) {
        display: none;
    }

    .nav-links .icon {
        margin: 0;
        font-size: 20px;
    }

    .content {
        margin-left: var(--sidebar-collapsed);
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile */
@media (max-width: 600px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        right: 0;
        border-right: none;
        border-top: 1px solid var(--border);
        padding: 0;
        z-index: 1000;
    }

    .logo {
        display: none;
    }

    .nav-links {
        display: flex;
        justify-content: space-around;
        padding: 8px 0;
    }

    .nav-links li {
        flex: 1;
    }

    .nav-links li a {
        flex-direction: column;
        padding: 10px 4px;
        gap: 4px;
        font-size: 10px;
        border-left: none;
        border-top: 2px solid transparent;
    }

    .nav-links li a:hover,
    .nav-links li.active a {
        border-left-color: transparent;
        border-top-color: var(--primary);
    }

    .nav-links li a span:not(.icon) {
        display: block;
    }

    .nav-links .icon {
        font-size: 18px;
    }

    .content {
        margin-left: 0;
        margin-bottom: 70px;
        padding: 14px;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
    }

    header h1 {
        font-size: 20px;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions .btn {
        flex: 1;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
        gap: 10px;
    }

    .stat-icon-wrapper {
        width: 40px;
        height: 40px;
    }

    .stat-icon {
        font-size: 20px;
    }

    .stat-info h3 {
        font-size: 18px;
    }

    .stat-info p {
        font-size: 10px;
    }

    .dashboard-sidebar {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: repeat(4, 1fr);
    }

    .action-btn {
        padding: 12px 8px;
        min-height: auto;
    }

    .action-icon {
        font-size: 20px;
    }

    .action-btn span:last-child {
        font-size: 10px;
    }

    .card-header {
        padding: 12px 14px;
    }

    .card-body {
        padding: 14px;
    }

    .logs-container {
        grid-template-columns: 1fr;
    }

    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .video-card video {
        height: 140px;
    }

    .download-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .download-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Small Mobile */
@media (max-width: 380px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }

    .video-grid {
        grid-template-columns: 1fr;
    }

    .header-actions {
        flex-direction: column;
    }
}

/* =============================================================================
   Scrollbar Styling
   ============================================================================= */

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--darker);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* =============================================================================
   Touch-friendly tap targets
   ============================================================================= */

@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
    }

    .btn-sm {
        min-height: 36px;
    }

    .nav-links li a {
        min-height: 48px;
    }

    .action-btn {
        min-height: 60px;
    }
}
