/* ========================================
   글로벌에코 오아시스 2.0 - 메인 스타일시트
   Professional ERP Design System
   ======================================== */

/* ========================================
   CSS Variables (Design System)
   ======================================== */
:root {
    /* Primary Colors - Deep Blue Professional */
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-darker: #1E40AF;
    --primary-light: #3B82F6;
    --primary-50: #EFF6FF;
    --primary-100: #DBEAFE;
    --primary-200: #BFDBFE;

    /* Secondary Colors */
    --secondary: #64748B;
    --secondary-dark: #475569;
    --secondary-light: #94A3B8;

    /* Status Colors */
    --success: #059669;
    --success-light: #D1FAE5;
    --success-dark: #047857;
    --warning: #D97706;
    --warning-light: #FEF3C7;
    --warning-dark: #B45309;
    --danger: #DC2626;
    --danger-light: #FEE2E2;
    --danger-dark: #B91C1C;
    --info: #0891B2;
    --info-light: #CFFAFE;
    --info-dark: #0E7490;

    /* Neutral Colors - Refined Gray Scale */
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;

    /* Background Colors */
    --bg-main: #F1F5F9;
    --bg-card: #FFFFFF;
    --bg-sidebar: #0F172A;
    --bg-sidebar-hover: #1E293B;
    --bg-sidebar-active: #2563EB;
    --bg-input: #FFFFFF;

    /* Text Colors */
    --text-primary: #0F172A;
    --text-secondary: #475569;
    --text-muted: #94A3B8;
    --text-light: #FFFFFF;
    --text-heading: #1E293B;

    /* Border */
    --border-color: #E2E8F0;
    --border-color-dark: #CBD5E1;
    --border-input: #CBD5E1;
    --border-radius: 8px;
    --border-radius-sm: 6px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;

    /* Shadows - Refined for depth */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    --gradient-primary-hover: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    --gradient-header: linear-gradient(135deg, #1E40AF 0%, #2563EB 50%, #3B82F6 100%);
    --gradient-success: linear-gradient(135deg, #059669 0%, #047857 100%);
    --gradient-danger: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    --gradient-sidebar: linear-gradient(180deg, #1E293B 0%, #0F172A 100%);

    /* Sidebar */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 72px;

    /* Header */
    --header-height: 64px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Focus Ring */
    --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.25);
    --focus-ring-danger: 0 0 0 3px rgba(220, 38, 38, 0.25);
    --focus-ring-success: 0 0 0 3px rgba(5, 150, 105, 0.25);
}

/* ========================================
   Reset & Base Styles
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-main);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    color: var(--text-heading);
    line-height: 1.4;
}

p {
    margin: 0;
}

/* ========================================
   Grid System
   ======================================== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -12px;
    margin-right: -12px;
}

.row > * {
    padding-left: 12px;
    padding-right: 12px;
    width: 100%;
}

/* Column classes */
.col { flex: 1 0 0%; }
.col-auto { flex: 0 0 auto; width: auto; }
.col-1 { flex: 0 0 auto; width: 8.333333%; }
.col-2 { flex: 0 0 auto; width: 16.666667%; }
.col-3 { flex: 0 0 auto; width: 25%; }
.col-4 { flex: 0 0 auto; width: 33.333333%; }
.col-5 { flex: 0 0 auto; width: 41.666667%; }
.col-6 { flex: 0 0 auto; width: 50%; }
.col-7 { flex: 0 0 auto; width: 58.333333%; }
.col-8 { flex: 0 0 auto; width: 66.666667%; }
.col-9 { flex: 0 0 auto; width: 75%; }
.col-10 { flex: 0 0 auto; width: 83.333333%; }
.col-11 { flex: 0 0 auto; width: 91.666667%; }
.col-12 { flex: 0 0 auto; width: 100%; }

/* Medium breakpoint (768px+) */
@media (min-width: 768px) {
    .col-md-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-md-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-md-3 { flex: 0 0 auto; width: 25%; }
    .col-md-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-md-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-md-6 { flex: 0 0 auto; width: 50%; }
    .col-md-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-md-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-md-9 { flex: 0 0 auto; width: 75%; }
    .col-md-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-md-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-md-12 { flex: 0 0 auto; width: 100%; }
}

/* Large breakpoint (992px+) */
@media (min-width: 992px) {
    .col-lg-1 { flex: 0 0 auto; width: 8.333333%; }
    .col-lg-2 { flex: 0 0 auto; width: 16.666667%; }
    .col-lg-3 { flex: 0 0 auto; width: 25%; }
    .col-lg-4 { flex: 0 0 auto; width: 33.333333%; }
    .col-lg-5 { flex: 0 0 auto; width: 41.666667%; }
    .col-lg-6 { flex: 0 0 auto; width: 50%; }
    .col-lg-7 { flex: 0 0 auto; width: 58.333333%; }
    .col-lg-8 { flex: 0 0 auto; width: 66.666667%; }
    .col-lg-9 { flex: 0 0 auto; width: 75%; }
    .col-lg-10 { flex: 0 0 auto; width: 83.333333%; }
    .col-lg-11 { flex: 0 0 auto; width: 91.666667%; }
    .col-lg-12 { flex: 0 0 auto; width: 100%; }
}

/* Row gap variants */
.g-0 { margin: 0; }
.g-0 > * { padding: 0; }
.g-1 { margin: -4px; }
.g-1 > * { padding: 4px; }
.g-2 { margin: -8px; }
.g-2 > * { padding: 8px; }
.g-3 { margin: -12px; }
.g-3 > * { padding: 12px; }
.g-4 { margin: -16px; }
.g-4 > * { padding: 16px; }
.g-5 { margin: -20px; }
.g-5 > * { padding: 20px; }

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

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-normal);
    min-width: 0;
}

