/* ==========================================================================
   Ressarcimento SUS & TUNEP - Design System Theme
   Clean, modern, professional SaaS aesthetic built on Bootstrap 5
   ========================================================================== */

:root {
    --app-font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --app-bg: #f8fafc;
    --app-surface: #ffffff;
    --app-border: #e2e8f0;
    --app-border-focus: #3b82f6;

    /* Color Palette */
    --app-primary: #1d4ed8;
    --app-primary-hover: #1e40af;
    --app-primary-subtle: #eff6ff;
    --app-slate-900: #0f172a;
    --app-slate-800: #1e293b;
    --app-slate-700: #334155;
    --app-slate-600: #475569;
    --app-slate-500: #64748b;
    --app-slate-400: #94a3b8;
    --app-slate-200: #e2e8f0;
    --app-slate-100: #f1f5f9;
    --app-slate-50: #f8fafc;

    --app-success: #10b981;
    --app-warning: #f59e0b;
    --app-danger: #ef4444;

    /* Shadows */
    --app-shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --app-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --app-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --app-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --app-shadow-card: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --app-shadow-hover: 0 12px 20px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -2px rgba(15, 23, 42, 0.04);

    /* Radii */
    --app-radius-sm: 0.375rem;
    --app-radius-md: 0.5rem;
    --app-radius-lg: 0.75rem;
    --app-radius-xl: 1rem;
}

body {
    font-family: var(--app-font-family);
    background-color: var(--app-bg);
    color: var(--app-slate-800);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.app-navbar {
    background-color: var(--app-slate-900) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--app-shadow-sm);
    padding: 0.75rem 1rem;
}

.app-navbar .navbar-brand {
    color: #ffffff !important;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.app-navbar .navbar-brand-badge {
    background-color: rgba(37, 99, 235, 0.25);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.3);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.app-navbar .nav-link {
    color: #cbd5e1 !important;
    font-weight: 500;
    font-size: 0.92rem;
    padding: 0.45rem 0.85rem !important;
    border-radius: var(--app-radius-md);
    transition: all 0.15s ease-in-out;
}

.app-navbar .nav-link:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.08);
}

.app-navbar .nav-link.active {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.12);
    font-weight: 600;
}

.app-navbar .user-profile-badge {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    color: #e2e8f0;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ==========================================================================
   Typography & Headers
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    color: var(--app-slate-900);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--app-slate-900);
    margin-bottom: 0.35rem;
}

.page-subtitle {
    color: var(--app-slate-600);
    font-size: 1rem;
    margin-bottom: 0;
}

/* ==========================================================================
   Cards & Layout
   ========================================================================== */
.card, .app-card {
    background-color: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow-card);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-header-clean {
    background-color: transparent;
    border-bottom: 1px solid var(--app-border);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.app-card-lift:hover {
    transform: translateY(-3px);
    box-shadow: var(--app-shadow-hover);
    border-color: #cbd5e1;
}

/* Form Container */
.form-card-container {
    max-width: 920px;
    margin: 0 auto;
}

.form-section {
    background: #ffffff;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--app-shadow-xs);
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--app-slate-100);
}

.form-section-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 9999px;
    background-color: var(--app-primary-subtle);
    color: var(--app-primary);
    font-size: 0.8rem;
    font-weight: 700;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--app-slate-900);
    margin: 0;
}

.form-section-desc {
    font-size: 0.825rem;
    color: var(--app-slate-500);
    margin: 0;
}

/* ==========================================================================
   Inputs & Form Controls
   ========================================================================== */
.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--app-slate-700);
    margin-bottom: 0.35rem;
}

.form-control, .form-select {
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    padding: 0.6rem 0.85rem;
    font-size: 0.925rem;
    color: var(--app-slate-900);
    background-color: #ffffff;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--app-border-focus);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
    outline: 0;
}

.form-control::placeholder {
    color: var(--app-slate-400);
    font-size: 0.9rem;
}

