/**
 * OFFICELESS OS - MODULE-SPECIFIC STYLING
 * Part 3: Dashboard, Analytics, Agents, Notebook, Time Clock, and all 19 modules
 */

/* ═══════════════ DASHBOARD GRID ═══════════════ */
.dashboard {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
    padding: var(--space-6);
}

.dashboard__widget {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-6);
    overflow: hidden;
}

.dashboard__widget--span-2 {
    grid-column: span 2;
}

.dashboard__widget--span-3 {
    grid-column: span 3;
}

.dashboard__widget--span-4 {
    grid-column: span 4;
}

.dashboard__widget--tall {
    grid-row: span 2;
}

/* ═══════════════ METRICS CARD ═══════════════ */
.metric-card {
    position: relative;
    overflow: hidden;
}

.metric-card__icon {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    opacity: 0.1;
    transition: opacity var(--duration-normal) var(--ease-default);
}

.metric-card:hover .metric-card__icon {
    opacity: 0.2;
}

.metric-card__label {
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tracking-widest);
    color: var(--neutral-400);
    margin-bottom: var(--space-2);
}

.metric-card__value {
    font-family: var(--font-serif);
    font-size: var(--text-3xl);
    color: var(--portal-accent);
}

.metric-card__trend {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    font-size: var(--text-xs);
    margin-top: var(--space-2);
}

.metric-card__trend--up {
    color: var(--color-success);
}

.metric-card__trend--down {
    color: var(--color-error);
}

/* ═══════════════ AGENT CARDS ═══════════════ */
.agent-hierarchy {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

.agent-tier {
    margin-bottom: var(--space-6);
}

.agent-tier__title {
    font-family: var(--font-serif);
    font-size: var(--text-xl);
    font-style: italic;
    color: var(--neutral-700);
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 1px solid var(--neutral-200);
}

.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-4);
}

.agent-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-5);
    transition: all var(--duration-normal) var(--ease-default);
}

.agent-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.agent-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.agent-card__status {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    animation: pulse 2s infinite;
}

.agent-card__status--active {
    background: var(--color-success);
}

.agent-card__status--idle {
    background: var(--neutral-400);
}

.agent-card__status--warning {
    background: var(--color-warning);
}

.agent-card__name {
    font-family: var(--font-serif);
    font-size: var(--text-lg);
    color: var(--neutral-800);
}

.agent-card__role {
    font-size: var(--text-sm);
    color: var(--neutral-500);
}

.agent-card__stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--neutral-100);
}

.agent-card__stat-label {
    font-size: var(--text-xs);
    color: var(--neutral-400);
}

.agent-card__stat-value {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    color: var(--neutral-700);
}

/* ═══════════════ NOTEBOOK (NotebookLM) ═══════════════ */
.notebook-workspace {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: var(--space-4);
    height: calc(100vh - var(--header-height) - var(--ticker-height));
}

.notebook-sources {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-2xl);
    padding: var(--space-4);
    overflow-y: auto;
}

.notebook-sources__title {
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--neutral-500);
    margin-bottom: var(--space-4);
}

.source-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: background var(--duration-fast);
}

.source-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.source-item--selected {
    background: var(--portal-primary-bg);
}

.source-item__icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--neutral-100);
    border-radius: var(--radius-md);
}

.source-item__name {
    font-size: var(--text-sm);
    color: var(--neutral-700);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.source-item__type {
    font-size: var(--text-xs);
    color: var(--neutral-400);
}

.notebook-chat {
    background: white;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-2xl);
    display: flex;
    flex-direction: column;
}

.notebook-chat__messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-6);
}

.chat-message {
    margin-bottom: var(--space-4);
    max-width: 85%;
}

.chat-message--user {
    margin-left: auto;
    background: var(--ofls-purple);
    color: white;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 var(--radius-2xl);
    padding: var(--space-3) var(--space-4);
}

.chat-message--assistant {
    background: var(--neutral-100);
    border-radius: var(--radius-2xl) var(--radius-2xl) var(--radius-2xl) 0;
    padding: var(--space-4);
}

