/* Aura Flow UI Shell - Refined Frosted Obsidian Theme */

:root {
    --bg-main: #0a0a0b;
    --sidebar-w: 240px;
    --topbar-h: 56px;
    
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --sidebar-glass: rgba(18, 18, 20, 0.85);
    --topbar-glass: rgba(12, 12, 14, 0.7);
    
    --accent-blue: #007AFF;
    --accent-glow: rgba(0, 122, 255, 0.5);
    --accent-success: #18D8A9;
    --accent-warning: #F2B24D;
    --accent-error: #FF4D4F;
    
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a5;
    --text-muted: #6a6a70;
    
    --radius-mac: 12px;
    --radius-pill: 20px;
    
    --shadow-mac: 0 10px 40px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 15px rgba(0, 122, 255, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-glass);
    backdrop-filter: blur(40px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px 20px;
}

.traffic-lights {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.light.close { background: #ff5f57; }
.light.minimize { background: #febc2e; }
.light.maximize { background: #28c840; }

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.4px;
}

.logo-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, var(--accent-blue), #5e5ce6);
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.3);
}

.sidebar-nav {
    flex: 1;
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-indicator {
    position: absolute;
    left: -12px;
    top: 20%;
    height: 60%;
    width: 3px;
    background: var(--accent-blue);
    border-radius: 0 4px 4px 0;
    box-shadow: 0 0 10px var(--accent-blue);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    transform: scaleY(0.5);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nav-item.active .nav-indicator {
    opacity: 1;
    transform: scaleY(1);
}

.nav-icon {
    width: 18px;
    height: 18px;
    fill: currentColor;
    opacity: 0.8;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
}

.system-summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.75rem;
}

.system-summary .label { color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.system-summary .val { color: var(--accent-success); font-weight: 600; }

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    height: var(--topbar-h);
    background: var(--topbar-glass);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 90;
}

.bar-left .breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.crumb { color: var(--text-muted); cursor: pointer; }
.crumb.active { color: var(--text-primary); font-weight: 600; }
.separator { color: var(--text-muted); opacity: 0.5; }

.bar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.system-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent-success);
    border: 1px solid rgba(24, 216, 169, 0.1);
}

.status-dot {
    width: 6px;
    height: 6px;
    background: var(--accent-success);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-success);
}

.search-wrap {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 4px 10px;
    width: 200px;
    transition: border-color 0.2s, background 0.2s;
}

.search-wrap:focus-within {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.08);
}

.search-icon { width: 14px; height: 14px; fill: var(--text-muted); margin-right: 8px; }
.search-wrap input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.8rem;
    outline: none;
    width: 100%;
}

.primary-action-btn {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.primary-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    filter: brightness(1.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: #333;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
}

/* Content Views */
.content-view {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    background: radial-gradient(circle at 50% 0%, #161618 0%, #0a0a0b 100%);
}

.page-section {
    display: none;
    animation: slideUp 0.3s cubic-bezier(0, 0, 0.2, 1);
}

.page-section.visible { display: block; }

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards & Glass Effects */
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-mac);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-mac);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass:hover {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.12);
}

/* KPI Pills */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-pill {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: default;
}

.kpi-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 10px rgba(255, 255, 255, 0.02);
}

.pill-head { display: flex; justify-content: space-between; align-items: flex-start; }
.pill-head .label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.pill-icon-svg { width: 18px; height: 18px; fill: var(--text-muted); opacity: 0.6; }

.kpi-pill .value { font-size: 1.8rem; font-weight: 700; color: var(--text-primary); }
.kpi-pill .subtext { font-size: 0.7rem; color: var(--text-muted); }
.error-txt { color: var(--accent-error) !important; }

/* Dashboard Layout */
.dash-layout { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.card-header h3 { font-size: 1rem; font-weight: 600; }

.event-item {
    font-size: 0.85rem;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    gap: 12px;
}

.event-item .timestamp { color: var(--text-muted); font-weight: 500; }
.event-item .msg { color: var(--text-secondary); }

.gauge-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 160px; }
.ring-status {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 8px solid rgba(255, 255, 255, 0.03);
    border-top: 8px solid var(--accent-success);
    display: flex;
    align-items: center;
    justify-content: center;
}
.ring-txt { font-size: 1.5rem; font-weight: 700; color: var(--accent-success); }
.status-note { margin-top: 16px; font-size: 0.8rem; color: var(--text-muted); }

/* Grabber View */
.minimal-input, .minimal-textarea, .minimal-select {
    width: 100%; border: 1px solid var(--glass-border); background: rgba(0,0,0,0.2);
    border-radius: 8px; color: white; padding: 10px; outline: none; margin-bottom: 16px;
    font-family: inherit; transition: border-color 0.2s;
}
.minimal-input:focus, .minimal-textarea:focus { border-color: var(--accent-blue); }
.minimal-textarea { height: 100px; resize: none; }

