/* =============================================
   X Auto Platform — Dashboard Styles
   Editorial Monochrome (Light)
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    /* ── Light Base ── */
    --bg-primary:     #f5f5f5;
    --bg-secondary:   #eeeeee;
    --bg-card:        #ffffff;
    --bg-card-hover:  #fafafa;
    --bg-sidebar:     #0a0a0a;
    --bg-input:       #f0f0f0;

    --text-primary:   #111111;
    --text-secondary: #555555;
    --text-muted:     #aaaaaa;

    /* Sidebar text (inverted) */
    --sidebar-text:         #cccccc;
    --sidebar-text-active:  #ffffff;
    --sidebar-text-muted:   #555555;

    /* Accent — black on white */
    --accent-blue:         #111111;
    --accent-blue-soft:    rgba(0,0,0,0.05);
    --accent-green:        #333333;
    --accent-green-soft:   rgba(0,0,0,0.04);
    --accent-purple:       #444444;
    --accent-purple-soft:  rgba(0,0,0,0.04);
    --accent-orange:       #555555;
    --accent-orange-soft:  rgba(0,0,0,0.03);
    --accent-red:          #cc2222;
    --accent-red-soft:     rgba(204,34,34,0.08);

    /* Borders */
    --border-color: rgba(0,0,0,0.08);
    --border-light: rgba(0,0,0,0.14);

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.07);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.14);
    --shadow-glow-blue: 0 0 20px rgba(0,0,0,0.12);

    --sidebar-width: 240px;
    --header-height: 60px;

    --transition-fast:   120ms ease;
    --transition-normal: 220ms ease;
    --transition-slow:   360ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15.5px; }
body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: none;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    transition: transform var(--transition-slow);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-color);
}

.brand-icon {
    width: 34px;
    height: 34px;
    background: #ffffff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000000;
    flex-shrink: 0;
}

.brand-text {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ffffff;
}

.sidebar-nav {
    flex: 1;
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    color: var(--sidebar-text-muted);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-weight: 600;
    font-size: 0.94rem;
    letter-spacing: 0.01em;
}

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

.nav-item.active {
    background: #ffffff;
    color: #000000;
    border-left: none;
    padding-left: 16px;
}

.nav-item.active svg { stroke: #000000; opacity: 1; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.system-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--sidebar-text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.online { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); }
.status-dot.offline { background: var(--accent-red); }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.version {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ---- Main Content ---- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
}

/* ---- Header ---- */
.top-header {
    height: var(--header-height);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

.page-title {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.notification-btn {
    position: relative;
    background: none;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--accent-red);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Pages ---- */
.page {
    display: none;
    padding: 28px 32px;
    animation: fadeIn 0.3s ease;
}

.page.active { display: block; }

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

.page-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.page-header-bar h2 {
    font-size: 1.2rem;
    font-weight: 700;
}

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

/* ---- Stats Grid ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: all var(--transition-normal);
}

.stat-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.stat-icon.blue   { background: rgba(0,0,0,0.05); color: #111111; }
.stat-icon.green  { background: rgba(0,0,0,0.04); color: #333333; }
.stat-icon.purple { background: rgba(0,0,0,0.04); color: #444444; }
.stat-icon.orange { background: rgba(0,0,0,0.03); color: #555555; }

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.stat-trend.up { color: var(--accent-green); }
.stat-trend.down { color: var(--accent-red); }

/* ---- Content Grid ---- */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.content-grid.single { grid-template-columns: 1fr; }

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

/* ---- Chart ---- */
.chart-container {
    height: 260px;
    position: relative;
}

.chart-legend {
    display: flex;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.blue { background: var(--accent-blue); }
.legend-dot.green { background: var(--accent-green); }

/* ---- Account List (Dashboard) ---- */
.account-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.account-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

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

.account-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

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

.account-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-status-text {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge.active  { background: rgba(0,0,0,0.05); color: #333333; border:1px solid rgba(0,0,0,0.1); }
.badge.paused  { background: rgba(0,0,0,0.03); color: #888888; border:1px solid rgba(0,0,0,0.06); }
.badge.error   { background: var(--accent-red-soft); color: var(--accent-red); }

/* ---- Activity Feed ---- */
.activity-feed {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-color);
}

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

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.activity-text {
    flex: 1;
    font-size: 0.88rem;
    line-height: 1.5;
}

.activity-text strong { font-weight: 600; }

.activity-time {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
}

/* ---- Accounts Grid ---- */
.accounts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.account-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: all var(--transition-normal);
}

.account-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-light);
}

.account-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.account-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.account-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.account-stat {
    text-align: center;
}

.account-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.account-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ---- Tasks ---- */
.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.task-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-fast);
}

.task-item:hover { border-color: var(--border-light); }

.task-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.task-info { flex: 1; }

.task-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.task-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.task-progress-bar {
    width: 120px;
    height: 6px;
    background: var(--bg-input);
    border-radius: 3px;
    overflow: hidden;
}

.task-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease;
}