.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.content-wrapper {
    padding: 24px 32px;
    padding-top: calc(var(--header-height) + 24px);
    min-height: 100vh;
    max-width: 1600px;
}

/* ========================================
   Sidebar - Professional Dark Theme
   ======================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--gradient-sidebar);
    color: var(--text-light);
    z-index: 1000;
    transition: width var(--transition-normal);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

/* Sidebar Header (Logo) */
.sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-light);
    font-weight: 700;
    font-size: 1.15rem;
    white-space: nowrap;
}

.sidebar-logo:hover {
    color: var(--text-light);
}

.sidebar-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.sidebar-logo-text {
    opacity: 1;
    transition: opacity var(--transition-normal);
    letter-spacing: -0.02em;
}

.sidebar-collapsed .sidebar-logo-text {
    opacity: 0;
    width: 0;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

.nav-section {
    margin-bottom: 4px;
}

.nav-section-title {
    padding: 16px 20px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--gray-500);
    letter-spacing: 0.1em;
    white-space: nowrap;
}

.sidebar-collapsed .nav-section-title {
    opacity: 0;
    height: 0;
    padding: 0;
    overflow: hidden;
}

/* Nav Item */
.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--gray-400);
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.9rem;
    font-weight: 450;
    border-radius: 0;
    margin: 0;
    position: relative;
}

.nav-link:hover {
    color: var(--text-light);
    background-color: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
    color: var(--text-light);
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.3) 0%, transparent 100%);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--primary-light);
    border-radius: 0 2px 2px 0;
}

.nav-link-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.nav-link-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-collapsed .nav-link-text {
    opacity: 0;
    width: 0;
}

.nav-link-arrow {
    font-size: 1rem;
    transition: transform var(--transition-fast);
    opacity: 0.5;
}

.nav-item.open .nav-link-arrow {
    transform: rotate(90deg);
}

.sidebar-collapsed .nav-link-arrow {
    display: none;
}

/* Submenu */
.nav-submenu {
    display: none;
    padding-left: 32px;
    background-color: rgba(0, 0, 0, 0.2);
}

.nav-item.open .nav-submenu {
    display: block;
}

.nav-submenu .nav-link {
    padding: 9px 20px;
    font-size: 0.85rem;
    color: var(--gray-400);
}

.nav-submenu .nav-link:hover {
    color: var(--text-light);
}

.nav-submenu .nav-link.active {
    color: var(--primary-light);
    background: transparent;
}

.nav-submenu .nav-link.active::before {
    display: none;
}

.sidebar-collapsed .nav-submenu {
    display: none !important;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.2);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: var(--border-radius);
    transition: background-color var(--transition-fast);
}

.sidebar-user:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-collapsed .sidebar-user-info {
    display: none;
}

