/* ProviderHub.cloud — Enterprise Design System
   Healthcare credentialing. Authority without arrogance. */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ── */

:root {
    --color-primary: #0F1B2D;
    --color-primary-light: #1E293B;
    --color-accent: #0D9488;
    --color-accent-hover: #0F766E;
    --color-bg: #F8FAFC;
    --color-bg-alt: #F1F5F9;
    --color-text: #0F172A;
    --color-text-secondary: #475569;
    --color-text-muted: #64748B;
    --color-text-light: #94A3B8;
    --color-border: #E2E8F0;
    --color-border-light: #F1F5F9;
    --color-error: #DC2626;
    --color-error-bg: #FEF2F2;
    --color-error-text: #991B1B;
    --color-warning: #D97706;
    --color-warning-bg: #FFFBEB;
    --color-success: #059669;
    --color-success-bg: #D1FAE5;
    --color-success-text: #065F46;
    --color-highlight-bg: #F0FDFA;

    --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'IBM Plex Mono', monospace;

    --radius: 4px;
    --radius-lg: 6px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);

    --sidebar-width: 240px;
    --topbar-height: 60px;
}

/* ── Reset ── */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

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

img { max-width: 100%; display: block; }

/* ── Typography ── */

h1, h2, h3 { font-family: var(--font-heading); color: var(--color-primary); line-height: 1.3; }
h1 { font-size: 2rem; font-weight: 700; margin-bottom: 8px; }
h2 { font-size: 1.35rem; font-weight: 600; margin-top: 32px; margin-bottom: 12px; }
h3 { font-size: 1.1rem; font-weight: 600; margin-top: 20px; margin-bottom: 8px; }

p { margin-bottom: 16px; color: var(--color-text-secondary); }

small { font-size: 0.85rem; color: var(--color-text-muted); }

code, .mono { font-family: var(--font-mono); font-size: 0.9em; }

/* ── Topbar ── */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--color-primary);
    height: var(--topbar-height);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topbar-logo {
    font-family: var(--font-body);
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.topbar-logo span { color: var(--color-accent); }

.topbar-nav { display: flex; align-items: center; gap: 20px; }

.topbar-nav a {
    color: var(--color-text-light);
    font-size: 0.9rem;
    text-decoration: none;
}

.topbar-nav a:hover { color: #fff; text-decoration: none; }
.topbar-nav a.active { color: #fff; }

/* ── Sidebar (org layout) ── */

.layout-sidebar {
    display: flex;
    min-height: calc(100vh - var(--topbar-height));
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--color-primary);
    padding: 24px 0;
    flex-shrink: 0;
}

.sidebar-nav a {
    display: block;
    padding: 10px 24px;
    color: var(--color-text-light);
    font-size: 0.9rem;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    text-decoration: none;
}

.sidebar-nav a.active {
    color: #fff;
    border-left-color: var(--color-accent);
    background: rgba(255, 255, 255, 0.08);
}

.sidebar-section {
    padding: 8px 24px 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-top: 16px;
}

.main-content {
    flex: 1;
    padding: 40px;
    max-width: 1100px;
}

/* ── Page content (no sidebar) ── */

.page-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 24px;
}

.page-content-narrow {
    max-width: 600px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* ── Page header ── */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
}

.page-header-info p { margin-bottom: 0; }

.page-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ── Buttons ── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}

.btn:hover { text-decoration: none; }

.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-hover); }

.btn-secondary { background: var(--color-bg-alt); color: var(--color-text-secondary); }
.btn-secondary:hover { background: var(--color-border); }

