/* Shared dashboard styles — included from app_base.html */

.container {
    padding: 2rem;
    max-width: none;
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h3 {
    color: var(--accent-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.card-body {
    padding: 1.5rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    color: var(--accent-color);
}

.sort-icon::after {
    content: '\21C5';
    opacity: 0.3;
    margin-left: 0.25rem;
    font-size: 0.75rem;
}

.sortable.asc .sort-icon::after {
    content: '\2191';
    opacity: 1;
}

.sortable.desc .sort-icon::after {
    content: '\2193';
    opacity: 1;
}

.table-search {
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(var(--accent-rgb), 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: inherit;
    font-size: 0.8125rem;
    outline: none;
    width: 14rem;
}

html[data-theme="light"] .table-search {
    background: rgba(243, 244, 246, 0.5);
}

.table-search:focus {
    border-color: var(--accent-color);
}

.table-search::placeholder {
    opacity: 0.5;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(var(--accent-rgb), 0.2);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Detail page shared styles --- */

.detail-header {
    background: transparent;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.2);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
}

html[data-theme="dark"] .detail-header {
    background: rgba(10, 10, 10, 0.8);
}

html[data-theme="light"] .detail-header {
    background: rgba(255, 255, 255, 0.8);
}

.detail-header h1 {
    color: var(--accent-color);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.breadcrumb a {
    color: var(--accent-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    opacity: 0.5;
}

.info-table {
    width: 100%;
}

.info-table th {
    text-align: left;
    padding: 0.5rem 0;
    opacity: 0.7;
    font-weight: 500;
    width: 40%;
}

.info-table td {
    padding: 0.5rem 0;
}

/* Type pill — small colored label for workspace / status type */
.type-pill {
    display: inline-block;
    width: 3.2rem;
    text-align: center;
    font-size: 0.55rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 0.1rem 0;
    border-radius: 10px;
    flex-shrink: 0;
    box-sizing: border-box;
    cursor: default;
}

.type-pill.project {
    background: #10b981;
    color: #fff;
}

.type-pill.media {
    background: #8b5cf6;
    color: #fff;
}

.type-pill.config {
    background: #f59e0b;
    color: #fff;
}

.type-pill.firmware {
    background: #3b82f6;
    color: #fff;
}

.type-pill.online {
    background: #10b981;
    color: #fff;
}

.type-pill.offline {
    background: #6b7280;
    color: #fff;
}

/* Workspace list item */
.ws-item {
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid transparent;
    transition: opacity 0.3s ease, padding 0.3s ease;
}

.ws-item.type-project {
    background: rgba(var(--accent-rgb), 0.05);
    border-left-color: #10b981;
}

.ws-item.type-media {
    background: rgba(var(--accent-rgb), 0.05);
    border-left-color: #8b5cf6;
}

.ws-item.type-config {
    background: rgba(var(--accent-rgb), 0.05);
    border-left-color: #f59e0b;
}

.ws-item.type-firmware {
    background: rgba(var(--accent-rgb), 0.05);
    border-left-color: #3b82f6;
}

/* Production group — collapsible container */
.prod-group {
    margin-bottom: 0.5rem;
    border-radius: 8px;
    overflow: hidden;
}

.prod-group-header {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    border-radius: 6px;
    background: rgba(var(--accent-rgb), 0.08);
    margin-bottom: 0.25rem;
}

.prod-group-header:hover {
    background: rgba(var(--accent-rgb), 0.12);
}

.prod-group-header .group-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.prod-group-header .group-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background-color 0.3s ease;
}

.prod-group-header .group-count {
    font-size: 0.7rem;
    opacity: 0.45;
    font-weight: 400;
}


.prod-group-header .chevron {
    transition: transform 0.2s ease;
    opacity: 0.4;
    font-size: 0.7rem;
}

.prod-group.collapsed .chevron {
    transform: rotate(-90deg);
}

.prod-group.collapsed .prod-group-content {
    display: none;
}

.prod-group-content {
    padding: 0.15rem 0 0.15rem 1.25rem;
}

/* Icon-only action button */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 4px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s ease, background 0.15s ease;
    color: inherit;
}

.icon-btn:hover {
    opacity: 1;
    background: rgba(var(--accent-rgb), 0.1);
}

.icon-btn svg {
    width: 0.85rem;
    height: 0.85rem;
    display: block;
}

/* Device list item (production page) */
.device-item {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    background: rgba(var(--accent-rgb), 0.06);
    border-left: 3px solid rgba(var(--accent-rgb), 0.4);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.device-item:hover {
    background: rgba(var(--accent-rgb), 0.12);
}

.device-item.portal {
    background: rgba(245, 158, 11, 0.06);
    border-left-color: rgba(245, 158, 11, 0.4);
}

.device-item.portal:hover {
    background: rgba(245, 158, 11, 0.12);
}

/* Peer device group — reuses prod-group pattern */
.peer-group {
    margin-bottom: 0.5rem;
    border-radius: 8px;
    overflow: hidden;
}

.peer-group-header {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    border-radius: 6px;
    background: rgba(var(--accent-rgb), 0.08);
    margin-bottom: 0.25rem;
}

.peer-group-header:hover {
    background: rgba(var(--accent-rgb), 0.12);
}

.peer-group-header .group-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.peer-group-header .group-count {
    font-size: 0.7rem;
    opacity: 0.45;
    font-weight: 400;
}

.peer-group-header .chevron {
    transition: transform 0.2s ease;
    opacity: 0.4;
    font-size: 0.7rem;
}

.peer-group.collapsed .chevron {
    transform: rotate(-90deg);
}

.peer-group.collapsed .peer-group-content {
    display: none;
}

.peer-group-content {
    padding: 0.15rem 0 0.15rem 1.25rem;
}

/* Section labels for Productions / Peer Devices */
.sync-section-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.4;
    margin-bottom: 0.4rem;
}

/* File download row inside a peer workspace */
.dl-file-row {
    padding: 0.1rem 0 0.1rem 1rem;
    font-size: 0.7rem;
    opacity: 0.6;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dl-file-row .dl-file-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dl-file-row .dl-file-bar {
    width: 60px;
    height: 3px;
    background: rgba(var(--accent-rgb), 0.15);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.dl-file-row .dl-file-bar-fill {
    height: 100%;
    background: var(--accent-color);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.dl-file-row .dl-file-pct {
    flex-shrink: 0;
    width: 2.5rem;
    text-align: right;
}