.sidebar-user-name {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* ========================================
   Header - Clean Modern Style
   ======================================== */
.header {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 999;
    transition: left var(--transition-normal);
    box-shadow: var(--shadow-xs);
}

.sidebar-collapsed .header {
    left: var(--sidebar-collapsed-width);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover {
    background-color: var(--gray-100);
    color: var(--primary);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

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

.breadcrumb-item a {
    color: var(--text-secondary);
}

.breadcrumb-item a:hover {
    color: var(--primary);
}

.breadcrumb-divider {
    color: var(--gray-300);
    font-size: 0.8rem;
}

.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Search */
.header-search {
    position: relative;
}

.header-search input {
    width: 260px;
    padding: 8px 14px 8px 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    background: var(--gray-50);
    transition: all var(--transition-fast);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--focus-ring);
    background: var(--bg-card);
}

.header-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
}

/* Header Icons */
.header-icon {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 1.2rem;
}

.header-icon:hover {
    background-color: var(--gray-100);
    color: var(--primary);
}

.header-icon-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    background-color: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* User Dropdown */
.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: 8px;
}

.header-user:hover {
    background-color: var(--gray-100);
}

.header-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.header-user-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ========================================
   Cards - Clean Professional Style
   ======================================== */
.card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition-fast);
}

.card:hover {
    box-shadow: var(--shadow);
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--gray-50);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.card-header h3,
.card-header h5,
.card-header .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h3 i,
.card-header h5 i,
.card-title i {
    color: var(--primary);
    font-size: 1.1rem;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-heading);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

.card-body.p-0 {
    padding: 0 !important;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background-color: var(--gray-50);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* Card Variants */
.card-flat {
    box-shadow: none;
    border: 1px solid var(--border-color);
}

.card-flat:hover {
    box-shadow: none;
}

/* ========================================
   Buttons - Modern Professional Style
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.4;
}

.btn:focus {
    outline: none;
}

.btn i {
    font-size: 1rem;
}

/* Primary Button */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    border: none;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: var(--gradient-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    color: white;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:focus {
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3), var(--focus-ring);
}

/* Secondary Button */
.btn-secondary {
    background-color: var(--gray-100);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--gray-200);
    color: var(--text-primary);
}

.btn-secondary:focus {
    box-shadow: var(--focus-ring);
}

/* Success Button */
.btn-success {
    background: var(--gradient-success);
    color: white;
    border: none;
    box-shadow: 0 1px 3px rgba(5, 150, 105, 0.3);
}

.btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35);
    color: white;
}

/* Danger Button */
.btn-danger {
    background: var(--gradient-danger);
    color: white;
    border: none;
    box-shadow: 0 1px 3px rgba(220, 38, 38, 0.3);
}

.btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.35);
    color: white;
}

/* Outline Buttons */
.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--gray-50);
    border-color: var(--gray-300);
    color: var(--text-primary);
}

.btn-outline-primary {
    background-color: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    color: white;
}

.btn-outline-danger {
    background-color: transparent;
    border: 1px solid var(--danger);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background-color: var(--danger);
    color: white;
}

/* Button Sizes */
.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-sm i {
    font-size: 0.9rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

/* Icon Button */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--border-radius);
}

.btn-icon-sm {
    width: 30px;
    height: 30px;
    padding: 0;
}

/* White Buttons (for gradient headers) */
.btn-white {
    background: white;
    color: var(--primary);
    border: none;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.btn-white:hover {
    background: var(--gray-50);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
    color: var(--primary);
}

.btn-white-outline {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-white-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
    color: white;
}

/* ========================================
   Forms - Clean Professional Style
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label,
label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-heading);
    font-size: 0.85rem;
}

.form-label.required::after,
label.required::after {
    content: ' *';
    color: var(--danger);
}

/* Input, Select, Textarea */
.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="month"],
input[type="week"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-family: inherit;
    line-height: 1.5;
    border: 1.5px solid var(--border-input);
    border-radius: var(--border-radius);
    background-color: var(--bg-input);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.form-control:hover,
input:hover,
textarea:hover,
select:hover {
    border-color: var(--gray-400);
}

.form-control:focus,
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--focus-ring);
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