.btn-dark { background: var(--color-primary); color: #fff; }
.btn-dark:hover { background: var(--color-primary-light); }

.btn-danger { background: var(--color-error); color: #fff; }
.btn-danger:hover { background: #B91C1C; }

.btn-sm { padding: 6px 12px; font-size: 0.85rem; }

.btn:disabled { background: var(--color-text-light); cursor: not-allowed; }

/* ── Forms ── */

label {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-primary-light);
}

.form-group { margin-bottom: 20px; }

input[type="text"],
input[type="email"],
input[type="search"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text);
    background: #fff;
    transition: border-color 0.15s;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

input::placeholder { color: var(--color-text-light); }

/* ── Data Tables ── */

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 12px 12px;
    border-bottom: 2px solid var(--color-border);
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.data-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: middle;
}

.data-table tbody tr:hover { background: var(--color-bg); }

.data-table tbody tr:nth-child(even) { background: var(--color-bg-alt); }
.data-table tbody tr:nth-child(even):hover { background: var(--color-border-light); }

.data-table .actions { white-space: nowrap; }

/* ── Status Badges ── */

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-active { background: var(--color-success-bg); color: var(--color-success-text); }
.badge-revoked { background: var(--color-error-bg); color: var(--color-error-text); }
.badge-pending { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-inactive { background: var(--color-bg-alt); color: var(--color-text-muted); }

/* ── Cards ── */

.card {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.card + .card { margin-top: 16px; }

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

/* ── Alerts ── */

.alert {
    padding: 14px 20px;
    border-radius: 0 var(--radius) var(--radius) 0;
    border-left: 3px solid;
    margin-bottom: 20px;
}

.alert-error { background: var(--color-error-bg); border-color: var(--color-error); color: var(--color-error-text); }
.alert-warning { background: var(--color-warning-bg); border-color: var(--color-warning); color: #92400E; }
.alert-success { background: var(--color-success-bg); border-color: var(--color-success); color: var(--color-success-text); }
.alert-info { background: var(--color-highlight-bg); border-color: var(--color-accent); color: var(--color-primary); }

.alert p { margin-bottom: 0; color: inherit; }

/* ── Empty State ── */

.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: var(--color-text-muted);
}

.empty-state p { margin-bottom: 16px; color: var(--color-text-muted); }

/* ── Stats Row ── */

.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    flex: 1;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    font-family: var(--font-body);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 4px;
}

/* ── Pagination ── */

.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 24px;
    justify-content: center;
}

.pagination a, .pagination span {
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.pagination a { background: var(--color-bg-alt); color: var(--color-text-secondary); }
.pagination a:hover { background: var(--color-border); text-decoration: none; }
.pagination .current { background: var(--color-accent); color: #fff; }

/* ── Filter Bar ── */

.filter-bar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.filter-bar .form-group { margin-bottom: 0; }

.filter-bar select,
.filter-bar input {
    width: auto;
    min-width: 160px;
}

/* ── Footer ── */

.footer {
    background: var(--color-primary);
    color: var(--color-text-light);
    padding: 40px 24px;
    text-align: center;
    font-size: 0.85rem;
}

.footer a { color: var(--color-accent); }

/* ── Utility ── */

.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.78rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.inline { display: inline; }
.flex { display: flex; }
.gap-2 { gap: 12px; }
.gap-3 { gap: 16px; }

/* ── Responsive ── */

@media (max-width: 1024px) {
    .sidebar { width: 60px; padding: 16px 0; }
    .sidebar-nav a { padding: 10px 16px; font-size: 0; }
    .sidebar-section { display: none; }
    .main-content { padding: 24px; }
    .stats-row { flex-wrap: wrap; }
    .stat-card { min-width: calc(50% - 8px); }
}

@media (max-width: 640px) {
    .layout-sidebar { flex-direction: column; }
    .sidebar { width: 100%; padding: 8px 0; display: flex; overflow-x: auto; }
    .sidebar-nav { display: flex; }
    .sidebar-nav a { white-space: nowrap; padding: 8px 16px; font-size: 0.85rem; border-left: none; border-bottom: 3px solid transparent; }
    .sidebar-nav a.active { border-bottom-color: var(--color-accent); border-left: none; }
    .sidebar-section { display: none; }
    .main-content { padding: 16px; }
    .page-content, .page-content-narrow { padding: 24px 16px; }
    .page-header { flex-direction: column; gap: 16px; }
    h1 { font-size: 1.5rem; }
    .data-table { font-size: 0.9rem; }
    .data-table th, .data-table td { padding: 10px 8px; }
    .stats-row { flex-direction: column; }
    .filter-bar { flex-direction: column; }
    .topbar { padding: 0 16px; }
    .topbar-nav { gap: 12px; }
}
