/* Companies Manager - Main Stylesheet */

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

/* Layout */
.bg-gray-50 { background-color: #f9fafb !important; }
.bg-white { background-color: white !important; }
.bg-gray-100 { background-color: #f3f4f6 !important; }
.bg-green-50 { background-color: #f0fdf4 !important; }
.bg-green-100 { background-color: #dcfce7 !important; }
.bg-red-50 { background-color: #fef2f2 !important; }
.bg-blue-50 { background-color: #eff6ff !important; }
.bg-yellow-50 { background-color: #fefce8 !important; }

.min-h-screen { min-height: 100vh !important; }

/* Flexbox */
.flex { display: flex !important; }
.flex-col { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-1 { flex: 1 1 0% !important; }
.inline-flex { display: inline-flex !important; }

/* Grid */
.grid { display: grid !important; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }
.lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.lg\:col-span-1 { grid-column: span 1 / span 1 !important; }
.lg\:col-span-2 { grid-column: span 2 / span 2 !important; }

/* Spacing */
.justify-between { justify-content: space-between !important; }
.justify-center { justify-content: center !important; }
.items-center { align-items: center !important; }
.space-x-2 > * + * { margin-left: 0.5rem !important; }
.space-x-4 > * + * { margin-left: 1rem !important; }
.space-x-8 > * + * { margin-left: 2rem !important; }
.space-y-2 > * + * { margin-top: 0.5rem !important; }
.space-y-3 > * + * { margin-top: 0.75rem !important; }
.space-y-4 > * + * { margin-top: 1rem !important; }
.space-y-6 > * + * { margin-top: 1.5rem !important; }
.space-y-8 > * + * { margin-top: 2rem !important; }

.gap-3 { gap: 0.75rem !important; }
.gap-4 { gap: 1rem !important; }
.gap-6 { gap: 1.5rem !important; }
.gap-8 { gap: 2rem !important; }

/* Padding */
.p-0 { padding: 0 !important; }
.p-3 { padding: 0.75rem !important; }
.p-4 { padding: 1rem !important; }
.px-2\.5 { padding-left: 0.625rem !important; padding-right: 0.625rem !important; }
.px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
.py-0\.5 { padding-top: 0.125rem !important; padding-bottom: 0.125rem !important; }
.py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
.py-8 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
.py-12 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.pb-4 { padding-bottom: 1rem !important; }
.pt-6 { padding-top: 1.5rem !important; }
.sm\:px-6 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
.lg\:px-8 { padding-left: 2rem !important; padding-right: 2rem !important; }

/* Margin */
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.mt-auto { margin-top: auto !important; }
.mr-1 { margin-right: 0.25rem !important; }
.mr-2 { margin-right: 0.5rem !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-6 { margin-top: 1.5rem !important; }
.mt-8 { margin-top: 2rem !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 0.75rem !important; }
.mb-4 { margin-bottom: 1rem !important; }
.mb-6 { margin-bottom: 1.5rem !important; }
.mb-8 { margin-bottom: 2rem !important; }

/* Width & Height */
.w-16 { width: 4rem !important; }
.max-w-7xl { max-width: 80rem !important; }

/* Borders */
.border { border-width: 1px !important; }
.border-b { border-bottom-width: 1px !important; }
.border-t { border-top-width: 1px !important; }
.border-gray-200 { border-color: #e5e7eb !important; }
.border-green-200 { border-color: #bbf7d0 !important; }
.border-red-200 { border-color: #fecaca !important; }
.border-blue-200 { border-color: #bfdbfe !important; }
.border-yellow-200 { border-color: #fde68a !important; }
.rounded-md { border-radius: 0.375rem !important; }
.rounded-lg { border-radius: 0.5rem !important; }
.rounded-full { border-radius: 9999px !important; }
.divide-y > * + * { border-top-width: 1px !important; }
.divide-gray-200 > * + * { border-color: #e5e7eb !important; }

/* Shadows */
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important; }

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

/* Text */
.text-xs { font-size: 0.75rem !important; line-height: 1rem !important; }
.text-sm { font-size: 0.875rem !important; line-height: 1.25rem !important; }
.text-md { 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; }
.text-2xl { font-size: 1.5rem !important; line-height: 2rem !important; }
.text-3xl { font-size: 1.875rem !important; line-height: 2.25rem !important; }
.text-4xl { font-size: 2.25rem !important; line-height: 2.5rem !important; }

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

.text-gray-300 { color: #d1d5db !important; }
.text-gray-500 { color: #6b7280 !important; }
.text-gray-600 { color: #4b5563 !important; }
.text-gray-700 { color: #374151 !important; }
.text-gray-800 { color: #1f2937 !important; }
.text-gray-900 { color: #111827 !important; }
.text-primary-600 { color: #2563eb !important; }
.text-yellow-500 { color: #eab308 !important; }
.text-green-500 { color: #22c55e !important; }
.text-green-800 { color: #166534 !important; }
.text-red-500 { color: #ef4444 !important; }
.text-red-800 { color: #991b1b !important; }
.text-blue-500 { color: #3b82f6 !important; }
.text-blue-800 { color: #1e40af !important; }
.text-yellow-800 { color: #92400e !important; }

.hover\:text-primary-600:hover { color: #2563eb !important; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6 !important; }

.text-center { text-align: center !important; }
.uppercase { text-transform: uppercase !important; }
.tracking-wider { letter-spacing: 0.05em !important; }
.whitespace-nowrap { white-space: nowrap !important; }

/* Display */
.hidden { display: none !important; }

/* Transitions */
.transition-colors {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke !important;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
    transition-duration: 150ms !important;
}

/* Focus */
.focus\:outline-none:focus { outline: 2px solid transparent !important; outline-offset: 2px !important; }
.focus\:text-primary-600:focus { color: #2563eb !important; }

/* ===========================================
   Components
   =========================================== */

/* Buttons */
.btn-primary { background-color: #2563eb !important; color: white !important; }
.btn-secondary { background-color: #e5e7eb !important; color: #111827 !important; }
.btn-success { background-color: #16a34a !important; color: white !important; }
.btn-danger { background-color: #dc2626 !important; color: white !important; }

.btn {
    padding: 0.5rem 1rem !important;
    border-radius: 0.375rem !important;
    font-weight: 500 !important;
    transition: all 0.2s !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    border: none !important;
    cursor: pointer !important;
    min-height: 2.5rem !important;
    min-width: 3rem !important;
}

.btn-sm {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.875rem !important;
    min-height: 2rem !important;
    min-width: 2.5rem !important;
}

.btn:hover {
    opacity: 0.9 !important;
    transform: translateY(-1px) !important;
}

.btn-primary:hover { background-color: #1d4ed8 !important; }
.btn-secondary:hover { background-color: #d1d5db !important; }
.btn-success:hover { background-color: #15803d !important; }
.btn-danger:hover { background-color: #b91c1c !important; }

.btn:focus {
    outline: 2px solid transparent !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5) !important;
}

/* Tables */
.table {
    min-width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background-color: white !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    border-radius: 0.5rem !important;
    overflow: hidden !important;
}

.table th {
    padding: 0.75rem 1.5rem !important;
    background-color: #f9fafb !important;
    text-align: left !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    color: #6b7280 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    border-bottom: 1px solid #e5e7eb !important;
    vertical-align: middle !important;
    min-width: 6rem !important;
}

.table td {
    padding: 1rem 1.5rem !important;
    white-space: nowrap !important;
    font-size: 0.875rem !important;
    color: #111827 !important;
    border-bottom: 1px solid #e5e7eb !important;
    vertical-align: middle !important;
    min-width: 6rem !important;
}

.table tbody tr:nth-child(even) { background-color: #f9fafb !important; }
.table tbody tr:hover { background-color: #f3f4f6 !important; }

.table th:nth-child(1), .table td:nth-child(1) { min-width: 8rem !important; }
.table th:nth-child(2), .table td:nth-child(2) { min-width: 10rem !important; }
.table th:nth-child(3), .table td:nth-child(3) { min-width: 8rem !important; }

/* Cards */
.card {
    background-color: white !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    border-radius: 0.5rem !important;
    border: 1px solid #e5e7eb !important;
}

.card-header { padding: 1rem 1.5rem !important; border-bottom: 1px solid #e5e7eb !important; }
.card-body { padding: 1rem 1.5rem !important; }

/* Form Inputs */
.form-input {
    display: block !important;
    width: 100% !important;
    border-radius: 0.375rem !important;
    border: 1px solid #d1d5db !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    font-size: 0.875rem !important;
    padding: 0.5rem 0.75rem !important;
    background-color: white !important;
    color: #111827 !important;
}

.form-input:focus {
    outline: 2px solid transparent !important;
    outline-offset: 2px !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 1px #3b82f6 !important;
}

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

/* Checkboxes */
input[type="checkbox"] {
    width: 1rem !important;
    height: 1rem !important;
    border-radius: 0.25rem !important;
    border: 1px solid #d1d5db !important;
    background-color: white !important;
}

input[type="checkbox"]:checked {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

/* Table Inputs */
.table input[type="text"],
.table input[type="email"],
.table input[type="password"],
.table input[type="number"],
.table input[type="url"],
.table select,
.table textarea,
.table .form-input {
    font-size: 0.75rem !important;
    padding: 0.375rem 0.5rem !important;
    min-height: 1.75rem !important;
    border-radius: 0.25rem !important;
    border: 1px solid #d1d5db !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    transition: all 0.15s ease-in-out !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 6rem !important;
    background-color: white !important;
    color: #111827 !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.table input[type="text"]:focus,
.table input[type="email"]:focus,
.table input[type="password"]:focus,
.table input[type="number"]:focus,
.table input[type="url"]:focus,
.table select:focus,
.table textarea:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1) !important;
}

.table input[type="text"]:hover,
.table input[type="email"]:hover,
.table input[type="password"]:hover,
.table input[type="number"]:hover,
.table input[type="url"]:hover,
.table select:hover,
.table textarea:hover {
    border-color: #9ca3af !important;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1) !important;
}

.table input::placeholder,
.table textarea::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

.table input:disabled,
.table select:disabled,
.table textarea:disabled {
    background-color: #f9fafb !important;
    color: #6b7280 !important;
    cursor: not-allowed !important;
}

.table input.error,
.table select.error,
.table textarea.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444 !important;
}

.table input.success,
.table select.success,
.table textarea.success {
    border-color: #22c55e !important;
    box-shadow: 0 0 0 1px #22c55e !important;
}

.table input[size],
.table select[size] {
    width: 100% !important;
    min-width: 6rem !important;
}

/* Form Control (Legacy) */
.form-control {
    font-size: 0.75rem !important;
    padding: 0.375rem 0.5rem !important;
    min-height: 1.75rem !important;
    border-radius: 0.25rem !important;
    border: 1px solid #d1d5db !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    transition: all 0.15s ease-in-out !important;
    width: 100% !important;
    background-color: white !important;
    color: #111827 !important;
    font-family: inherit !important;
}

.form-control:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1) !important;
}

.form-control:hover {
    border-color: #9ca3af !important;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1) !important;
}

.card .form-input,
.card .form-control {
    font-size: 0.75rem !important;
    padding: 0.375rem 0.5rem !important;
    min-height: 1.75rem !important;
    border-radius: 0.25rem !important;
    border: 1px solid #d1d5db !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    transition: all 0.15s ease-in-out !important;
    width: 100% !important;
    background-color: white !important;
    color: #111827 !important;
    font-family: inherit !important;
}

.card .form-input:focus,
.card .form-control:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1) !important;
}

.card .form-input:hover,
.card .form-control:hover {
    border-color: #9ca3af !important;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1) !important;
}

/* Select Dropdowns */
select,
select.form-input,
select.form-control,
.table select {
    font-size: 0.625rem !important;
    padding: 0.25rem 0.375rem !important;
    min-height: 1.5rem !important;
    border-radius: 0.25rem !important;
    border: 1px solid #d1d5db !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    transition: all 0.15s ease-in-out !important;
    width: 100% !important;
    background-color: white !important;
    color: #111827 !important;
    font-family: inherit !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.375rem center;
    background-repeat: no-repeat;
    background-size: 1.25em 1.25em;
    padding-right: 2rem !important;
}

select:focus,
select.form-input:focus,
select.form-control:focus,
.table select:focus {
    outline: none !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1) !important;
}

select:hover,
select.form-input:hover,
select.form-control:hover,
.table select:hover {
    border-color: #9ca3af !important;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1) !important;
}

/* Checkboxes in Tables */
.table input[type="checkbox"] {
    width: 1rem !important;
    height: 1rem !important;
    border-radius: 0.25rem !important;
    border: 1px solid #d1d5db !important;
    background-color: white !important;
    cursor: pointer !important;
}

.table input[type="checkbox"]:checked {
    background-color: #3b82f6 !important;
    border-color: #3b82f6 !important;
}

.table input[type="checkbox"]:focus {
    outline: 2px solid transparent !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5) !important;
}

/* Textareas */
textarea,
.form-textarea {
    display: block !important;
    width: 100% !important;
    border-radius: 0.375rem !important;
    border: 1px solid #d1d5db !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    font-size: 0.875rem !important;
    padding: 0.5rem 0.75rem !important;
    background-color: white !important;
    color: #111827 !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
    resize: vertical !important;
    min-height: 2.5rem !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

textarea:focus,
.form-textarea:focus {
    outline: 2px solid transparent !important;
    outline-offset: 2px !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 1px #3b82f6 !important;
}

textarea:hover,
.form-textarea:hover {
    border-color: #9ca3af !important;
}

textarea::placeholder,
.form-textarea::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

textarea:disabled,
.form-textarea:disabled {
    background-color: #f9fafb !important;
    color: #6b7280 !important;
    cursor: not-allowed !important;
}

textarea.error,
.form-textarea.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444 !important;
}

textarea.success,
.form-textarea.success {
    border-color: #22c55e !important;
    box-shadow: 0 0 0 1px #22c55e !important;
}

.table textarea {
    font-size: 0.75rem !important;
    padding: 0.375rem 0.5rem !important;
    min-height: 2rem !important;
}

/* URL Inputs */
input[type="url"],
.form-url {
    display: block !important;
    width: 100% !important;
    border-radius: 0.375rem !important;
    border: 1px solid #d1d5db !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    font-size: 0.875rem !important;
    padding: 0.5rem 0.75rem !important;
    background-color: white !important;
    color: #111827 !important;
    font-family: inherit !important;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out !important;
}

input[type="url"]:focus,
.form-url:focus {
    outline: 2px solid transparent !important;
    outline-offset: 2px !important;
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 1px #3b82f6 !important;
}

input[type="url"]:hover,
.form-url:hover {
    border-color: #9ca3af !important;
}

input[type="url"]::placeholder,
.form-url::placeholder {
    color: #9ca3af !important;
    opacity: 1 !important;
}

input[type="url"]:disabled,
.form-url:disabled {
    background-color: #f9fafb !important;
    color: #6b7280 !important;
    cursor: not-allowed !important;
}

input[type="url"].error,
.form-url.error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444 !important;
}

input[type="url"].success,
.form-url.success {
    border-color: #22c55e !important;
    box-shadow: 0 0 0 1px #22c55e !important;
}

.table input[type="url"] {
    font-size: 0.75rem !important;
    padding: 0.375rem 0.5rem !important;
}

/* Error Messages */
.error-message,
.error,
.field-error,
.validation-error,
.help-block,
.invalid-feedback,
.text-danger {
    color: #dc2626 !important;
    font-size: 0.875rem !important;
    margin-top: 0.25rem !important;
    display: block !important;
}

.form-input.error,
.form-textarea.error,
input.error,
textarea.error,
select.error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 1px #dc2626 !important;
}

.alert-danger,
.alert-error {
    background-color: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
}

.error-list {
    color: #dc2626 !important;
    font-size: 0.875rem !important;
    margin-top: 0.25rem !important;
}

.error-list ul {
    margin: 0 !important;
    padding-left: 1rem !important;
    list-style-type: disc !important;
}

.error-list li {
    color: #dc2626 !important;
    margin-bottom: 0.25rem !important;
}

/* Alerts */
.alert {
    padding: 1rem !important;
    border-radius: 0.375rem !important;
    margin-bottom: 1rem !important;
    border: 1px solid !important;
}

.alert-success {
    background-color: #f0fdf4 !important;
    border-color: #bbf7d0 !important;
    color: #166534 !important;
}

.alert-error {
    background-color: #fef2f2 !important;
    border-color: #fecaca !important;
    color: #991b1b !important;
}

.alert-info {
    background-color: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: #1e40af !important;
}

.alert-warning {
    background-color: #fefce8 !important;
    border-color: #fde68a !important;
    color: #92400e !important;
}

/* ===========================================
   Responsive Media Queries
   =========================================== */

@media (min-width: 640px) {
    .sm\:px-6 { padding-left: 1.5rem !important; padding-right: 1.5rem !important; }
}

@media (min-width: 768px) {
    .md\:flex { display: flex !important; }
    .md\:hidden { display: none !important; }
}

@media (min-width: 1024px) {
    .lg\:px-8 { padding-left: 2rem !important; padding-right: 2rem !important; }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
    .lg\:col-span-1 { grid-column: span 1 / span 1 !important; }
    .lg\:col-span-2 { grid-column: span 2 / span 2 !important; }
}