/* Library Toolbar Search */
.table-actions { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--glass-border); }
.filter-wrap { display: flex; gap: 8px; }
.f-pill { font-size: 0.75rem; padding: 4px 12px; border-radius: 12px; background: rgba(255,255,255,0.03); border: 1px solid var(--glass-border); color: var(--text-muted); cursor: pointer; }
.f-pill.active { background: var(--accent-blue); color: white; border-color: var(--accent-blue); }

/* Tables */
.aura-table { width: 100%; border-collapse: collapse; }
.aura-table th { text-align: left; padding: 12px 20px; font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; border-bottom: 1px solid var(--glass-border); }
.aura-table td { padding: 10px 20px; font-size: 0.85rem; border-bottom: 1px solid rgba(255, 255, 255, 0.02); }
.row-thumb { width: 28px; height: 38px; background: #222; border-radius: 4px; }
.tag-ok { color: var(--accent-success); font-weight: 600; font-size: 0.75rem; }
.tag-active { color: var(--accent-blue); font-weight: 600; font-size: 0.75rem; }
.tag-warn { color: var(--accent-warning); font-weight: 600; font-size: 0.75rem; }

/* Library Split */
.library-split { display: grid; grid-template-columns: 1fr 240px; gap: 24px; }
.obj-preview { width: 100%; height: 160px; background: #111; border-radius: 8px; margin-bottom: 16px; }
.detail-stack { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.d-row { display: flex; justify-content: space-between; font-size: 0.8rem; }
.d-row span:first-child { color: var(--text-muted); }

/* Image Tool Layout */
.tools-layout { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }
.preview-canvas { height: 400px; display: flex; align-items: center; justify-content: center; position: relative; }
.canvas-mock { width: 100%; height: 100%; background: #0c0c0e; border-radius: 8px; position: relative; border: 1px dashed var(--glass-border); }
.canv-lbl { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); font-size: 0.8rem; color: var(--text-muted); }
.slider-line { position: absolute; left: 40%; top: 0; bottom: 0; width: 2px; background: var(--accent-blue); box-shadow: 0 0 10px var(--accent-blue); }

.grid-9 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 90px; }
.g-cell { width: 28px; height: 28px; background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border); border-radius: 4px; cursor: pointer; transition: all 0.2s; }
.g-cell:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.3); }
.g-cell.active { background: var(--accent-blue); border-color: var(--accent-blue); box-shadow: 0 0 8px var(--accent-blue); }

/* Type Profile Grid */
.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.p-item { padding: 32px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: default; }
.p-item:hover { transform: translateY(-3px); border-color: rgba(255,255,255,0.15); box-shadow: 0 16px 32px rgba(0,0,0,0.5); }

.p-ic-svg { width: 40px; height: 40px; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; transition: transform 0.3s; }
.p-item:hover .p-ic-svg { transform: scale(1.1); }
.p-ic-svg svg { width: 100%; height: 100%; fill: var(--text-muted); opacity: 0.8; }
.p-tags { display: flex; gap: 6px; }
.p-tags span { font-size: 0.65rem; background: rgba(0,0,0,0.3); border: 1px solid var(--glass-border); padding: 2px 8px; border-radius: 10px; color: var(--text-muted); }
.secondary-btn { background: transparent; border: 1px solid var(--glass-border); color: white; padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 0.8rem; transition: all 0.2s; }
.secondary-btn:hover { background: rgba(255,255,255,0.05); border-color: var(--text-muted); transform: translateY(-1px); }

/* Settings & Logs */
.logs-view { flex: 1; }
.log-body { font-family: 'Inter', sans-serif; font-size: 0.8rem; padding: 20px; max-height: 400px; overflow-y: auto; color: var(--text-secondary); line-height: 1.6; }
.l-line { margin-bottom: 6px; }
.t-sys { color: var(--accent-success); font-weight: 700; margin-right: 8px; }
.t-imp { color: var(--accent-warning); font-weight: 700; margin-right: 8px; }
.t-que { color: var(--accent-blue); font-weight: 700; margin-right: 8px; }
.t-img { color: #d63384; font-weight: 700; margin-right: 8px; }

.sl-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.sn-item { padding: 10px 16px; border-radius: 8px; cursor: pointer; font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 4px; transition: all 0.2s; }
.sn-item:hover { background: rgba(255,255,255,0.03); color: white; }
.sn-item.active { background: rgba(255,255,255,0.05); color: var(--text-primary); font-weight: 500; }

/* ============================================
   18+ Movie Profile Detail Modal
   ============================================ */

/* Overlay */
.pm-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.35s;
}

.pm-overlay.pm-open {
    opacity: 1;
    visibility: visible;
}

/* Panel */
.pm-panel {
    width: 680px;
    max-width: 94vw;
    max-height: 88vh;
    background: rgba(18, 18, 22, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: blur(40px);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7),
                0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    display: flex;
    flex-direction: column;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.pm-overlay.pm-open .pm-panel {
    transform: translateY(0) scale(1);
}

.pm-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 24px 28px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.015);
}

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