.form-control:disabled,
input:disabled,
textarea:disabled,
select:disabled {
    background-color: var(--gray-100);
    border-color: var(--gray-200);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Select (Combo Box) */
.form-select,
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

.form-select:focus,
select:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563EB' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

/* Textarea */
textarea {
    min-height: 100px;
    resize: vertical;
}

/* File Input */
input[type="file"] {
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    padding: 6px 14px;
    margin-right: 12px;
    border: none;
    border-radius: var(--border-radius-sm);
    background: var(--gradient-primary);
    color: white;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

input[type="file"]::file-selector-button:hover {
    background: var(--gradient-primary-hover);
}

/* Checkbox & Radio */
input[type="checkbox"],
input[type="radio"] {
    width: 18px;
    height: 18px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.form-check-label {
    font-size: 0.9rem;
    color: var(--text-primary);
    cursor: pointer;
    margin-bottom: 0;
}

/* Form Control Sizes */
.form-control-sm {
    padding: 7px 12px;
    font-size: 0.85rem;
}

.form-control-lg {
    padding: 12px 16px;
    font-size: 1rem;
}

/* Input Group */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control,
.input-group input,
.input-group select {
    border-radius: 0;
    flex: 1;
}

.input-group .form-control:first-child,
.input-group input:first-child,
.input-group select:first-child {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.input-group .form-control:last-child,
.input-group input:last-child,
.input-group select:last-child {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: var(--gray-100);
    border: 1.5px solid var(--border-input);
    white-space: nowrap;
}

.input-group-text:first-child {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    border-right: none;
}

.input-group-text:last-child {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    border-left: none;
}

/* Validation */
.is-invalid {
    border-color: var(--danger) !important;
}

.is-invalid:focus {
    box-shadow: var(--focus-ring-danger) !important;
}

.invalid-feedback {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--danger);
}

.is-valid {
    border-color: var(--success) !important;
}

.is-valid:focus {
    box-shadow: var(--focus-ring-success) !important;
}

.valid-feedback {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--success);
}

.form-text {
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========================================
   Form Sections - Clean Card Style
   ======================================== */
.form-section {
    margin-bottom: 32px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.form-section-title,
h5.form-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-100);
}

.form-section-title i,
h5.form-section-title i {
    color: var(--primary);
    font-size: 1.1rem;
}

/* Form Actions */
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 24px;
    margin-top: 24px;
    border-top: 1px solid var(--border-color);
}

.form-actions-right {
    justify-content: flex-end;
}

.form-actions-center {
    justify-content: center;
}

.form-actions-between {
    justify-content: space-between;
}

/* ========================================
   Tables - Professional Data Grid
   ======================================== */
.table-wrapper,
.table-responsive {
    overflow-x: auto;
    border-radius: var(--border-radius-lg);
}

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

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--text-heading);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.table tbody tr {
    transition: background-color var(--transition-fast);
}

.table tbody tr:hover {
    background-color: var(--primary-50);
}

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

.table-striped tbody tr:nth-child(even) {
    background-color: var(--gray-50);
}

.table-striped tbody tr:nth-child(even):hover {
    background-color: var(--primary-50);
}

/* Table Cell Alignment */
.table .text-center { text-align: center; }
.table .text-right,
.table .text-end { text-align: right; }
.table .nowrap { white-space: nowrap; }

/* Table with Card wrapper */
.card .table th:first-child,
.card .table td:first-child {
    padding-left: 24px;
}

.card .table th:last-child,
.card .table td:last-child {
    padding-right: 24px;
}

/* Compact Table */
.table-compact th,
.table-compact td {
    padding: 10px 14px;
}

/* Clickable Row */
.table tbody tr[onclick],
.table tbody tr[style*="cursor: pointer"],
.table tbody tr[style*="cursor:pointer"] {
    cursor: pointer;
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 6px;
    justify-content: center;
}

/* Table Empty State */
.table-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.table-empty i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.4;
}

.table-empty p {
    margin: 0;
    font-size: 0.9rem;
}

/* ========================================
   Badges - Status Indicators
   ======================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    letter-spacing: 0.02em;
}

.badge-primary {
    background-color: var(--primary-100);
    color: var(--primary-dark);
}

.badge-secondary {
    background-color: var(--gray-200);
    color: var(--gray-700);
}

.badge-success {
    background-color: var(--success-light);
    color: var(--success-dark);
}

.badge-warning {
    background-color: var(--warning-light);
    color: var(--warning-dark);
}

.badge-danger {
    background-color: var(--danger-light);
    color: var(--danger-dark);
}

.badge-info {
    background-color: var(--info-light);
    color: var(--info-dark);
}

/* Badge Sizes */
.badge-sm {
    padding: 2px 8px;
    font-size: 0.7rem;
}

