/**
 * ImmigraSuite Admin - Base Styles
 * Global, Layout, Spacing, Cards, Labels, Text Colors, Icons
 */

/* ==========================================================================
   Global - Scrollbar Styling (All Elements)
   ========================================================================== */

/* Global scrollbar styling - applies to ALL scrollable elements */
* {
    scrollbar-width: thin;
    scrollbar-color: rgb(209 213 219) transparent;
}

/* Webkit browsers (Chrome, Safari, Edge) - Global */
*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: rgb(209 213 219);
    border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: rgb(156 163 175);
}

*::-webkit-scrollbar-corner {
    background: transparent;
}

/* Dark mode scrollbar - Global */
.dark * {
    scrollbar-color: rgb(75 85 99) transparent;
}

.dark *::-webkit-scrollbar-thumb {
    background-color: rgb(75 85 99);
}

.dark *::-webkit-scrollbar-thumb:hover {
    background-color: rgb(107 114 128);
}

/* ==========================================================================
   Layout - Filament Width Overrides
   ========================================================================== */

/* Remove max-width constraint to use full available width */
:is(.fi-main, .fi-simple-main).fi-width-7xl {
    max-width: unset;
}

/* ==========================================================================
   Logo Styling - Topbar
   ========================================================================== */

/* Set max-width for logo images in topbar */
.fi-topbar-start img.fi-logo,
img.fi-logo-light,
img.fi-logo-dark {
    max-width: 150px !important;
    height: auto !important;
}

/* ==========================================================================
   Layout - Grid Systems
   ========================================================================== */

.is-grid-1 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.is-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.is-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.is-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.is-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

.is-grid-2-1 {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
}

.is-grid-1-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 24px;
}

.is-span-2 {
    grid-column: span 2;
}

.is-span-3 {
    grid-column: span 3;
}

.is-span-full {
    grid-column: 1 / -1;
}

/* ==========================================================================
   Layout - Flexbox
   ========================================================================== */

.is-flex {
    display: flex;
}

.is-flex-col {
    display: flex;
    flex-direction: column;
}

.is-flex-center {
    display: flex;
    align-items: center;
}

.is-flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.is-flex-start {
    display: flex;
    align-items: flex-start;
}

.is-flex-wrap {
    flex-wrap: wrap;
}

.is-flex-shrink-0 {
    flex-shrink: 0;
}

.is-flex-1 {
    flex: 1;
}

/* ==========================================================================
   Spacing - Gaps
   ========================================================================== */

.is-gap-1 { gap: 4px; }
.is-gap-2 { gap: 8px; }
.is-gap-3 { gap: 12px; }
.is-gap-4 { gap: 16px; }
.is-gap-5 { gap: 20px; }
.is-gap-6 { gap: 24px; }

/* ==========================================================================
   Spacing - Margins
   ========================================================================== */

.is-mt-1 { margin-top: 4px; }
.is-mt-2 { margin-top: 8px; }
.is-mt-3 { margin-top: 12px; }
.is-mt-4 { margin-top: 16px; }
.is-mt-5 { margin-top: 20px; }
.is-mt-6 { margin-top: 24px; }

.is-mb-1 { margin-bottom: 4px; }
.is-mb-2 { margin-bottom: 8px; }
.is-mb-3 { margin-bottom: 12px; }
.is-mb-4 { margin-bottom: 16px; }
.is-mb-5 { margin-bottom: 20px; }
.is-mb-6 { margin-bottom: 24px; }

/* ==========================================================================
   Cards - Info Cards (Base)
   ========================================================================== */

.is-card {
    padding: 12px;
    background-color: rgb(249 250 251);
    border-radius: 8px;
}

.is-card-padded {
    padding: 16px;
    background-color: rgb(249 250 251);
    border-radius: 8px;
}

.is-card-white {
    padding: 12px;
    background-color: white;
    border-radius: 8px;
    border: 1px solid rgb(229 231 235);
}

/* ==========================================================================
   Cards - Colored Variants
   ========================================================================== */

