/**
 * FDA PLATFORM - UNIFIED STYLESHEET
 * Single source of truth for ALL platform styling
 * Link this file from EVERY page - NO exceptions
 * 
 * Location: /assets/css/unified-platform.css
 * Load order: After Bootstrap, before page-specific CSS
 */

/* ==========================================================================
   ICON OPTIMIZATION - Prevent FOUC (Flash of Unstyled Content)
   Ensure icons display immediately even if font hasn't loaded yet
   ========================================================================== */

/* Fallback styling for icons while font loads */
.bi::before,
[class^="bi-"]::before,
[class*=" bi-"]::before {
    font-style: normal;
    font-weight: normal !important;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    vertical-align: -.125em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent invisible icons while loading */
    display: inline-block;
    min-width: 1em;
    min-height: 1em;
}

/* ==========================================================================
   TYPOGRAPHY - Industry Standard Sizing
   ========================================================================== */

body {
    font-size: 14px;
}

h2, h3 {
    font-size: 18px !important;
}

/* ==========================================================================
   BUTTONS - Consistent Heights & Sizing
   ========================================================================== */

.btn {
    height: 36px;
    padding: 0 16px;
    font-size: 14px;
    line-height: 34px;
}

.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
    line-height: 30px;
}

/* ==========================================================================
   CARDS - Executive Dashboard Style
   ========================================================================== */

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 27, 58, 0.08);
    transition: all 0.3s ease;
}

.card-body {
    padding: 16px;
}

/* ==========================================================================
   TABLES - Consistent Sizing
   ========================================================================== */

table {
    font-size: 13px;
}

table td, table th {
    padding: 10px 12px !important;
}

/* ==========================================================================
   WELCOME SECTION - Compact Dashboard Header
   STRUCTURE: Separate clipped icon container + visible button area
   ========================================================================== */

.compact-welcome {
    padding: 24px !important;
    min-height: 100px;
    position: relative;
    overflow: visible; /* Parent must be visible for dropdowns */
}

.compact-welcome h2 {
    font-size: 18px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.compact-welcome p {
    font-size: 14px;
    margin-bottom: 0;
    line-height: 1.5;
}

/* Icon clipping container - ONLY THIS has overflow:hidden */
.compact-welcome .icon-clip-container {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

/* Icon itself */
.compact-welcome .icon-bg {
    position: absolute;
    right: 20%;
    top: 50%;
    transform: translateY(-50%) rotate(15deg);
    font-size: 140px !important;
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
}

.compact-welcome .content-wrapper {
    position: relative;
    z-index: 1;
}

/* Button column - completely free from overflow */
.compact-welcome .col-md-3,
.compact-welcome .text-end {
    position: relative;
    z-index: 10;
}

.welcome-cta {
    height: 36px;
    padding: 0 16px;
    font-size: 14px;
    white-space: nowrap;
    position: relative;
    z-index: 10;
}

/* Dropdown containers */
.compact-welcome .dropdown,
.compact-welcome .btn-group {
    position: relative;
    z-index: 10;
}

/* Dropdown menus */
.compact-welcome .dropdown-menu {
    position: absolute !important;
    z-index: 1050 !important;
}

/* Dropdown toggles */
.compact-welcome .dropdown-toggle,
.compact-welcome .btn-group > .btn {
    position: relative;
    z-index: 10;
}

/* ==========================================================================
   KPI CARDS - Executive Dashboard Stats
   ========================================================================== */

.executive-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.executive-kpi-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #3B82F6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.executive-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.kpi-label {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 8px;
    font-weight: 500;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0;
}

/* ==========================================================================
   FILTER SECTIONS - Search & Filter Bars
   ========================================================================== */

.filter-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.filter-section .form-label {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-control:not(textarea),
.form-select {
    height: 38px;
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 6px;
}

textarea.form-control {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 6px;
    min-height: 38px;
}

.input-group-text:not(#password-toggle) {
    padding: 8px 12px;
    font-size: 14px;
}

/* ==========================================================================
   QUICK ACTIONS - Table Action Buttons
   ========================================================================== */

.quick-actions {
    display: flex;
    gap: 6px;
}

.quick-actions .btn {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    min-width: unset !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.quick-actions .btn i {
    font-size: 16px;
    margin: 0 !important;
}