.badge-lg {
    padding: 6px 14px;
    font-size: 0.85rem;
}

/* ========================================
   Alerts - Notification Messages
   ======================================== */
.alert {
    padding: 14px 18px;
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 0.9rem;
}

.alert i {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert span {
    flex: 1;
}

.alert-success {
    background-color: var(--success-light);
    color: var(--success-dark);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.alert-warning {
    background-color: var(--warning-light);
    color: var(--warning-dark);
    border: 1px solid rgba(217, 119, 6, 0.2);
}

.alert-danger {
    background-color: var(--danger-light);
    color: var(--danger-dark);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.alert-info {
    background-color: var(--info-light);
    color: var(--info-dark);
    border: 1px solid rgba(8, 145, 178, 0.2);
}

.alert-close {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    transition: all var(--transition-fast);
    margin-left: auto;
    flex-shrink: 0;
}

.alert-close:hover {
    opacity: 1;
}

.messages {
    margin-bottom: 20px;
}

.messages .alert {
    animation: alertSlideIn 0.3s ease-out;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Page Header - Professional Layout
   ======================================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
    letter-spacing: -0.02em;
}

.page-description {
    color: var(--text-secondary);
    margin-top: 4px;
    font-size: 0.9rem;
}

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

/* Page Header with Gradient */
.page-header-gradient {
    background: var(--gradient-header);
    border-radius: var(--border-radius-lg);
    padding: 24px 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.page-header-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.08) 100%);
    pointer-events: none;
}

.page-header-gradient .page-title {
    color: white;
    font-size: 1.4rem;
    margin-bottom: 4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.page-header-gradient .page-description {
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
}

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

/* ========================================
   Stats Cards - Dashboard Metrics
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 20px 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

.stat-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.stat-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-card-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-card-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 4px;
    letter-spacing: -0.02em;
}

.stat-card-change {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========================================
   Filter Section - Search & Filters
   ======================================== */
.filter-section {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 20px 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 160px;
}

.filter-group.flex-grow {
    flex: 1;
    min-width: 200px;
}

.filter-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.filter-input,
.filter-select {
    padding: 9px 14px;
    font-size: 0.9rem;
    border: 1.5px solid var(--border-input);
    border-radius: var(--border-radius);
    background-color: var(--bg-input);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    height: 40px;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--focus-ring);
}

.filter-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23475569' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 38px;
    cursor: pointer;
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 18px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    height: 40px;
}

.filter-btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 1px 3px rgba(37, 99, 235, 0.3);
}

.filter-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 99, 235, 0.35);
}

.filter-btn-secondary {
    background-color: var(--gray-100);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.filter-btn-secondary:hover {
    background-color: var(--gray-200);
    color: var(--text-primary);
}

/* Search Box */
.search-box {
    position: relative;
    flex: 1;
}

.search-box .filter-input {
    width: 100%;
    padding-left: 40px;
}

.search-box-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    font-size: 1rem;
}

/* Export Buttons */
.export-buttons {
    display: flex;
    gap: 8px;
}

.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-export-excel {
    background-color: #217346;
    color: white;
}

.btn-export-excel:hover {
    background-color: #1a5c38;
    color: white;
}

.btn-export-pdf {
    background-color: #D32F2F;
    color: white;
}

.btn-export-pdf:hover {
    background-color: #b71c1c;
    color: white;
}