/* Radio Cards */
.radio-card-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.radio-card {
    position: relative;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-md);
    padding: 1rem 1.25rem;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.radio-card:hover {
    border-color: #94a3b8;
    background-color: var(--app-slate-50);
}

.radio-card input[type="radio"]:checked ~ .radio-card-content .radio-card-title {
    color: var(--app-primary);
}

.radio-card.selected, .radio-card:has(input[type="radio"]:checked) {
    border-color: var(--app-primary);
    background-color: var(--app-primary-subtle);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.55rem 1.15rem;
    border-radius: var(--app-radius-md);
    transition: all 0.15s ease-in-out;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--app-primary);
    border-color: var(--app-primary);
    color: #ffffff;
    box-shadow: var(--app-shadow-xs);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--app-primary-hover);
    border-color: var(--app-primary-hover);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--app-shadow-sm);
}

.btn-secondary {
    background-color: var(--app-slate-700);
    border-color: var(--app-slate-700);
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: var(--app-slate-800);
    border-color: var(--app-slate-800);
}

.btn-outline-secondary {
    color: var(--app-slate-700);
    border-color: var(--app-slate-200);
    background-color: #ffffff;
}

.btn-outline-secondary:hover {
    background-color: var(--app-slate-100);
    border-color: var(--app-slate-400);
    color: var(--app-slate-900);
}

.form-actions-bar {
    background-color: #ffffff;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--app-shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* ==========================================================================
   Dashboard Feature Cards (Feature Page)
   ========================================================================== */
.feature-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--app-primary);
    margin-bottom: 0.75rem;
}

.feature-grid-item {
    text-decoration: none !important;
    color: inherit !important;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
    border-radius: var(--app-radius-lg);
    border: 1px solid var(--app-border);
    background: #ffffff;
    box-shadow: var(--app-shadow-card);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-grid-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--app-shadow-hover);
    border-color: #93c5fd;
}

.feature-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--app-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    margin-bottom: 1.25rem;
    flex-shrink: 0;
}

.feature-icon-blue {
    background-color: #dbeafe;
    color: #1e40af;
}

.feature-icon-indigo {
    background-color: #e0e7ff;
    color: #3730a3;
}

.feature-icon-emerald {
    background-color: #d1fae5;
    color: #065f46;
}

.feature-icon-amber {
    background-color: #fef3c7;
    color: #92400e;
}

.feature-icon-purple {
    background-color: #ede9fe;
    color: #5b21b6;
}

.feature-item-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--app-slate-900);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.feature-item-desc {
    font-size: 0.875rem;
    color: var(--app-slate-600);
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 1.25rem;
}

.feature-item-action {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--app-primary);
    transition: gap 0.15s ease;
}

.feature-grid-item:hover .feature-item-action {
    gap: 0.6rem;
}

/* ==========================================================================
   Modern Tables
   ========================================================================== */
.table-card {
    background-color: #ffffff;
    border: 1px solid var(--app-border);
    border-radius: var(--app-radius-lg);
    box-shadow: var(--app-shadow-card);
    overflow: hidden;
}

.table-modern {
    margin-bottom: 0;
    width: 100%;
}

.table-modern thead th {
    background-color: var(--app-slate-50);
    color: var(--app-slate-600);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--app-border);
    white-space: nowrap;
}

.table-modern tbody td {
    padding: 0.95rem 1rem;
    vertical-align: middle;
    font-size: 0.875rem;
    color: var(--app-slate-800);
    border-bottom: 1px solid var(--app-slate-100);
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

.table-modern tbody tr:hover {
    background-color: rgba(248, 250, 252, 0.8);
}

/* ==========================================================================
   Badges
   ========================================================================== */
.badge-subtle {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: var(--app-radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.badge-subtle-primary {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-subtle-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-subtle-secondary {
    background-color: #f1f5f9;
    color: #475569;
}

.badge-subtle-warning {
    background-color: #fef3c7;
    color: #92400e;
}
