/* ═══════════════════════════════════════════════════════════════
   DC1 Unified Access — DigiCert ONE-aligned styles
   ═══════════════════════════════════════════════════════════════ */

:root {
    /* DigiCert brand palette */
    --dc-blue:        #0C5FCD;
    --dc-blue-dark:   #0A4FA8;
    --dc-blue-darker: #083D82;
    --dc-blue-light:  #E8F0FE;
    --dc-blue-50:     #F0F6FF;
    --dc-navy:        #1B2A4A;
    --dc-white:       #FFFFFF;
    --dc-gray-50:     #F8F9FA;
    --dc-gray-100:    #F1F3F5;
    --dc-gray-200:    #E9ECEF;
    --dc-gray-300:    #DEE2E6;
    --dc-gray-400:    #ADB5BD;
    --dc-gray-500:    #6C757D;
    --dc-gray-600:    #495057;
    --dc-gray-700:    #343A40;
    --dc-gray-800:    #212529;

    /* Status */
    --dc-green:   #1B8A5A;
    --dc-yellow:  #E6A817;
    --dc-orange:  #E67E22;
    --dc-red:     #D63031;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed: 64px;
    --topbar-height: 56px;

    /* Transitions */
    --transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--dc-gray-50);
    color: var(--dc-gray-800);
    line-height: 1.5;
    overflow-x: hidden;
}

a { color: var(--dc-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Login Page ──────────────────────────────────────────────── */

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0C5FCD 0%, #083D82 50%, #1B2A4A 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(12, 95, 205, 0.3) 0%, transparent 50%),
                radial-gradient(ellipse at 70% 80%, rgba(27, 138, 90, 0.15) 0%, transparent 50%);
    animation: loginBgShift 20s ease-in-out infinite alternate;
}

@keyframes loginBgShift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-5%, 3%) rotate(2deg); }
}

.login-card {
    position: relative;
    background: var(--dc-white);
    border-radius: 12px;
    padding: 48px 40px 40px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    text-align: center;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--dc-blue);
    color: white;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 10px 24px;
    border-radius: 6px;
    margin-bottom: 28px;
}

.login-card h1 {
    font-size: 22px;
    font-weight: 600;
    color: var(--dc-gray-800);
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--dc-gray-500);
    font-size: 14px;
    margin-bottom: 32px;
}

.login-form .form-group {
    text-align: left;
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dc-gray-700);
    margin-bottom: 6px;
}

.login-form input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--dc-gray-300);
    border-radius: 6px;
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

.login-form input:focus {
    border-color: var(--dc-blue);
    box-shadow: 0 0 0 3px rgba(12, 95, 205, 0.15);
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: var(--dc-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 8px;
}

.login-btn:hover { background: var(--dc-blue-dark); }
.login-btn:active { transform: scale(0.98); }

.login-error {
    background: #FEF0F0;
    color: var(--dc-red);
    border: 1px solid #FECACA;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    margin-bottom: 16px;
}

.login-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--dc-gray-200);
    font-size: 12px;
    color: var(--dc-gray-400);
}

.login-footer a {
    color: var(--dc-gray-500);
    margin: 0 8px;
}

/* ── Layout Shell ────────────────────────────────────────────── */

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

/* ── Sidebar ─────────────────────────────────────────────────── */

.sidebar {
    width: var(--sidebar-width);
    background: var(--dc-navy);
    color: var(--dc-white);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: var(--topbar-height);
}

.sidebar-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--dc-blue);
    color: white;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 6px 14px;
    border-radius: 4px;
    white-space: nowrap;
}

.sidebar-brand {
    font-size: 13px;
    opacity: 0.7;
    white-space: nowrap;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.nav-section {
    padding: 4px 16px;
    margin-top: 16px;
}

.nav-section-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.35);
    margin-bottom: 8px;
    padding: 0 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: rgba(255,255,255,0.65);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
    text-decoration: none;
}

.nav-item:hover {
    color: var(--dc-white);
    background: rgba(255,255,255,0.06);
    text-decoration: none;
}