/* ========================================
   Pagination - Modern Style
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.page-item {
    display: inline-flex;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.page-link:hover {
    color: var(--primary);
    background-color: var(--primary-50);
    border-color: var(--primary-200);
}

.page-item.active .page-link {
    color: white;
    background: var(--gradient-primary);
    border-color: var(--primary);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.3);
}

.page-item.disabled .page-link {
    color: var(--text-muted);
    background-color: var(--gray-50);
    border-color: var(--border-color);
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-info {
    text-align: center;
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ========================================
   Login Page - Professional Auth Screen
   ======================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gray-900) 0%, var(--gray-800) 50%, #1E293B 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 30%, rgba(37, 99, 235, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(59, 130, 246, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.login-container {
    width: 100%;
    max-width: 420px;
    position: relative;
    z-index: 1;
}

.login-card {
    background-color: var(--bg-card);
    border-radius: var(--border-radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-xl);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.login-logo-icon {
    width: 52px;
    height: 52px;
    background: var(--gradient-primary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}

.login-logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

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

.login-form .btn {
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    margin-top: 8px;
}

/* ========================================
   Detail Modal - Professional Popup
   ======================================== */
.detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

.detail-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
}

.detail-modal-container {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    background-color: var(--bg-card);
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.25s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.detail-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 28px;
    background: var(--gradient-header);
    position: relative;
}

.detail-modal-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.detail-modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: var(--border-radius);
    cursor: pointer;
    color: white;
    transition: all var(--transition-fast);
}

.detail-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.25);
}

.detail-modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
}

.detail-modal-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-muted);
    gap: 16px;
}

.detail-modal-loading i {
    font-size: 2rem;
    color: var(--primary);
}

/* Detail Section */
.detail-section {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-color);
}

.detail-section:last-of-type {
    border-bottom: none;
}

.detail-section-title,
h4.detail-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-100);
}

.detail-section-title i {
    color: var(--primary);
}

/* Detail Grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.detail-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.detail-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    background-color: var(--gray-50);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-200);
}

.detail-item.full-width {
    grid-column: span 2;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.detail-value.empty {
    color: var(--text-muted);
    font-style: italic;
    font-weight: 400;
}

/* Detail Actions */
.detail-actions {
    display: flex;
    gap: 12px;
    padding: 20px 28px;
    background: var(--gray-50);
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
}

/* ========================================
   Dashboard Grid Layouts
   ======================================== */
.dashboard-grid {
    display: grid;
    gap: 24px;
    margin-top: 24px;
}

.dashboard-grid-2-1 {
    grid-template-columns: 2fr 1fr;
}

.dashboard-grid-1-1 {
    grid-template-columns: 1fr 1fr;
}

.dashboard-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1024px) {
    .dashboard-grid-2-1,
    .dashboard-grid-1-1,
    .dashboard-grid-3 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   List Group
   ======================================== */
.list-group {
    display: flex;
    flex-direction: column;
}

.list-group-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-card);
    transition: background-color var(--transition-fast);
}

.list-group-item:last-child {
    border-bottom: none;
}

.list-group-item:hover {
    background-color: var(--gray-50);
}

/* ========================================
   Utilities
   ======================================== */

/* Text */
.text-center { text-align: center; }
.text-right, .text-end { text-align: right; }
.text-left, .text-start { text-align: left; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

/* Font Weight */
.fw-normal { font-weight: 400; }
.fw-medium { font-weight: 500; }
.fw-semibold { font-weight: 600; }
.fw-bold { font-weight: 700; }

/* Font Size */
.fs-sm { font-size: 0.85rem; }
.fs-base { font-size: 1rem; }
.fs-lg { font-size: 1.125rem; }
.fs-xl { font-size: 1.25rem; }
.small { font-size: 0.85rem; }

/* Margin */
.m-0 { margin: 0; }
.m-1 { margin: 4px; }
.m-2 { margin: 8px; }
.m-3 { margin: 16px; }
.m-4 { margin: 24px; }
.m-5 { margin: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 32px; }

.ms-auto { margin-left: auto; }
.me-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Padding */
.p-0 { padding: 0; }
.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 16px; }
.p-4 { padding: 24px; }
.p-5 { padding: 32px; }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 4px; }
.pt-2 { padding-top: 8px; }
.pt-3 { padding-top: 16px; }
.pt-4 { padding-top: 24px; }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: 4px; }
.pb-2 { padding-bottom: 8px; }
.pb-3 { padding-bottom: 16px; }
.pb-4 { padding-bottom: 24px; }

.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 16px; padding-bottom: 16px; }
.py-4 { padding-top: 24px; padding-bottom: 24px; }

.px-1 { padding-left: 4px; padding-right: 4px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 16px; padding-right: 16px; }
.px-4 { padding-left: 24px; padding-right: 24px; }

/* Display */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-grid { display: grid; }

