/* ═══ Oracle MDM Portal — Supplementary styles (extends oracle.css) ═══ */

/* ═══ 1. Navigation Toggle ═══
   MDM JS uses expanded/collapsed classes instead of oracle.css's collapsed-on-title pattern.
   These rules override oracle.css defaults to work with MDM's toggle mechanism. */
.nav-section-title:not(.expanded) .nav-section-chevron { transform: rotate(-90deg); }
.nav-section-title.expanded .nav-section-chevron { transform: rotate(0deg); }
.nav-section-items.collapsed { display: none; }

/* ═══ 2. Loading Containers ═══
   MDM JS generates loading-container/loading-text classes not present in oracle.css. */
.loading-container {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 60px 0; gap: var(--space-md);
}
.loading-text {
    font-size: 0.78rem; color: var(--text-muted);
    letter-spacing: 0.04em;
}

/* ═══ 3. Modal Action Row ═══
   MDM bodies embed action rows inside modal body (vs. shared footer). */
.modal-actions {
    display: flex; gap: var(--space-sm);
    justify-content: flex-end;
    margin-top: var(--space-lg);
}

/* ═══ 4. Platform Badges ═══ */
.platform-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 10px;
    font-size: 0.68rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.5px;
}
.platform-badge.ios     { background: var(--blue-dim);  color: var(--blue); }
.platform-badge.android { background: var(--green-dim); color: var(--green); }
.platform-badge.linux   { background: var(--amber-dim); color: var(--amber); }

/* ═══ 5. State Badges ═══ */
.state-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: 10px;
    font-size: 0.68rem; font-weight: 600;
}
.state-badge.enrolled   { background: var(--green-dim); color: var(--green); }
.state-badge.pending    { background: var(--amber-dim); color: var(--amber); }
.state-badge.unenrolled { background: var(--red-dim);   color: var(--red); }
.state-badge.disabled   { background: rgba(255,255,255,0.05); color: var(--text-muted); }

/* ═══ 6. Command Status Badges ═══ */
.cmd-badge {
    display: inline-flex; padding: 2px 8px;
    border-radius: 10px; font-size: 0.68rem; font-weight: 600;
}
.cmd-badge.completed { background: var(--green-dim);  color: var(--green); }
.cmd-badge.pending   { background: var(--amber-dim);  color: var(--amber); }
.cmd-badge.sent      { background: var(--blue-dim);   color: var(--blue); }
.cmd-badge.failed    { background: var(--red-dim);    color: var(--red); }
.cmd-badge.timed_out { background: var(--purple-dim); color: var(--purple); }

/* ═══ 7. Stat Cards (MDM naming) ═══
   MDM JS uses stat-card-label/value/sub instead of oracle.css stat-label/value/change. */
.stat-card-label {
    font-size: 0.7rem; font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.06em; text-transform: uppercase;
    margin-bottom: 6px;
}
.stat-card-value {
    font-family: var(--font-display);
    font-size: 1.6rem; font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}
.stat-card-sub {
    font-size: 0.72rem; color: var(--text-secondary);
    margin-top: 4px;
}

/* stat-card-flush: no padding, used as card wrapper */
.stat-card-flush { padding: 0; }

/* Dashboard layout helpers */
.dash-row {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: var(--space-md); margin-top: var(--space-md);
}
.dash-full { margin-top: var(--space-md); }

/* ═══ 8. Card Headers (MDM variants) ═══ */
.card-header-sm {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    font-weight: 600; font-size: 0.82rem;
}
.card-header-bar {
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    display: flex; justify-content: space-between; align-items: center;
    font-weight: 600; font-size: 0.82rem;
}
.card-body-sm { padding: var(--space-sm) var(--space-md); }

/* ═══ 9. Detail Sections (Device Details) ═══ */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
}
.detail-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: var(--space-md);
}
.detail-section-title {
    font-size: 0.7rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-subtle);
}
.detail-row {
    display: flex; justify-content: space-between;
    padding: 4px 0; font-size: 0.8rem;
}
.detail-row-label { color: var(--text-muted); }
.detail-row-value {
    font-weight: 500; color: var(--text-primary);
    text-align: right; max-width: 60%; word-break: break-all;
}