.task-progress-fill.blue { background: var(--accent-blue); }
.task-progress-fill.green { background: var(--accent-green); }
.task-progress-fill.orange { background: var(--accent-orange); }

/* ---- Content Table ---- */
.content-stats-row {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.mini-stat {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 28px;
    text-align: center;
}

.mini-stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    display: block;
}

.mini-stat-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-top: 4px;
    display: block;
}

.content-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

.content-table th {
    text-align: left;
    padding: 14px 20px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-input);
    border-bottom: 1px solid var(--border-color);
}

.content-table td {
    padding: 14px 20px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border-color);
}

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

.content-table tr:hover td { background: var(--bg-card-hover); }

/* ---- Analytics ---- */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.analytics-card {
    text-align: center;
    padding: 28px 20px;
}

.analytics-card h4 {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.analytics-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.analytics-change {
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 600;
}

.analytics-change.up { color: var(--accent-green); }
.analytics-change.up::before { content: "↑ "; }

.mini-chart {
    height: 50px;
    margin-top: 16px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
}

.mini-bar {
    width: 6px;
    border-radius: 3px;
    background: var(--accent-blue);
    opacity: 0.6;
    transition: height 0.5s ease;
}

/* ---- Settings ---- */
.settings-sections {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.settings-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-color);
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

.setting-row label:first-child {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.setting-input {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    width: 220px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.setting-input:focus { border-color: rgba(0,0,0,0.3); }
.setting-input.small { width: 100px; }
.setting-input.tiny { width: 70px; text-align: center; }

.setting-select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

.range-group {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.setting-range {
    -webkit-appearance: none;
    width: 140px;
    height: 4px;
    background: var(--bg-input);
    border-radius: 2px;
    outline: none;
}

.setting-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
}

.range-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-width: 20px;
}

/* Toggle */
.toggle {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-muted);
    top: 2px;
    left: 2px;
    transition: var(--transition-fast);
}

.toggle input:checked + .toggle-slider {
    background: rgba(0,0,0,0.12);
    border-color: rgba(0,0,0,0.3);
}

.toggle input:checked + .toggle-slider::before {
    background: #111111;
    transform: translateX(20px);
}

/* Chips */
.style-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    background: var(--bg-input);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chip.active {
    background: rgba(0,0,0,0.07);
    color: #111111;
    border-color: rgba(0,0,0,0.25);
}

.chip:hover { border-color: rgba(0,0,0,0.2); color: var(--text-secondary); }

/* ---- Buttons ---- */
.btn-primary {
    background: #111111;
    color: #ffffff;
    border: none;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.84rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all var(--transition-fast);
    letter-spacing: 0.01em;
}

.btn-primary:hover {
    background: #333333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.84rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    background: rgba(0,0,0,0.04);
    color: var(--text-primary);
    border-color: rgba(0,0,0,0.2);
}

.btn-ghost {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.btn-ghost:hover { color: var(--text-primary); }

.btn-icon {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover { background: rgba(0,0,0,0.04); color: var(--text-secondary); border-color: var(--border-light); }

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
}

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

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    width: 580px;
    max-width: 92vw;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
    overflow: hidden;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

.modal-header h3 { font-weight: 600; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    flex-shrink: 0;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: var(--bg-card);
    position: sticky;
    bottom: 0;
    z-index: 10;
}

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-input:focus { border-color: rgba(0,0,0,0.3); }

/* ---- Responsive ---- */
@media (max-width: 1200px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .analytics-grid { grid-template-columns: repeat(2, 1fr); }
    .settings-sections { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .stats-grid { grid-template-columns: 1fr; }
    .content-grid { grid-template-columns: 1fr; }
    .analytics-grid { grid-template-columns: 1fr; }
}

/* ---- 商品ブラウザ ---- */
.pb-tag {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8em;
    font-family: inherit;
    transition: all 0.15s;
    white-space: nowrap;
}
.pb-tag:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    background: rgba(59,130,246,0.08);
}

.product-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    display: flex;
    flex-direction: column;
    cursor: default;
}
.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.15);
}
.product-card .thumb {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    background: var(--bg-secondary);
    display: block;
}
.product-card .card-body {
    padding: 10px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.product-card .card-title {
    font-size: 0.8em;
    font-weight: 500;
    line-height: 1.35;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.product-card .card-meta {
    font-size: 0.72em;
    color: var(--text-muted);
    margin-top: 2px;
}
.product-card .card-footer {
    padding: 8px 12px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 6px;
}
.product-card .btn-post {
    flex: 1;
    padding: 6px;
    background: #111111;
    border: none;
    border-radius: 4px;
    color: #ffffff;
    font-size: 0.75em;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
}
.product-card .btn-post:hover { opacity: 0.85; }
.product-card .btn-post:disabled { opacity: 0.4; cursor: not-allowed; }
.product-card .badge-sample {
    background: rgba(0,0,0,0.05);
    color: #555555;
    font-size: 0.68em;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 600;
    white-space: nowrap;
    align-self: center;
    border: 1px solid rgba(0,0,0,0.08);
}
.product-card .badge-floor {
    background: rgba(0,0,0,0.03);
    color: #888888;
    font-size: 0.68em;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    align-self: center;
    border: 1px solid rgba(0,0,0,0.06);
}

/* ---- 商品ブラウザ サイドバー ---- */
.pb-floor-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.88em;
    color: var(--text-muted);
    transition: background 0.12s, color 0.12s;
}
.pb-floor-label:hover { background: var(--bg-secondary); color: var(--text-primary); }
.pb-floor-label input[type="radio"] { accent-color: var(--accent-blue); }

.pb-sidebar-link {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.82em;
    padding: 4px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pb-sidebar-link:hover {
    background: rgba(0,0,0,0.04);
    color: var(--text-primary);
}
.pb-sidebar-link.active {
    background: rgba(0,0,0,0.07);
    color: #111111;
    font-weight: 700;
}

/* ---- 商品ブラウザ：一覧リンク & セールリンク ---- */
.pb-list-link {
    display: block;
    font-size: 0.78em;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 3px 8px;
    border-radius: 3px;
    transition: background 0.12s;
}
.pb-list-link:hover {
    background: rgba(0,0,0,0.04);
    text-decoration: underline;
    color: var(--text-primary);
}

.pb-sale-link {
    display: block;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.82em;
    padding: 4px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.12s, color 0.12s;
}
.pb-sale-link:hover {
    background: rgba(249,115,22,0.1);
    color: #f97316;
}

/* ---- 動画プレビューボタン ---- */
.btn-preview {
    background: rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.1);
    color: var(--text-secondary);
    padding: 7px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 600;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-preview:hover {
    background: rgba(0,0,0,0.08);
    border-color: rgba(0,0,0,0.18);
    color: var(--text-primary);
}

/* ============================================================
   🔍 全体的な視認性・文字サイズ向上ルール (Accessibility & Typography Boost)
   ============================================================ */
th {
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
}

td {
    font-size: 0.92rem !important;
    line-height: 1.45;
}

/* 小さすぎるマイクロテキスト（0.7em〜0.78em）の可読性底上げ */
[style*="font-size:0.7em"],
[style*="font-size: 0.7em"],
[style*="font-size:0.72em"],
[style*="font-size: 0.72em"],
[style*="font-size:0.73em"],
[style*="font-size: 0.73em"],
[style*="font-size:0.75em"],
[style*="font-size: 0.75em"],
[style*="font-size:0.78em"],
[style*="font-size: 0.78em"] {
    font-size: 0.85em !important;
}

[style*="font-size:0.8em"],
[style*="font-size: 0.8em"] {
    font-size: 0.88em !important;
}

/* テーブル内の操作ボタン・バッジ */
td button, td .badge {
    font-size: 0.84rem !important;
    padding: 5px 10px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
}

/* 入力フォーム・セレクトボックスの見やすさ強化 */
.form-input, .setting-input, select, textarea {
    font-size: 0.95rem !important;
    padding: 9px 13px !important;
    border-radius: 6px !important;
}

.form-label, label {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
}