/* Flexbox */
.flex-row { flex-direction: row; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.flex-grow-1 { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }

.justify-content-start { justify-content: flex-start; }
.justify-content-end { justify-content: flex-end; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.justify-content-around { justify-content: space-around; }

.align-items-start { align-items: flex-start; }
.align-items-end { align-items: flex-end; }
.align-items-center { align-items: center; }
.align-items-stretch { align-items: stretch; }

/* Gap */
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 16px; }
.gap-4 { gap: 24px; }
.gap-5 { gap: 32px; }

/* Background */
.bg-white { background-color: white; }
.bg-light { background-color: var(--gray-50); }
.bg-transparent { background-color: transparent; }
.bg-primary-50 { background-color: var(--primary-50); }

/* Border */
.border { border: 1px solid var(--border-color); }
.border-0 { border: 0; }
.border-top { border-top: 1px solid var(--border-color); }
.border-bottom { border-bottom: 1px solid var(--border-color); }
.rounded { border-radius: var(--border-radius); }
.rounded-lg { border-radius: var(--border-radius-lg); }
.rounded-0 { border-radius: 0; }

/* Width & Height */
.w-100 { width: 100%; }
.w-auto { width: auto; }
.h-100 { height: 100%; }
.h-auto { height: auto; }

/* Position */
.position-relative { position: relative; }
.position-absolute { position: absolute; }

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .header {
        left: 0;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
    }

    .sidebar.open + .sidebar-overlay {
        display: block;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 13px;
    }

    .header-search {
        display: none;
    }

    .content-wrapper {
        padding: 16px;
        padding-top: calc(var(--header-height) + 16px);
    }

    .page-header-gradient {
        padding: 20px;
    }

    .page-header-gradient .page-title {
        font-size: 1.2rem;
    }

    .filter-section {
        padding: 16px;
    }

    .filter-form {
        flex-direction: column;
    }

    .filter-group,
    .filter-group.flex-grow,
    .search-box {
        width: 100%;
        min-width: 100%;
    }

    .filter-actions {
        width: 100%;
    }

    .filter-btn {
        flex: 1;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .detail-grid,
    .detail-grid-3,
    .detail-grid-4 {
        grid-template-columns: 1fr;
    }

    .detail-item.full-width {
        grid-column: span 1;
    }
}

/* ========================================
   Progress Bar
   ======================================== */
.progress {
    display: flex;
    height: 8px;
    overflow: hidden;
    background-color: var(--gray-200);
    border-radius: 4px;
}

.progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: white;
    text-align: center;
    white-space: nowrap;
    background: var(--gradient-primary);
    transition: width var(--transition-normal);
    font-size: 0;
}

.progress-lg {
    height: 20px;
    border-radius: var(--border-radius-sm);
}

.progress-lg .progress-bar {
    font-size: 0.75rem;
    font-weight: 600;
}

/* Progress Colors */
.progress-bar-success { background: var(--gradient-success); }
.progress-bar-warning { background: linear-gradient(135deg, var(--warning) 0%, var(--warning-dark) 100%); }
.progress-bar-danger { background: var(--gradient-danger); }

/* ========================================
   Table Row States
   ======================================== */
.table-row-danger {
    background-color: var(--danger-light) !important;
}

.table-row-danger:hover {
    background-color: #FECACA !important;
}

.table-row-warning {
    background-color: var(--warning-light) !important;
}

.table-row-success {
    background-color: var(--success-light) !important;
}

/* ========================================
   Button Groups
   ======================================== */
.btn-group {
    display: inline-flex;
    gap: 1px;
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.btn-group .btn:last-child {
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
}

.btn-group-sm .btn {
    padding: 4px 10px;
    font-size: 0.8rem;
}

/* ========================================
   Additional Utilities
   ======================================== */
.w-100 { width: 100%; }
.ms-1 { margin-left: 4px; }
.ms-2 { margin-left: 8px; }
.ms-3 { margin-left: 16px; }

.opacity-40 { opacity: 0.4; }
.opacity-60 { opacity: 0.6; }

.cursor-pointer { cursor: pointer; }

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .sidebar,
    .header,
    .page-actions,
    .filter-section,
    .btn,
    .pagination {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .content-wrapper {
        padding: 0 !important;
        padding-top: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