.nav-item.active {
    color: var(--dc-white);
    background: rgba(12, 95, 205, 0.25);
    border-left-color: var(--dc-blue);
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--dc-red);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--dc-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

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

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-org {
    font-size: 11px;
    color: rgba(255,255,255,0.45);
}

/* ── Main Content ────────────────────────────────────────────── */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── Topbar ──────────────────────────────────────────────────── */

.topbar {
    height: var(--topbar-height);
    background: var(--dc-white);
    border-bottom: 1px solid var(--dc-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar-left h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dc-gray-800);
}

.topbar-breadcrumb {
    font-size: 12px;
    color: var(--dc-gray-400);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--dc-gray-500);
    transition: var(--transition);
    position: relative;
}

.topbar-btn:hover {
    background: var(--dc-gray-100);
    color: var(--dc-gray-700);
}

.topbar-btn .dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--dc-red);
    border-radius: 50%;
    border: 2px solid var(--dc-white);
}

/* ── Page Content ────────────────────────────────────────────── */

.page-content {
    flex: 1;
    padding: 28px;
}

/* ── Dashboard Stats ─────────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--dc-white);
    border-radius: 10px;
    padding: 22px;
    border: 1px solid var(--dc-gray-200);
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--dc-blue);
    box-shadow: 0 2px 12px rgba(12, 95, 205, 0.08);
}

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

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card-icon svg {
    width: 20px;
    height: 20px;
}

.stat-card-icon.blue   { background: var(--dc-blue-light); color: var(--dc-blue); }
.stat-card-icon.green  { background: #E8F5E9; color: var(--dc-green); }
.stat-card-icon.orange { background: #FFF3E0; color: var(--dc-orange); }
.stat-card-icon.red    { background: #FFEBEE; color: var(--dc-red); }

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--dc-gray-800);
    line-height: 1;
}

.stat-label {
    font-size: 13px;
    color: var(--dc-gray-500);
    margin-top: 4px;
}

.stat-trend {
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}

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

/* ── Cards / Sections ────────────────────────────────────────── */

.card {
    background: var(--dc-white);
    border-radius: 10px;
    border: 1px solid var(--dc-gray-200);
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--dc-gray-200);
}

.card-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--dc-gray-800);
}

.card-body {
    padding: 22px;
}

/* ── Content Grid ────────────────────────────────────────────── */

.content-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 24px;
}

@media (max-width: 1200px) {
    .content-grid { grid-template-columns: 1fr; }
}

/* ── Instance Cards ──────────────────────────────────────────── */

.instance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.instance-card {
    background: var(--dc-white);
    border: 1px solid var(--dc-gray-200);
    border-radius: 10px;
    padding: 20px;
    transition: var(--transition);
    cursor: pointer;
}

.instance-card:hover {
    border-color: var(--dc-blue);
    box-shadow: 0 4px 16px rgba(12, 95, 205, 0.1);
    transform: translateY(-1px);
}

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

.instance-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.instance-flag {
    font-size: 24px;
}

.instance-name h4 {
    font-size: 16px;
    font-weight: 600;
}

.instance-name .region {
    font-size: 12px;
    color: var(--dc-gray-500);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: capitalize;
}

.status-badge.healthy {
    background: #E8F5E9;
    color: var(--dc-green);
}

.status-badge.degraded {
    background: #FFF3E0;
    color: var(--dc-orange);
}

.status-badge.maintenance {
    background: var(--dc-gray-100);
    color: var(--dc-gray-500);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.healthy    { background: var(--dc-green); }
.status-dot.degraded   { background: var(--dc-orange); }
.status-dot.maintenance { background: var(--dc-gray-400); }

.instance-regulations {
    font-size: 12px;
    color: var(--dc-gray-500);
    margin-bottom: 14px;
}

.instance-regulations strong {
    color: var(--dc-gray-600);
}

.instance-managers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.manager-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    background: var(--dc-blue-50);
    color: var(--dc-blue);
}

/* ── Manager Cards ───────────────────────────────────────────── */

.manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 16px;
}

.manager-card {
    background: var(--dc-white);
    border: 1px solid var(--dc-gray-200);
    border-radius: 10px;
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.manager-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.manager-card:hover {
    border-color: var(--dc-gray-300);
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.manager-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.manager-card-icon svg {
    width: 24px;
    height: 24px;
    color: white;
}

.manager-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.manager-card .code {
    font-size: 12px;
    color: var(--dc-gray-400);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.manager-card .manager-instances {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--dc-gray-100);
    font-size: 13px;
    color: var(--dc-gray-500);
}

/* ── Notifications ───────────────────────────────────────────── */

.notification-list {
    display: flex;
    flex-direction: column;
}

.notification-item {
    display: flex;
    gap: 14px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--dc-gray-100);
    transition: var(--transition);
    cursor: pointer;
}

.notification-item:hover {
    background: var(--dc-gray-50);
}

.notification-item.unread {
    background: var(--dc-blue-50);
}

.notification-item.unread:hover {
    background: var(--dc-blue-light);
}

.notif-severity {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.notif-severity.error   { background: #FFEBEE; color: var(--dc-red); }
.notif-severity.warning { background: #FFF3E0; color: var(--dc-orange); }
.notif-severity.success { background: #E8F5E9; color: var(--dc-green); }
.notif-severity.info    { background: var(--dc-blue-light); color: var(--dc-blue); }

.notif-severity svg { width: 18px; height: 18px; }

.notif-content { flex: 1; min-width: 0; }

.notif-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--dc-gray-800);
    margin-bottom: 2px;
}

.notif-body {
    font-size: 12px;
    color: var(--dc-gray-500);
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
}

.notif-source {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    border-radius: 3px;
    font-weight: 600;
    color: white;
    font-size: 10px;
}

.notif-instance {
    color: var(--dc-gray-400);
}

.notif-time {
    color: var(--dc-gray-400);
    margin-left: auto;
}

/* ── Users Table ─────────────────────────────────────────────── */

.users-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.users-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dc-gray-500);
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--dc-gray-200);
    position: sticky;
    top: 0;
    background: var(--dc-white);
}

.users-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--dc-gray-100);
    font-size: 13px;
    vertical-align: middle;
}

.users-table tr:hover td {
    background: var(--dc-gray-50);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--dc-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-avatar.invited {
    background: var(--dc-gray-300);
    color: var(--dc-gray-600);
}

.user-name {
    font-weight: 600;
    color: var(--dc-gray-800);
}

.user-email {
    font-size: 12px;
    color: var(--dc-gray-400);
}

.role-badge {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.role-badge.admin    { background: #FFF3E0; color: var(--dc-orange); }
.role-badge.manager  { background: var(--dc-blue-light); color: var(--dc-blue); }
.role-badge.operator { background: #E8F5E9; color: var(--dc-green); }
.role-badge.auditor  { background: #F3E5F5; color: #8E44AD; }
.role-badge.readonly { background: var(--dc-gray-100); color: var(--dc-gray-600); }

.access-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.access-pill {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    background: var(--dc-gray-100);
    color: var(--dc-gray-600);
}

.user-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
}

.user-status.active  { color: var(--dc-green); }
.user-status.invited { color: var(--dc-gray-400); }

/* ── Settings Page ───────────────────────────────────────────── */

.settings-section {
    margin-bottom: 28px;
}

.settings-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.settings-section p {
    font-size: 13px;
    color: var(--dc-gray-500);
    margin-bottom: 16px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--dc-white);
    border: 1px solid var(--dc-gray-200);
    border-radius: 8px;
}

.settings-item-label {
    font-size: 14px;
    font-weight: 500;
}

.settings-item-desc {
    font-size: 12px;
    color: var(--dc-gray-500);
}

/* Toggle switch */
.toggle {
    width: 44px;
    height: 24px;
    background: var(--dc-gray-300);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.toggle.active {
    background: var(--dc-blue);
}

.toggle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle.active::after {
    transform: translateX(20px);
}

/* ── Notification Panel (sidebar slide-out) ───────────────────── */

.notif-panel {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    height: 100vh;
    background: var(--dc-white);
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    z-index: 200;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.notif-panel.open {
    right: 0;
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--dc-gray-200);
}

.notif-panel-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.notif-panel-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--dc-gray-100);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dc-gray-600);
    transition: var(--transition);
}

.notif-panel-close:hover {
    background: var(--dc-gray-200);
}

.notif-panel-filters {
    display: flex;
    gap: 6px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--dc-gray-100);
    overflow-x: auto;
}