.chat-message__citation {
    display: inline;
    font-size: var(--text-xs);
    color: var(--ofls-indigo);
    background: rgba(79, 70, 229, 0.1);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.chat-message__citation:hover {
    background: rgba(79, 70, 229, 0.2);
}

.notebook-chat__input {
    padding: var(--space-4);
    border-top: 1px solid var(--neutral-200);
}

.notebook-studio {
    background: var(--neutral-50);
    border-radius: var(--radius-2xl);
    padding: var(--space-4);
}

.studio-artifact-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-3);
    background: white;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-2);
    cursor: pointer;
    transition: all var(--duration-fast);
}

.studio-artifact-btn:hover {
    border-color: var(--ofls-purple);
    background: rgba(108, 29, 255, 0.05);
}

/* ═══════════════ TIME CLOCK ═══════════════ */
.timeclock {
    max-width: 600px;
    margin: 0 auto;
}

.timeclock__display {
    text-align: center;
    padding: var(--space-10);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-3xl);
    margin-bottom: var(--space-6);
}

.timeclock__time {
    font-family: var(--font-mono);
    font-size: var(--text-5xl);
    font-weight: 300;
    color: var(--neutral-800);
}

.timeclock__status {
    font-size: var(--text-lg);
    color: var(--neutral-500);
    margin-top: var(--space-2);
}

.timeclock__status--clocked-in {
    color: var(--color-success);
}

.timeclock__actions {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
}

.timeclock__btn {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
    border-radius: var(--radius-2xl);
}

.timeclock__btn--in {
    background: var(--color-success);
    color: white;
}

.timeclock__btn--out {
    background: var(--color-error);
    color: white;
}

.timesheet-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.timesheet-table th,
.timesheet-table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--neutral-100);
}

.timesheet-table th {
    background: var(--neutral-50);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: var(--tracking-wide);
    color: var(--neutral-500);
}

/* ═══════════════ PORTAL GENERATOR ═══════════════ */
.portal-builder {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--space-6);
    height: 100%;
}

.portal-builder__sidebar {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-2xl);
    padding: var(--space-4);
}

.portal-builder__preview {
    background: white;
    border: 1px solid var(--neutral-200);
    border-radius: var(--radius-2xl);
    overflow: hidden;
}

.portal-preview-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* ═══════════════ LEGAL / COMPLIANCE ═══════════════ */
.compliance-dashboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

.compliance-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-2xl);
    padding: var(--space-6);
}

.compliance-card__status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
}

.compliance-card__status--pass {
    background: rgba(16, 185, 129, 0.1);
    color: var(--color-success);
}

.compliance-card__status--fail {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

.compliance-card__status--warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
}

/* ═══════════════ WHITELABEL ═══════════════ */
.brand-preview {
    padding: var(--space-6);
    border-radius: var(--radius-2xl);
    background: var(--glass-bg);
}

.brand-preview__logo {
    max-height: 48px;
    margin-bottom: var(--space-4);
}

.color-swatch {
    display: inline-block;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: 2px solid white;
    box-shadow: var(--shadow-sm);
}

/* ═══════════════ ANIMATIONS ═══════════════ */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blob {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

.animate-fadeIn {
    animation: fadeIn var(--duration-normal) var(--ease-out);
}

.animate-slideUp {
    animation: slideUp var(--duration-slow) var(--ease-spring);
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-blob {
    animation: blob 7s infinite;
}

/* ═══════════════ UTILITIES ═══════════════ */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: var(--space-2);
}

.gap-4 {
    gap: var(--space-4);
}

.gap-6 {
    gap: var(--space-6);
}

.p-4 {
    padding: var(--space-4);
}

.p-6 {
    padding: var(--space-6);
}

.mt-4 {
    margin-top: var(--space-4);
}

.mb-4 {
    margin-bottom: var(--space-4);
}

.rounded-xl {
    border-radius: var(--radius-xl);
}

.rounded-2xl {
    border-radius: var(--radius-2xl);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.shadow-xl {
    box-shadow: var(--shadow-xl);
}