.is-card-blue {
    padding: 16px;
    background-color: rgb(239 246 255);
    border-radius: 8px;
    border: 1px solid rgb(191 219 254);
}

.is-card-green {
    padding: 16px;
    background-color: rgb(240 253 244);
    border-radius: 8px;
    border: 1px solid rgb(187 247 208);
}

.is-card-yellow {
    padding: 16px;
    background-color: rgb(254 252 232);
    border-radius: 8px;
    border: 1px solid rgb(253 224 71);
}

.is-card-red {
    padding: 16px;
    background-color: rgb(254 242 242);
    border-radius: 8px;
    border: 1px solid rgb(254 202 202);
}

.is-card-orange {
    padding: 16px;
    background-color: rgb(255 247 237);
    border-radius: 8px;
    border: 1px solid rgb(254 215 170);
}

.is-card-gray {
    padding: 16px;
    background-color: rgb(249 250 251);
    border-radius: 8px;
    border: 1px solid rgb(229 231 235);
}

/* ==========================================================================
   Cards - Left Border Variants (for guide sections)
   ========================================================================== */

.is-card-border-gray {
    padding: 16px;
    background-color: rgb(249 250 251);
    border-radius: 8px;
    border-left: 4px solid rgb(156 163 175);
}

.is-card-border-blue {
    padding: 16px;
    background-color: rgb(239 246 255);
    border-radius: 8px;
    border-left: 4px solid rgb(59 130 246);
}

.is-card-border-green {
    padding: 16px;
    background-color: rgb(240 253 244);
    border-radius: 8px;
    border-left: 4px solid rgb(34 197 94);
}

.is-card-border-yellow {
    padding: 16px;
    background-color: rgb(254 252 232);
    border-radius: 8px;
    border-left: 4px solid rgb(234 179 8);
}

.is-card-border-orange {
    padding: 16px;
    background-color: rgb(255 247 237);
    border-radius: 8px;
    border-left: 4px solid rgb(251 146 60);
}

.is-card-border-red {
    padding: 16px;
    background-color: rgb(254 242 242);
    border-radius: 8px;
    border-left: 4px solid rgb(239 68 68);
}

.is-card-border-purple {
    padding: 16px;
    background-color: rgb(250 245 255);
    border-radius: 8px;
    border-left: 4px solid rgb(168 85 247);
}

/* ==========================================================================
   Labels
   ========================================================================== */