.pm-header-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.pm-header-icon {
    width: 26px;
    height: 26px;
    fill: var(--accent-blue);
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px rgba(0, 122, 255, 0.4));
}

.pm-header-title-row h2 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

.pm-chip {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: 10px;
    flex-shrink: 0;
}

.pm-chip-active {
    background: rgba(24, 216, 169, 0.12);
    color: var(--accent-success);
    border: 1px solid rgba(24, 216, 169, 0.2);
}

.pm-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.pm-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 16px;
    transition: all 0.2s;
}

.pm-close-btn:hover {
    background: rgba(255, 77, 79, 0.12);
    border-color: rgba(255, 77, 79, 0.25);
    color: var(--accent-error);
    transform: scale(1.08);
}

.pm-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.pm-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pm-sec-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* Profile Summary Grid */
.pm-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.pm-field {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color 0.2s;
}

.pm-field:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.pm-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.pm-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.pm-val-accent {
    color: var(--accent-success) !important;
}

/* Input Groups */
.pm-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pm-input-grow {
    flex: 1;
    min-width: 0;
}

.pm-input-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}

.pm-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pm-input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.08);
}

.pm-input[readonly] {
    color: var(--text-secondary);
    cursor: default;
}

.pm-input-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

/* Preview Line */
.pm-preview-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
}

.pm-preview-tag {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-blue);
    background: rgba(0, 122, 255, 0.08);
    border: 1px solid rgba(0, 122, 255, 0.15);
    padding: 2px 8px;
    border-radius: 6px;
    flex-shrink: 0;
}

.pm-preview-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-family: 'Inter', monospace;
    letter-spacing: 0.02em;
}

/* Browse Button */
.pm-browse-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    white-space: nowrap;
}

.pm-browse-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* Select Dropdown */
.pm-select {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%236a6a70'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    transition: border-color 0.2s;
}

.pm-select:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.pm-select:focus {
    border-color: var(--accent-blue);
}

/* Rules Grid */
.pm-rules-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

/* Content Chips */
.pm-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.pm-content-chip {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 14px;
    background: rgba(0, 122, 255, 0.08);
    border: 1px solid rgba(0, 122, 255, 0.18);
    color: var(--accent-blue);
    cursor: default;
    transition: all 0.2s;
}

.pm-content-chip:hover {
    background: rgba(0, 122, 255, 0.14);
    transform: translateY(-1px);
}

.pm-chip-dim {
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
}

.pm-chip-dim:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Watermark Position Grid */
.pm-watermark-row {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.pm-pos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    width: 96px;
}

.pm-pos-cell {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.pm-pos-cell:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.pm-pos-active {
    background: var(--accent-blue) !important;
    border-color: var(--accent-blue) !important;
    box-shadow: 0 0 10px rgba(0, 122, 255, 0.4);
}

.pm-preview-chip-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
}

/* Notes Textarea */
.pm-textarea {
    width: 100%;
    min-height: 90px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    line-height: 1.6;
    outline: none;
    resize: vertical;
    transition: border-color 0.2s;
}

.pm-textarea:focus {
    border-color: var(--accent-blue);
}

/* Footer */
.pm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.015);
}

.pm-footer-left {
    display: flex;
    gap: 8px;
}

.pm-footer-btn {
    padding: 9px 20px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.pm-footer-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.pm-btn-accent {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}

.pm-btn-accent:hover {
    filter: brightness(1.15);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3);
    color: #fff;
}

.pm-btn-danger {
    color: var(--accent-error);
    border-color: rgba(255, 77, 79, 0.2);
}

.pm-btn-danger:hover {
    background: rgba(255, 77, 79, 0.1);
    border-color: rgba(255, 77, 79, 0.35);
    color: var(--accent-error);
}

.pm-btn-close {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
}

.pm-btn-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* Responsive for smaller screens */
@media (max-width: 780px) {
    .pm-panel {
        width: 96vw;
        max-height: 92vh;
    }

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

    .pm-rules-grid {
        grid-template-columns: 1fr;
    }

    .pm-watermark-row {
        flex-direction: column;
    }
}

/* ============================================
   Source Grabber Batch Redesign
   ============================================ */

