/* Fix Layout and UI Issues */

/* Reset and Base */
* {
    box-sizing: border-box;
}

/* Buttons - Unified Size */
.btn, .btn-modern, button[type="submit"], button[type="button"], 
a.btn, a.btn-modern {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.2s;
    white-space: nowrap;
    min-height: 38px;
    gap: 0.5rem;
}

.btn-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    border: none;
}

.btn-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Input Fields - Unified Size */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="file"],
select,
textarea {
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
    min-height: 38px;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Labels */
label {
    font-size: 0.875rem !important;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
    display: block;
}

/* Cards */
.card, .glass-card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Tables */
table {
    width: 100%;
    font-size: 0.875rem;
}

table th {
    padding: 0.75rem 1rem !important;
    font-size: 0.75rem !important;
    font-weight: 600;
    text-transform: uppercase;
    background: #f9fafb;
}

table td {
    padding: 0.75rem 1rem !important;
    font-size: 0.875rem !important;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem !important;
    font-weight: 600;
    border-radius: 9999px;
    white-space: nowrap;
}

/* Grid Fixes */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Flex Fixes */
.flex {
    display: flex;
    align-items: center;
}

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

.space-x-2 > * + * {
    margin-left: 0.5rem;
}

.space-x-3 > * + * {
    margin-left: 0.75rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-4 {
    gap: 1rem;
}

/* Text Sizes */
.text-xs { font-size: 0.75rem !important; line-height: 1rem !important; }
.text-sm { font-size: 0.875rem !important; line-height: 1.25rem !important; }
.text-base { font-size: 1rem !important; line-height: 1.5rem !important; }
.text-lg { font-size: 1.125rem !important; line-height: 1.75rem !important; }
.text-xl { font-size: 1.25rem !important; line-height: 1.75rem !important; }

/* Spacing */
.p-2 { padding: 0.5rem !important; }
.p-4 { padding: 1rem !important; }
.p-6 { padding: 1.5rem !important; }
.px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
.py-2 { padding-top: 0.5rem !important; padding-bottom: 0.5rem !important; }
.m-2 { margin: 0.5rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mt-2 { margin-top: 0.5rem !important; }

/* Overflow */
.overflow-x-auto {
    overflow-x: auto;
}

.overflow-hidden {
    overflow: hidden;
}

/* Rounded */
.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

/* Colors */
.bg-white { background-color: white; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-green-500 { background-color: #10b981; }
.bg-red-500 { background-color: #ef4444; }
.bg-yellow-500 { background-color: #f59e0b; }

.text-white { color: white; }
.text-gray-700 { color: #374151; }
.text-gray-900 { color: #111827; }

/* Hover Effects */
.hover\:bg-blue-600:hover { background-color: #2563eb; }
.hover\:bg-green-600:hover { background-color: #059669; }
.hover\:bg-gray-50:hover { background-color: #f9fafb; }

/* Shadow */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }

/* Border */
.border { border-width: 1px; }
.border-gray-300 { border-color: #d1d5db; }

/* Width */
.w-full { width: 100%; }
.max-w-7xl { max-width: 80rem; }

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