/* Admin Layout */
.admin-layout {
    min-height: 100vh;
    background: #f8f9fa;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

.env-banner {
    width: 100%;
    padding: 6px 16px;
    font-size: 0.82rem;
    font-weight: 600;
    text-align: center;
    color: #fff;
    letter-spacing: 0.3px;
}
.env-banner-prod { background: #1a56db; }
.env-banner-test { background: #d97706; }

/* Sidebar */
.sidebar {
    width: 240px;
    min-width: 240px;
    background: #1e293b;
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #334155;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-icon { font-size: 1.4rem; }
.sidebar-title { font-weight: 700; font-size: 0.95rem; color: #f1f5f9; }

.sidebar-menu {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.sidebar-section-label {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0.2px;
    padding: 16px 16px 4px;
}

.sidebar-section-label.sl-api   { color: #38bdf8; }
.sidebar-section-label.sl-sec   { color: #f59e0b; }
.sidebar-section-label.sl-mon   { color: #34d399; }
.sidebar-section-label.sl-gov   { color: #c084fc; }
.sidebar-section-label.sl-sys   { color: #fb7185; }

.sidebar-link {
    display: flex;
    align-items: center;
    padding: 9px 16px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 1rem;
    border-left: 3px solid transparent;
    transition: all 0.15s ease;
}

.sidebar-link:hover {
    background: #334155;
    color: #f1f5f9;
    text-decoration: none;
}

.sidebar-link.active {
    background: #1e3a5f;
    color: #60a5fa;
    border-left-color: #3b82f6;
    font-weight: 600;
}

.nav-label { flex: 1; }


/* Main Content */
.main-content {
    padding: 24px;
    background: #f8f9fa;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: -8px 0 20px;
}

.login-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    color: #334155;
    font-size: 0.84rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.login-status .user-email {
    font-weight: 700;
    color: #1e293b;
}

.idle-countdown {
    padding-left: 10px;
    border-left: 1px solid #e2e8f0;
    color: #b45309;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
}

.btn-pwd-topbar {
    margin-left: 4px;
    padding: 4px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1d4ed8;
    background: transparent;
    border: 1px solid #1d4ed8;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.btn-pwd-topbar:hover { background: #1d4ed8; color: #fff; }

.btn-logout-topbar {
    margin-left: 4px;
    padding: 4px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #dc2626;
    background: transparent;
    border: 1px solid #dc2626;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.btn-logout-topbar:hover { background: #dc2626; color: #fff; }

/* SystemConfig 環境 badge */
.env-badge-prod { background: #dbeafe; color: #1e40af; }
.env-badge-test { background: #fef3c7; color: #92400e; }

.login-only-layout {
    min-height: 100vh;
    background: #f8f9fa;
}

/* Page Title */
.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 0.875rem;
    color: #64748b;
    margin-bottom: 20px;
}

/* Cards */
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.stat-card-value { font-size: 2rem; font-weight: 800; }
.stat-card-label { font-size: 0.8rem; color: #64748b; font-weight: 500; margin-top: 4px; }

/* Tables */
.admin-table {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.admin-table table { margin: 0; }
.admin-table .table th {
    background: #f1f5f9;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    padding: 10px 12px;
}

.admin-table .table td {
    font-size: 0.95rem;
    padding: 10px 12px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.admin-table .table tbody tr:hover { background: #f8fafc; }

/* Badges — 全站統一大小 */
.badge {
    font-size: 0.82rem !important;
    padding: 4px 10px !important;
    border-radius: 999px !important;
    font-weight: 600 !important;
}
.badge-active   { background: #dcfce7; color: #166534; }
.badge-inactive { background: #fee2e2; color: #991b1b; }
.badge-draft    { background: #fef9c3; color: #92400e; }
.badge-disabled { background: #f1f5f9; color: #475569; }

/* Key Mask */
.key-mask {
    font-family: 'Courier New', monospace;
    font-size: 0.82rem;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    color: #334155;
}

/* Modal */
.modal-backdrop.show { opacity: 0.5; }

/* Filter bar */
.filter-bar {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 14px 16px;
    margin-bottom: 16px;
}

/* Error/success alerts */
.alert { border-radius: 8px; }

/* Health Check badges */
.health-badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 999px;
    letter-spacing: 0.3px;
}
.health-ok   { background: #dcfce7; color: #166534; }
.health-err  { background: #fee2e2; color: #991b1b; }
.health-skip { background: #f1f5f9; color: #475569; }

/* Callback badge */
.badge-callback {
    display: inline-block;
    padding: 1px 8px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 999px;
    background: #ede9fe;
    color: #5b21b6;
}

/* Blazor error UI */
#blazor-error-ui {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}