.sg-summary-strip {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.sg-stat {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sg-stat-lbl {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
}

.sg-stat-val {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sg-val-warn { color: var(--accent-warning); }
.sg-val-err { color: var(--accent-error); }

.sg-stages-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sg-stage-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sg-stage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 12px;
}

.sg-stage-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.sg-col-layout {
    display: grid;
    grid-template-columns: 352px 1fr;
    gap: 24px;
}

.sg-form-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sg-tall-text {
    height: 120px;
}

.sg-row-inputs {
    display: flex;
    gap: 12px;
}

.sg-filters {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0;
}

.sg-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.sg-checkbox input {
    accent-color: var(--accent-blue);
}

.sg-btn-space {
    margin-top: 8px;
}

.w-100 { width: 100%; }
.sg-justify-center { justify-content: center; }
.sg-mb-2 { margin-bottom: 8px; }

.sg-progress {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.sg-prog-bar {
    height: 6px;
    background: rgba(0,0,0,0.4);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
}

.sg-prog-fill {
    height: 100%;
    background: var(--accent-blue);
    border-radius: 3px;
}

.sg-progress.sg-prog-active .sg-prog-fill {
    background: linear-gradient(90deg, var(--accent-blue), #5e5ce6, var(--accent-blue));
    background-size: 200% 100%;
    animation: flowBg 2s linear infinite;
}

@keyframes flowBg {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.sg-prog-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

.sg-result-col {
    display: flex;
    flex-direction: column;
}

.sg-res-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.sg-table-wrap {
    flex: 1;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    overflow-y: auto;
    max-height: 480px;
}

.sg-table-tall {
    max-height: 300px;
    margin-bottom: 16px;
}

.sg-compact-table th {
    padding: 10px 16px;
    position: sticky;
    top: 0;
    background: rgba(18, 18, 20, 0.95);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.sg-compact-table td {
    padding: 8px 16px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.sg-compact-table td .tag-ok,
.sg-compact-table td .tag-warn,
.sg-compact-table td .tag-active {
    font-size: 0.75rem;
}

.sg-b-controls {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 16px;
    align-items: center;
}

.sg-btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.sg-b-footer {
    display: flex;
    justify-content: flex-start;
}

.sg-c-top-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.sg-c-name-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.sg-c-img-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.sg-folder-path {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sg-c-preview-table td:nth-child(1) { text-align: center; }

.sg-log-panel {
    flex: 1;
    min-height: 120px;
    background: rgba(0, 0, 0, 0.3);
    padding: 16px;
    font-family: 'Inter', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-radius: 8px;
    overflow-y: auto;
}

/* ============================================
   Download Queue Batch Redesign
   ============================================ */

.dq-summary-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.dq-summary-card {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dq-sum-lbl {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.dq-sum-val {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dq-val-accent { color: var(--accent-blue); }
.dq-val-ok { color: var(--accent-success); }
.dq-val-warn { color: var(--accent-warning); }
.dq-val-err { color: var(--accent-error); }

.dq-main-layout {
    display: grid;
    grid-template-columns: 1fr 607px;
    gap: 24px;
    align-items: start;
}

.dq-batch-panel {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

.dq-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: rgba(255, 255, 255, 0.015);
}

.dq-filters {
    display: flex;
    gap: 12px;
    align-items: center;
}

.dq-search {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 2px 10px;
    height: 34px;
}

.dq-search input {
    background: transparent;
    border: none;
    color: white;
    font-size: 0.8rem;
    outline: none;
    width: 100%;
    margin-left: 8px;
}

.dq-filter-select {
    width: 140px;
    margin-bottom: 0;
    height: 34px;
    font-size: 0.78rem;
    background: rgba(0, 0, 0, 0.2);
}

/* Source Grabber — empty-input error state */
.sg-input-error {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 2px rgba(255, 77, 77, 0.25);
}
.sg-input-error::placeholder {
    color: var(--danger);
    opacity: 0.85;
}

.dq-filter-lock {
    display: inline-flex;
    align-items: center;
    width: 140px;
    height: 34px;
    padding: 0 10px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    cursor: not-allowed;
    user-select: none;
    pointer-events: none;
}

.dq-action-bar {
    display: flex;
    gap: 8px;
}

.dq-btn-sm {
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 600;
}

.dq-btn-warn {
    color: var(--accent-warning);
    border-color: rgba(242, 178, 77, 0.25);
}

.dq-table-container {
    max-height: 400px;
    overflow-y: auto;
}

.dq-compact-table th {
    font-size: 0.72rem;
    padding: 10px 16px;
    position: sticky;
    top: 0;
    background: rgba(18, 18, 20, 1);
    z-index: 10;
}

.dq-compact-table td {
    padding: 10px 16px;
    font-size: 0.8rem;
}

.dq-selectable-table tr {
    cursor: pointer;
    transition: background 0.2s;
}

.dq-selectable-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.dq-selectable-table tr.selected {
    background: rgba(0, 122, 255, 0.12);
}

.dq-log-area {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.1);
    border-top: 1px solid var(--glass-border);
}

.dq-log-lbl {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    display: block;
    margin-bottom: 10px;
}

.dq-log-panel {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    height: 100px;
    overflow-y: auto;
    font-family: 'Inter', monospace;
    font-size: 0.78rem;
}

.dq-log-line {
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.dq-log-t { font-weight: 700; margin-right: 8px; }
.dq-t-sys { color: var(--accent-blue); }
.dq-t-warn { color: var(--accent-warning); }
.dq-t-imp { color: var(--accent-success); }

/* Detail Panel Right */
.dq-detail-panel {
    display: flex;
    flex-direction: column;
}

.dq-detail-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
}

.dq-detail-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
}

.dq-detail-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.dq-detail-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dq-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.dq-info-lbl {
    color: var(--text-muted);
}

.dq-info-val {
    font-weight: 600;
    color: var(--text-primary);
}

.dq-mini-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dq-mini-prog-lbl {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.dq-mini-prog-bar {
    height: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
    overflow: hidden;
}

.dq-mini-prog-fill {
    height: 100%;
    background: #33FF00;
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(51, 255, 0, 0.4);
}

.dq-item-list-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dq-item-lbl {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.dq-item-scroll {
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.dq-item-table td {
    font-size: 0.75rem;
    padding: 8px 12px;
}

.dq-item-table .dq-dl-btn {
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    color: #fff;
    background: #007AFF;
}

.dq-controls-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 4px;
}

.dq-controls-row label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.dq-delay-group {
    display: flex;
    gap: 6px;
    align-items: center;
}

.dq-delay-group input {
    width: 62px;
    text-align: center;
}

.dq-delay-group span {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.dq-rename-input {
    flex: 1;
    min-width: 140px;
}

.dq-note-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dq-note-panel {
    background: rgba(255, 178, 77, 0.05);
    border: 1px solid rgba(242, 178, 77, 0.15);
    border-radius: 8px;
    padding: 12px;
    font-size: 0.78rem;
    color: var(--accent-warning);
    line-height: 1.5;
}

/* ──────────────────────────────────────────────────────
   BROWSER-STYLE TAB BAR (Source Grabber)
   ────────────────────────────────────────────────────── */
.sg-tab-bar {
    display: flex;
    gap: 0;
    margin-bottom: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sg-tab {
    display: flex;
    align-items: center;
    padding: 9px 22px 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255,255,255,0.4);
    cursor: pointer;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    transition: all 0.2s;
    user-select: none;
    position: relative;
    top: 1px;
}
.sg-tab:hover {
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.03);
}
.sg-tab.active {
    color: #fff;
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.08);
    border-bottom: 1px solid var(--bg-main, #0a0a0b);
}
.sg-tab-content {
    display: none;
}
.sg-tab-content.active {
    display: block;
}

/* ──────────────────────────────────────────────────────
   PROXY STATUS BADGE
   ────────────────────────────────────────────────────── */
.sg-proxy-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 8px;
    margin-bottom: 12px;
    letter-spacing: 0.02em;
    transition: all 0.3s ease;
}
.sg-proxy-ok {
    color: var(--accent-success);
    background: rgba(76, 217, 100, 0.08);
    border: 1px solid rgba(76, 217, 100, 0.2);
}
.sg-proxy-off {
    color: var(--accent-error, #ff4d4d);
    background: rgba(255, 77, 77, 0.08);
    border: 1px solid rgba(255, 77, 77, 0.2);
}

/* ──────────────────────────────────────────────────────
   MINI LOG PANELS (Stage A / B live feedback)
   ────────────────────────────────────────────────────── */
.sg-minilog {
    max-height: 90px;
    overflow-y: auto;
    font-size: 0.7rem;
    line-height: 1.55;
    color: var(--text-muted);
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    margin-top: 8px;
    font-family: 'Inter', monospace;
}
.sg-minilog:empty {
    display: none;
}
.sg-minilog-line {
    padding: 1px 0;
    word-break: break-all;
}
.sg-log-ok {
    color: var(--accent-success);
}
.sg-log-err {
    color: var(--accent-error, #ff4d4d);
}

/* ──────────────────────────────────────────────────────
   DQ DOWNLOAD LINK IN ITEM TABLE
   ────────────────────────────────────────────────────── */
.dq-dl-cell {
    text-align: center;
    width: 36px;
}
.dq-dl-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 0.85rem;
    color: var(--accent-blue);
    background: rgba(94, 92, 230, 0.1);
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s ease, transform 0.15s ease;
}
.dq-dl-link:hover {
    background: rgba(94, 92, 230, 0.25);
    transform: scale(1.15);
}

/* ──────────────────────────────────────────────────────
   COPY ACTION BAR (Stage A / B output)
   ────────────────────────────────────────────────────── */
.sg-copy-bar {
    display: flex;
    gap: 6px;
    margin: 6px 0 4px;
    flex-wrap: wrap;
}
.sg-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.68rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}
.sg-copy-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
}
.sg-copy-btn:active {
    transform: scale(0.96);
}
.sg-copy-btn.sg-copy-ok {
    color: var(--accent-success);
    border-color: rgba(76, 217, 100, 0.3);
    background: rgba(76, 217, 100, 0.08);
}
.sg-copy-btn.sg-copy-fail {
    color: var(--accent-error, #ff4d4d);
    border-color: rgba(255, 77, 77, 0.3);
    background: rgba(255, 77, 77, 0.08);
}

/* ──────────────────────────────────────────────────────
   STAGE A — URL COUNT / ACTION ROW / BOOKMARK
   ────────────────────────────────────────────────────── */
.sg-url-count {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--accent-blue);
    margin-left: 6px;
}

.sg-action-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.sg-btn-flex { flex: 1; }

.sg-btn-sweep-img {
    font-size: 0.78rem;
    border-color: rgba(255, 179, 64, 0.35);
    color: #ffb340;
}
.sg-btn-sweep-img:hover {
    background: rgba(255, 179, 64, 0.12);
}

.sg-btn-bookmark {
    margin-top: 6px;
    gap: 6px;
    font-size: 0.78rem;
    border-color: rgba(172, 142, 255, 0.35);
    color: #ac8eff;
}
.sg-btn-bookmark:hover {
    background: rgba(172, 142, 255, 0.12);
}

/* Bookmark Modal */
.sg-bm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 5000;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}
.sg-bm-overlay.open {
    display: flex;
}
.sg-bm-modal {
    width: 744px;
    min-height: 520px;
    max-height: 96vh;
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
}
.sg-bm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
}
.sg-bm-header h3 { margin: 0; font-size: 0.95rem; }
.sg-bm-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}
.sg-bm-close:hover { color: #fff; }

.sg-bm-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--glass-border);
}
.sg-bm-tab {
    flex: 1;
    padding: 10px 0;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.sg-bm-tab:hover { color: var(--text-secondary); }
.sg-bm-tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.sg-bm-add-row {
    display: flex;
    gap: 8px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--glass-border);
}
.sg-bm-note-input { flex: 1; font-size: 0.8rem; }
.sg-bm-add-row .primary-action-btn.sg-bm-save-btn {
    white-space: nowrap;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 5px;
    min-height: unset;
    line-height: 1.4;
    gap: 0;
}

.sg-bm-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 20px;
    max-height: 54vh;
}
.sg-bm-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 32px 0;
}

.sg-bm-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-bottom: 8px;
    background: rgba(0,0,0,0.2);
}
.sg-bm-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.sg-bm-item-note {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sg-bm-item-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.sg-bm-item-urls {
    font-size: 0.72rem;
    color: var(--text-secondary);
    max-height: 60px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.4;
}
.sg-bm-item-actions {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}
.sg-bm-item-actions button {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 4px;
    border: 1px solid var(--glass-border);
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
}
.sg-bm-item-actions button:hover { background: rgba(255,255,255,0.06); }
.sg-bm-item-actions .sg-bm-del { color: var(--accent-error, #ff4d4d); border-color: rgba(255,77,77,0.3); }
.sg-bm-item-actions .sg-bm-del:hover { background: rgba(255,77,77,0.1); }

/* Mark color dots */
.sg-bm-colors {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    margin-left: 4px;
}
.sg-bm-colors span {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-right: 2px;
}
.sg-bm-cdot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.1s;
}
.sg-bm-cdot:hover { transform: scale(1.25); }
.sg-bm-cdot.active { border-color: #fff; }
.sg-bm-cdot[data-color="none"] { background: rgba(255,255,255,0.12); }
.sg-bm-cdot[data-color="red"] { background: #ff4d4d; }
.sg-bm-cdot[data-color="yellow"] { background: #ffc107; }
.sg-bm-cdot[data-color="green"] { background: #4cd964; }
.sg-bm-cdot[data-color="blue"] { background: #5ac8fa; }
.sg-bm-cdot[data-color="purple"] { background: #ac8eff; }

.sg-bm-item-note.mark-red { color: #ff4d4d; }
.sg-bm-item-note.mark-yellow { color: #ffc107; }
.sg-bm-item-note.mark-green { color: #4cd964; }
.sg-bm-item-note.mark-blue { color: #5ac8fa; }
.sg-bm-item-note.mark-purple { color: #ac8eff; }

/* ──────────────────────────────────────────────────────
   SG DOWNLOAD BUTTONS (Stage B table)
   ────────────────────────────────────────────────────── */
.sg-dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    border: 1px solid;
    text-decoration: none;
    transition: background 0.15s, transform 0.1s;
    white-space: nowrap;
}
.sg-dl-btn:active {
    transform: scale(0.95);
}
.sg-dl-hls {
    color: #4cd964;
    background: rgba(76, 217, 100, 0.12);
    border-color: rgba(76, 217, 100, 0.35);
}
.sg-dl-hls:hover {
    background: rgba(76, 217, 100, 0.25);
}
.sg-dl-direct {
    color: #5ac8fa;
    background: rgba(90, 200, 250, 0.12);
    border-color: rgba(90, 200, 250, 0.35);
}
.sg-dl-direct:hover {
    background: rgba(90, 200, 250, 0.25);
}
.sg-dl-none {
    color: rgba(255,255,255,0.25);
    font-size: 0.72rem;
}
.sg-detail-table td:nth-child(1) { text-align: center; }
.sg-detail-table td:nth-child(7) { text-align: center; }

/* ──────────────────────────────────────────────────────
   TOAST NOTIFICATION
   ────────────────────────────────────────────────────── */
.aura-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    padding: 10px 18px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    border-radius: 10px;
    color: #fff;
    pointer-events: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    max-width: 360px;
    word-break: break-word;
}
.aura-toast.toast-show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.aura-toast.toast-ok {
    background: rgba(30, 30, 30, 0.92);
    border: 1px solid rgba(76, 217, 100, 0.35);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
.aura-toast.toast-err {
    background: rgba(30, 30, 30, 0.92);
    border: 1px solid rgba(255, 77, 77, 0.35);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

/* ──────────────────────────────────────────────────────
   DQ DOWNLOAD TYPE BADGES
   ────────────────────────────────────────────────────── */
.dq-dtype {
    display: inline-block;
    padding: 2px 7px;
    font-size: 0.62rem;
    font-weight: 700;
    border-radius: 4px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}
.dq-dtype-direct {
    color: var(--accent-success);
    background: rgba(76, 217, 100, 0.1);
    border: 1px solid rgba(76, 217, 100, 0.2);
}
.dq-dtype-stream {
    color: var(--accent-blue);
    background: rgba(94, 92, 230, 0.1);
    border: 1px solid rgba(94, 92, 230, 0.2);
}
.dq-dtype-blocked {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ═══════════════════════════════════════════════
   LOGIN OVERLAY
   ═══════════════════════════════════════════════ */
#login-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('ww.jpg') center/cover no-repeat fixed;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
#login-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
#login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-card {
    position: relative;
    width: 370px;
    padding: 44px 38px 36px;
    background: rgba(16, 16, 22, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(100, 80, 200, 0.12);
    text-align: center;
    animation: loginSlideUp 0.6s ease-out;
}
@keyframes loginSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-logo {
    width: 110px;
    height: 110px;
    object-fit: contain;
    border-radius: 50%;
    border: 2px solid rgba(155, 89, 182, 0.4);
    box-shadow: 0 0 25px rgba(155, 89, 182, 0.25);
    margin-bottom: 16px;
}
.login-title {
    margin: 0 0 2px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #f0f0f0;
    letter-spacing: 0.5px;
}
.login-subtitle {
    margin: 0 0 28px;
    font-size: 0.78rem;
    color: #8a8a95;
    font-weight: 400;
}

.login-field {
    text-align: left;
    margin-bottom: 16px;
}
.login-field label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: #9a9aa5;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.login-field input {
    width: 100%;
    padding: 11px 14px;
    font-size: 0.88rem;
    font-family: 'Inter', sans-serif;
    color: #f0f0f0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.25s, box-shadow 0.25s;
    box-sizing: border-box;
}
.login-field input:focus {
    border-color: rgba(100, 80, 220, 0.6);
    box-shadow: 0 0 12px rgba(100, 80, 220, 0.2);
}
.login-field input::placeholder {
    color: #555;
}

.login-error {
    min-height: 20px;
    font-size: 0.76rem;
    color: #ff5555;
    margin-bottom: 6px;
    text-align: center;
}

.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    color: #fff;
    background: linear-gradient(135deg, #6a4cdb, #8b5cf6);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.25s;
    box-shadow: 0 4px 18px rgba(106, 76, 219, 0.35);
}
.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(106, 76, 219, 0.5);
}
.login-btn:active {
    transform: translateY(0);
}

/* shake on wrong password */
@keyframes loginShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}
.login-card.shake {
    animation: loginShake 0.4s ease;
}

/* ═══════════════════════════════════════════════════
   CONTROL CENTER
   ═══════════════════════════════════════════════════ */

/* Root container — full vertical stack */
.cc-root {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    min-height: 100%;
    box-sizing: border-box;
}

/* ── Summary bar ── */
.cc-summary {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cc-kpi {
    flex: 1;
    min-width: 100px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 14px 16px 10px;
    position: relative;
    overflow: hidden;
}

.cc-kpi-val {
    font-size: 1.6rem;
    font-weight: 800;
    color: #f0f0f0;
    line-height: 1;
    margin-bottom: 4px;
}

.cc-kpi-label {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.cc-kpi-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    opacity: 0.6;
    border-radius: 0 0 12px 12px;
}

/* Status KPI special */
.cc-kpi-status { display: flex; flex-direction: column; justify-content: flex-end; }
.cc-status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #555;
    margin-bottom: 6px;
    transition: background 0.3s;
}
.cc-status-dot.active  { background: #f39c12; box-shadow: 0 0 8px rgba(243,156,18,0.6); }
.cc-status-dot.done    { background: #2ecc71; box-shadow: 0 0 8px rgba(46,204,113,0.6); }
.cc-status-dot.error   { background: #e74c3c; box-shadow: 0 0 8px rgba(231,76,60,0.6); }
.cc-status-text { font-size: 0.9rem !important; font-weight: 700; color: #aaa; }

/* ── 3-column panels ── */
.cc-panels {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    flex: 1;
}

/* ── Panel card ── */
.cc-panel {
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.cc-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 13px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    flex-shrink: 0;
}

.cc-panel-header h3 {
    margin: 0;
    font-size: 0.88rem;
    font-weight: 700;
    color: #f0f0f0;
    flex: 1;
}

.cc-panel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cc-panel-badge {
    font-size: 0.67rem;
    font-weight: 600;
    padding: 2px 9px;
    border-radius: 20px;
    background: rgba(255,255,255,0.07);
    color: var(--text-muted);
}

/* ── Panel body ── */
.cc-section-body {
    padding: 16px;
    flex: 1;
    overflow-y: auto;
}

/* URL textarea */
.cc-url-textarea {
    height: 150px;
    resize: vertical;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.78rem;
    line-height: 1.65;
}

/* Info strip */
.cc-info-strip {
    margin-top: 14px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
}

.cc-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 3px 0;
}

.cc-info-row strong {
    font-weight: 700;
    color: #f0f0f0;
}

/* ── Progress ── */
.cc-progress-wrap { margin-bottom: 18px; }

.cc-label-xs {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cc-pct-val {
    font-size: 0.82rem;
    font-weight: 800;
    color: #f39c12;
}

.cc-progress-track {
    height: 7px;
    background: rgba(255,255,255,0.07);
    border-radius: 7px;
    overflow: hidden;
}

.cc-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f39c12, #e67e22);
    border-radius: 7px;
    transition: width 0.4s ease;
}

/* ── Working table (steps) ── */
.cc-steps {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 4px;
}

.cc-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 9px;
}

.cc-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--text-muted);
    flex-shrink: 0;
}

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

.cc-step-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #d0d0d8;
}

.cc-step-sub {
    font-size: 0.66rem;
    color: var(--text-muted);
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cc-step-badge {
    font-size: 0.66rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    flex-shrink: 0;
}

.cc-step-idle   { color: #555; background: transparent; }
.cc-step-active { color: #f39c12; background: rgba(243,156,18,0.12); }
.cc-step-done   { color: #2ecc71; background: rgba(46,204,113,0.12); }
.cc-step-error  { color: #e74c3c; background: rgba(231,76,60,0.12); }

/* ── Log box ── */
.cc-log-box {
    height: 115px;
    overflow-y: auto;
    padding: 8px 11px;
    background: rgba(0,0,0,0.38);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 9px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.7rem;
    line-height: 1.75;
}

.cc-log-placeholder { color: #444; }

/* ── Output panel ── */
.cc-output-body {
    display: flex;
    flex-direction: column;
}

.cc-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 6px;
    margin-bottom: 12px;
}

.cc-action-btn {
    font-size: 0.7rem !important;
    padding: 7px 4px !important;
    text-align: center;
    white-space: nowrap;
}

.cc-queue-btn {
    color: #9b59b6 !important;
    border-color: rgba(155,89,182,0.4) !important;
}
.cc-queue-btn:hover { background: rgba(155,89,182,0.1) !important; }

/* ── Results table ── */
.cc-results-wrap {
    flex: 1;
    overflow-y: auto;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    background: rgba(0,0,0,0.2);
}

.cc-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.73rem;
}

.cc-results-table thead tr {
    position: sticky;
    top: 0;
    background: rgba(18,18,28,0.95);
    z-index: 1;
}

.cc-results-table th {
    padding: 7px 10px;
    text-align: left;
    font-size: 0.67rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.cc-results-table th:first-child { width: 30px; }
.cc-results-table th:last-child  { width: 70px; }

.cc-results-table td {
    padding: 6px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: #c8c8d4;
    vertical-align: middle;
}

.cc-results-table tr:last-child td { border-bottom: none; }

.cc-results-table tr:hover td { background: rgba(255,255,255,0.03); }

.cc-empty-row {
    text-align: center;
    color: #555;
    padding: 28px 10px !important;
    font-size: 0.78rem;
}

/* Status badge in results */
.cc-st-wait  { color: #8a8a95; }
.cc-st-ok    { color: #2ecc71; font-weight: 600; }
.cc-st-fail  { color: #e74c3c; font-weight: 600; }

/* ── Results table — cell details ── */
.cc-td-title {
    font-size: 0.75rem;
    color: #d0d0d8;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cc-link-a {
    color: #3498db;
    text-decoration: none;
    font-size: 0.7rem;
    display: block;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cc-link-a:hover { text-decoration: underline; color: #5dade2; }

.cc-link-same { color: #444; font-size: 0.7rem; }

/* ── Responsive: collapse to single column on narrow screens ── */
@media (max-width: 1100px) {
    .cc-panels { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
    .cc-panels { grid-template-columns: 1fr; }
    .cc-summary { gap: 8px; }
}