/* ═══ 10. Action Bar (MDM variant) ═══
   MDM's action-bar is a flex-wrap toolbar with background, different from oracle.css action-bar. */
.action-bar {
    display: flex; flex-wrap: wrap; gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
}

/* ═══ 11. Filter Bar (MDM overrides) ═══ */
.filter-bar .form-input,
.filter-bar .form-select {
    min-width: 140px;
}

/* ═══ 12. Column Utilities (tables) ═══ */
.data-table .text-center { text-align: center; }
.data-table .text-right  { text-align: right; }
.data-table .col-actions { text-align: center; white-space: nowrap; }
.data-table .col-num     { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .col-id      { font-family: var(--font-mono); font-size: 0.72rem; }
.data-table .col-mono    { font-family: var(--font-mono); font-size: 0.72rem; }

/* ═══ 13. Empty States (table-level) ═══ */
.table-empty { text-align: center; color: var(--text-muted); padding: var(--space-lg); }
.tab-empty   { text-align: center; padding: var(--space-md); color: var(--text-muted); }

.empty-state-title {
    font-size: 0.88rem; font-weight: 600;
    margin-bottom: 4px; color: var(--text-primary);
}
.empty-state-text { font-size: 0.8rem; }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.4; }

/* ═══ 14. Notification Bell & Dropdown ═══ */
.notif-badge {
    position: absolute; top: 2px; right: 2px;
    background: var(--red); color: #fff;
    font-size: 0.6rem; font-weight: 700;
    min-width: 14px; height: 14px; line-height: 14px;
    text-align: center; border-radius: 7px;
    padding: 0 3px; pointer-events: none;
}
.notif-dropdown {
    position: absolute; right: 0; top: 100%;
    margin-top: 6px; width: 320px; max-height: 400px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
    z-index: 200; display: flex; flex-direction: column;
    overflow: hidden;
}
.notif-dropdown-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-default);
}
.notif-dropdown-list { flex: 1; overflow-y: auto; max-height: 300px; }
.notif-dropdown-footer {
    padding: var(--space-sm) var(--space-md);
    border-top: 1px solid var(--border-default);
    text-align: center;
}
.notif-empty {
    padding: var(--space-lg); text-align: center;
    color: var(--text-muted); font-size: 0.8rem;
}
.notif-item {
    display: flex; align-items: flex-start; gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer; transition: background 0.12s;
    font-size: 0.78rem;
}
.notif-item:hover { background: var(--bg-hover); }
.notif-item-icon {
    flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
}
.notif-item-icon.info     { background: var(--blue-dim);  color: var(--blue); }
.notif-item-icon.warning  { background: var(--amber-dim); color: var(--amber); }
.notif-item-icon.critical { background: var(--red-dim);   color: var(--red); }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title {
    font-size: 0.78rem; font-weight: 500; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-item-time {
    font-size: 0.68rem; color: var(--text-muted); margin-top: 2px;
}
.notif-item-dismiss {
    flex-shrink: 0; cursor: pointer; opacity: 0.4;
    transition: opacity 0.15s;
    background: none; border: none; color: var(--text-muted); padding: 2px;
}
.notif-item-dismiss:hover { opacity: 1; }

/* ═══ 15. Notification Page Tabs ═══ */
.notif-tabs {
    display: flex; gap: 0;
    border-bottom: 1px solid var(--border-default);
    margin-bottom: var(--space-lg);
}
.notif-tab {
    padding: 10px var(--space-lg);
    font-size: 0.8rem; font-weight: 500;
    color: var(--text-muted); cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px; transition: all 0.15s;
    background: none; border-top: none; border-left: none; border-right: none;
}
.notif-tab:hover { color: var(--text-secondary); }
.notif-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ═══ 16. Form Select Dropdown Arrow ═══ */
.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238B8B96' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

/* ═══ 17. Form Label — Required Indicator ═══ */
.form-label.required::after { content: '*'; color: var(--red); margin-left: 2px; }

/* ═══ 18. Responsive ═══ */
@media (max-width: 768px) {
    .dash-row { grid-template-columns: 1fr; }
}