.is-label {
    font-size: 11px;
    font-weight: 500;
    color: rgb(107 114 128);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.is-section-label {
    font-size: 12px;
    font-weight: 600;
    color: rgb(55 65 81);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.is-section-label-blue {
    font-size: 12px;
    font-weight: 600;
    color: rgb(30 64 175);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.is-section-label-red {
    font-size: 12px;
    font-weight: 600;
    color: rgb(185 28 28);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.is-section-label-yellow {
    font-size: 12px;
    font-weight: 600;
    color: rgb(161 98 7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

/* ==========================================================================
   Section Headings
   ========================================================================== */

.is-heading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.is-heading-title {
    font-size: 14px;
    font-weight: 600;
    color: rgb(17 24 39);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgb(234 88 12);
}

/* ==========================================================================
   Values / Text
   ========================================================================== */

.is-value {
    font-size: 14px;
    color: rgb(17 24 39);
}

.is-value-sm {
    font-size: 13px;
    color: rgb(17 24 39);
}

.is-value-lg {
    font-size: 18px;
    font-weight: 700;
    color: rgb(17 24 39);
}

.is-value-xl {
    font-size: 20px;
    font-weight: 600;
    color: rgb(17 24 39);
}

.is-value-xxl {
    font-size: 28px;
    font-weight: 700;
    color: rgb(17 24 39);
}

.is-value-primary {
    font-size: 18px;
    font-weight: 700;
    color: rgb(22 163 74);
}

.is-value-bold {
    font-weight: 600;
}

/* ==========================================================================
   Text Colors
   ========================================================================== */

.is-text-muted {
    color: rgb(156 163 175);
}

.is-text-gray {
    color: rgb(107 114 128);
}

.is-text-dark {
    color: rgb(17 24 39);
}

.is-text-primary {
    color: rgb(234 88 12);
}

.is-text-success {
    color: rgb(22 163 74);
}

.is-text-danger {
    color: rgb(220 38 38);
}

.is-text-warning {
    color: rgb(234 179 8);
}

.is-text-info {
    color: rgb(59 130 246);
}

.is-text-blue-dark {
    color: rgb(30 64 175);
}

.is-text-green-dark {
    color: rgb(22 101 52);
}

.is-text-yellow-dark {
    color: rgb(161 98 7);
}

.is-text-red-dark {
    color: rgb(185 28 28);
}

/* ==========================================================================
   Font Sizes
   ========================================================================== */

.is-text-xs { font-size: 11px; }
.is-text-sm { font-size: 12px; }
.is-text-base { font-size: 14px; }
.is-text-lg { font-size: 16px; }
.is-text-xl { font-size: 18px; }
.is-text-2xl { font-size: 20px; }
.is-text-3xl { font-size: 28px; }
.is-text-4xl { font-size: 42px; }

.is-font-medium { font-weight: 500; }
.is-font-semibold { font-weight: 600; }
.is-font-bold { font-weight: 700; }

/* ==========================================================================
   Links
   ========================================================================== */

.is-link {
    color: rgb(234 88 12);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
}

.is-link:hover {
    text-decoration: underline;
}

.is-link-danger {
    color: rgb(220 38 38);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.is-link-info {
    color: rgb(59 130 246);
    text-decoration: none;
    font-weight: 500;
}

/* ==========================================================================
   Icons
   ========================================================================== */

.is-icon-xs {
    width: 12px;
    height: 12px;
}

.is-icon-sm {
    width: 16px;
    height: 16px;
}

.is-icon-md {
    width: 18px;
    height: 18px;
}

.is-icon-lg {
    width: 20px;
    height: 20px;
}

.is-icon-xl {
    width: 24px;
    height: 24px;
}

.is-icon-2xl {
    width: 48px;
    height: 48px;
}

.is-icon-gray { color: rgb(107 114 128); }
.is-icon-muted { color: rgb(156 163 175); }
.is-icon-primary { color: rgb(234 88 12); }
.is-icon-success { color: rgb(34 197 94); }
.is-icon-danger { color: rgb(239 68 68); }
.is-icon-warning { color: rgb(234 179 8); }
.is-icon-info { color: rgb(59 130 246); }
.is-icon-purple { color: rgb(168 85 247); }

/* ==========================================================================
   Stat Cards
   ========================================================================== */

.is-stat-card {
    text-align: center;
    padding: 12px;
    background-color: white;
    border-radius: 8px;
    border: 1px solid rgb(229 231 235);
}

.is-stat-value {
    font-size: 28px;
    font-weight: 700;
}

.is-stat-value-lg {
    font-size: 42px;
    font-weight: 700;
}

.is-stat-label {
    font-size: 12px;
    color: rgb(107 114 128);
}

/* ==========================================================================
   Detail Items (icon + text pairs)
   ========================================================================== */

.is-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.is-detail-item-start {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

/* ==========================================================================
   Progress Bars
   ========================================================================== */

.is-progress-bar {
    height: 8px;
    background-color: rgb(229 231 235);
    border-radius: 4px;
    overflow: hidden;
}

.is-progress-bar-sm {
    height: 6px;
    background-color: rgb(229 231 235);
    border-radius: 3px;
    overflow: hidden;
}

.is-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.is-progress-fill-sm {
    height: 100%;
    border-radius: 3px;
}

/* ==========================================================================
   Badges / Pills
   ========================================================================== */

.is-badge-number {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
}

.is-badge-number-yellow {
    background: rgb(234 179 8);
    color: white;
}

.is-badge-number-gray {
    background: rgb(156 163 175);
    color: white;
}

.is-badge-number-light {
    background: rgb(209 213 219);
    color: rgb(75 85 99);
}

.is-badge-number-blue {
    background: rgb(59 130 246);
    color: white;
}

/* ==========================================================================
   Code / Inline Code
   ========================================================================== */

.is-code {
    background: rgb(243 244 246);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

.is-code-blue {
    background: rgb(191 219 254);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.is-code-green {
    background: rgb(187 247 208);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.is-code-gray {
    background: rgb(229 231 235);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 12px;
}

/* ==========================================================================
   Links
   ========================================================================== */

.is-link-blue {
    color: rgb(37 99 235);
    text-decoration: underline;
}

.is-link-blue:hover {
    color: rgb(29 78 216);
}

/* ==========================================================================
   Tip / Info Boxes
   ========================================================================== */

.is-tip-blue {
    margin-top: 12px;
    padding: 8px 12px;
    background-color: rgb(219 234 254);
    border-radius: 6px;
    font-size: 12px;
    color: rgb(30 64 175);
}

.is-tip-green {
    margin-top: 12px;
    padding: 8px 12px;
    background-color: rgb(220 252 231);
    border-radius: 6px;
    font-size: 12px;
    color: rgb(22 101 52);
}

.is-tip-yellow {
    margin-top: 12px;
    padding: 8px 12px;
    background-color: rgb(254 249 195);
    border-radius: 6px;
    font-size: 12px;
    color: rgb(161 98 7);
}

/* ==========================================================================
   Timeline
   ========================================================================== */

.is-timeline-item {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgb(229 231 235);
}

.is-timeline-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.is-timeline-description {
    font-size: 14px;
    color: rgb(55 65 81);
    margin-bottom: 8px;
    padding-left: 8px;
    border-left: 2px solid rgb(229 231 235);
}

/* ==========================================================================
   Forms
   ========================================================================== */

.is-form-label {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: rgb(17 24 39);
    margin-bottom: 4px;
}

.is-form-required {
    color: rgb(220 38 38);
}

.is-form-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgb(209 213 219);
    border-radius: 8px;
    font-size: 12px;
    background-color: white;
}

.is-form-input:focus {
    outline: none;
    border-color: rgb(234 88 12);
    box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.1);
}

.is-form-select {
    width: 100%;
    padding: 8px 32px 8px 12px;
    border: 1px solid rgb(209 213 219);
    border-radius: 8px;
    font-size: 12px;
    background-color: white;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    cursor: pointer;
}

.is-form-select:focus {
    outline: none;
    border-color: rgb(234 88 12);
    box-shadow: 0 0 0 2px rgba(234, 88, 12, 0.1);
}

.is-form-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgb(209 213 219);
    border-radius: 8px;
    font-size: 12px;
    resize: vertical;
}

/* ==========================================================================
   Borders & Dividers
   ========================================================================== */

.is-border-t {
    border-top: 1px solid rgb(229 231 235);
}

.is-border-b {
    border-bottom: 1px solid rgb(229 231 235);
}

.is-divider {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgb(229 231 235);
}

/* ==========================================================================
   Scrollable Areas
   ========================================================================== */

.is-scrollable {
    max-height: 500px;
    overflow-y: auto;
}

.is-scrollable-sm {
    max-height: 300px;
    overflow-y: auto;
}

/* ==========================================================================
   Empty States
   ========================================================================== */

.is-empty-state {
    text-align: center;
    padding: 32px;
    color: rgb(107 114 128);
}

.is-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    opacity: 0.5;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

.is-text-center { text-align: center; }
.is-text-right { text-align: right; }
.is-text-nowrap { white-space: nowrap; }
.is-text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.is-hidden { display: none; }
.is-opacity-50 { opacity: 0.5; }

.is-pt-2 { padding-top: 8px; }
.is-pt-4 { padding-top: 16px; }
.is-pt-6 { padding-top: 24px; }

.is-pb-2 { padding-bottom: 8px; }
.is-pb-4 { padding-bottom: 16px; }

.is-rounded { border-radius: 8px; }
.is-rounded-lg { border-radius: 12px; }