.notif-filter {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: var(--dc-gray-100);
    color: var(--dc-gray-600);
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition);
}

.notif-filter.active {
    background: var(--dc-blue);
    color: white;
}

.notif-filter:hover:not(.active) {
    background: var(--dc-gray-200);
}

.notif-panel-body {
    flex: 1;
    overflow-y: auto;
}

.notif-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.notif-panel-overlay.open {
    opacity: 1;
    pointer-events: all;
}

/* ── Buttons ─────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--dc-blue);
    color: white;
}

.btn-primary:hover { background: var(--dc-blue-dark); }

.btn-outline {
    background: transparent;
    color: var(--dc-gray-600);
    border: 1px solid var(--dc-gray-300);
}

.btn-outline:hover {
    background: var(--dc-gray-100);
    border-color: var(--dc-gray-400);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* ── Empty States ────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--dc-gray-400);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state h4 {
    font-size: 16px;
    color: var(--dc-gray-600);
    margin-bottom: 6px;
}

/* ── Utility ─────────────────────────────────────────────────── */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--dc-gray-500); }

/* ── Modal ───────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    background: var(--dc-white);
    border-radius: 12px;
    width: 520px;
    max-width: 92vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    transform: translateY(20px);
    transition: transform 0.2s ease;
}

.modal-overlay.open .modal-card {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid var(--dc-gray-200);
}

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

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--dc-gray-200);
}

/* ── Popup ───────────────────────────────────────────────────── */

.popup-card {
    position: absolute;
    z-index: 250;
    background: var(--dc-white);
    border: 1px solid var(--dc-gray-200);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 260px;
    max-width: 340px;
}

.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--dc-gray-100);
    font-size: 13px;
}

#popup-body {
    padding: 10px 16px 14px;
}

/* ── Toast ───────────────────────────────────────────────────── */

.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--dc-navy);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    z-index: 400;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ── Clickable instance pills ────────────────────────────────── */

.instance-pill.clickable {
    cursor: pointer;
    transition: var(--transition);
}

.instance-pill.clickable:hover {
    background: var(--dc-blue-light);
    color: var(--dc-blue);
}

/* ── Section Labels ───────────────────────────────────────────── */

.section-label {
    font-size: 13px;
    color: var(--dc-gray-500);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    font-weight: 600;
}

/* ── CC-specific pills ───────────────────────────────────────── */

.cc-pill {
    background: #EBF0F5 !important;
    color: #2C3E50 !important;
    font-weight: 600;
}

.cc-card {
    border-left: 3px solid #2C3E50;
}

/* ── Form elements (modals) ──────────────────────────────────── */

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--dc-gray-700);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--dc-gray-300);
    border-radius: 6px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    transition: var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--dc-blue);
    box-shadow: 0 0 0 3px rgba(12, 95, 205, 0.15);
}

.form-textarea {
    resize: vertical;
}

/* ── Responsive ──────────────────────────────────────────────── */

@media (max-width: 768px) {
    .sidebar { width: var(--sidebar-collapsed); }
    .sidebar .sidebar-brand,
    .sidebar .nav-item span,
    .sidebar .nav-section-label,
    .sidebar .sidebar-user-info { display: none; }
    .sidebar .sidebar-logo { font-size: 12px; padding: 6px 8px; }
    .main-content { margin-left: var(--sidebar-collapsed); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .instance-grid { grid-template-columns: 1fr; }
    .modal-card { width: 95vw; }
}

