/* ==========================================================================
   RIMS Institutional Design System CSS
   ========================================================================== */

:root {
    --rims-primary: #1e3a8a;
    --rims-primary-hover: #1e40af;
    --rims-sidebar-bg: #0f172a;
    --rims-sidebar-text: #94a3b8;
    --rims-sidebar-hover: #1e293b;
    --rims-sidebar-active: #3b82f6;
    --rims-header-bg: #ffffff;
    --rims-border: #e2e8f0;
    --rims-bg-body: #f8fafc;
    --rims-card-bg: #ffffff;
    --rims-text-main: #0f172a;
    --rims-text-muted: #64748b;
    --rims-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    font-family: var(--rims-font);
    background-color: var(--rims-bg-body);
    color: var(--rims-text-main);
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
}

/* App Layout Grid */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.app-sidebar {
    width: 250px;
    background-color: var(--rims-sidebar-bg);
    color: var(--rims-sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    border-right: 1px solid #1e293b;
    z-index: 100;
}

.sidebar-header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid #1e293b;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: 0.5px;
}

.brand-badge {
    background-color: var(--rims-primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.6rem;
    font-size: 1rem;
}

.brand-subtitle {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 1px;
    margin-top: 0.25rem;
    padding-left: 2.6rem;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 0.5rem;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.75px;
    padding: 0.75rem 0.75rem 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s ease;
}

.nav-link i {
    font-size: 1.05rem;
}

.nav-link:hover {
    background-color: var(--rims-sidebar-hover);
    color: #f1f5f9;
}

.nav-link.active {
    background-color: var(--rims-primary);
    color: #ffffff;
    font-weight: 600;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid #1e293b;
    background-color: rgba(0, 0, 0, 0.2);
}

.user-profile {
    display: flex;
    align-items: center;
}

.user-meta .user-name {
    font-size: 0.82rem;
    color: #f1f5f9;
    max-width: 170px;
}

.user-meta .user-role {
    font-size: 0.65rem;
}

/* Main Area */
.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Compact Header */
.app-header {
    background-color: var(--rims-header-bg);
    border-bottom: 1px solid var(--rims-border);
    padding: 0.9rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.page-header-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--rims-text-main);
    line-height: 1.2;
}

.page-header-subtitle {
    font-size: 0.8rem;
}

.app-content {
    flex: 1;
    padding: 1.5rem;
}

.app-footer {
    background-color: var(--rims-header-bg);
    border-top: 1px solid var(--rims-border);
    padding: 0.75rem 1.5rem;
}

/* Cards */
.rims-card {
    background: var(--rims-card-bg);
    border: 1px solid var(--rims-border);
    border-radius: 8px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    margin-bottom: 1.25rem;
}

.rims-card-header {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--rims-border);
    background-color: #fafbfc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.rims-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rims-card-body {
    padding: 1.25rem;
}

/* Table Styling */
.rims-table {
    margin-bottom: 0;
    font-size: 0.86rem;
}

.rims-table th {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--rims-border);
    padding: 0.65rem 0.85rem;
    vertical-align: middle;
}

.rims-table td {
    padding: 0.65rem 0.85rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--rims-border);
}

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

/* Status Badges */
.badge-active {
    background-color: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.badge-inactive {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    font-weight: 500;
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.badge-needs-attention {
    background-color: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.badge-ok {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Dashboard Metric Cards */
.metric-card {
    border-radius: 8px;
    padding: 1.2rem;
    background: #ffffff;
    border: 1px solid var(--rims-border);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.metric-data h3 {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
}

.metric-data p {
    font-size: 0.8rem;
    color: var(--rims-text-muted);
    margin: 0;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Empty State */
.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-state-icon {
    font-size: 2.75rem;
    color: #94a3b8;
    margin-bottom: 0.75rem;
}

.empty-state h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--rims-text-muted);
    font-size: 0.875rem;
    max-width: 420px;
    margin: 0 auto 1.25rem;
}

/* ==========================================================================
   ASP.NET Core Validation Summary
   Hide empty validation summary containers rendered by framework TagHelper
   ========================================================================== */
.validation-summary-valid {
    display: none !important;
}

/* Print Stylesheet for Reports */
@media print {
    .app-sidebar,
    .app-header .header-right,
    .app-footer,
    .no-print,
    .btn,
    .filter-card {
        display: none !important;
    }

    body, .app-layout, .app-main, .app-content {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        height: auto !important;
        min-height: auto !important;
    }

    .rims-card {
        border: none !important;
        box-shadow: none !important;
    }

    .rims-table th, .rims-table td {
        padding: 0.4rem 0.5rem !important;
        font-size: 0.78rem !important;
    }

    .print-header {
        display: block !important;
        margin-bottom: 1.5rem;
        border-bottom: 2px solid #000;
        padding-bottom: 0.5rem;
    }
}