/* NCRM Global Stylesheet */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #374151;
    background-color: #f9fafb;
}

/* GLOBAL BUTTON STYLES - ALWAYS VISIBLE */
button, 
.btn,
input[type="submit"],
input[type="button"] {
    /* Force visibility */
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    
    /* Base styling */
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    min-height: 2.5rem;
    
    /* Default blue button */
    background-color: #3b82f6 !important;
    color: white !important;
    
    /* Ensure text is visible */
    text-shadow: none;
    -webkit-font-smoothing: antialiased;
}

/* Primary Blue Button (Default) */
.btn-primary,
.bg-primary-600,
.bg-blue-600,
button:not(.btn-secondary):not(.btn-danger):not(.btn-success):not(.btn-warning) {
    background-color: #3b82f6 !important;
    color: white !important;
    border: 1px solid #3b82f6 !important;
}

.btn-primary:hover,
.bg-primary-600:hover,
.bg-blue-600:hover,
button:not(.btn-secondary):not(.btn-danger):not(.btn-success):not(.btn-warning):hover {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Secondary Button */
.btn-secondary,
.bg-gray-100,
.bg-secondary-100 {
    background-color: #f3f4f6 !important;
    color: #374151 !important;
    border: 1px solid #d1d5db !important;
}

.btn-secondary:hover,
.bg-gray-100:hover,
.bg-secondary-100:hover {
    background-color: #e5e7eb !important;
    border-color: #9ca3af !important;
}

/* Success Button */
.btn-success,
.bg-green-600 {
    background-color: #16a34a !important;
    color: white !important;
    border: 1px solid #16a34a !important;
}

.btn-success:hover,
.bg-green-600:hover {
    background-color: #15803d !important;
    border-color: #15803d !important;
}

/* Danger Button */
.btn-danger,
.text-red-600 {
    background-color: #dc2626 !important;
    color: white !important;
    border: 1px solid #dc2626 !important;
}

.btn-danger:hover,
.text-red-600:hover {
    background-color: #b91c1c !important;
    border-color: #b91c1c !important;
    color: white !important;
}

/* Warning Button */
.btn-warning,
.bg-yellow-600 {
    background-color: #ca8a04 !important;
    color: white !important;
    border: 1px solid #ca8a04 !important;
}

.btn-warning:hover,
.bg-yellow-600:hover {
    background-color: #a16207 !important;
    border-color: #a16207 !important;
}

/* Button Sizes */
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    min-height: 2rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    min-height: 3rem;
}

/* Disabled State */
button:disabled,
.btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    background-color: #9ca3af !important;
    border-color: #9ca3af !important;
}

/* Focus States */
button:focus,
.btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Link Buttons */
a.btn {
    text-decoration: none;
}

/* Action Buttons (Edit, Delete, View) */
.action-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    min-height: 1.75rem;
    margin: 0 0.125rem;
}

/* Modal Buttons */
.modal button,
.modal .btn {
    margin: 0.25rem;
}

/* Form Buttons */
form button,
form .btn {
    margin-top: 0.5rem;
}

/* Tailwind-like Utilities */
.bg-blue-600 { background-color: #2563eb !important; }
.bg-blue-700 { background-color: #1d4ed8 !important; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-white { background-color: white; }

.text-white { color: white !important; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-900 { color: #111827; }

.text-blue-600 { color: #2563eb; }
.text-green-600 { color: #16a34a; }
.text-red-600 { color: #dc2626; }

/* Hover states for text colors */
.text-blue-600:hover { color: #1d4ed8 !important; }
.text-green-600:hover { color: #15803d !important; }
.text-red-600:hover { color: #b91c1c !important; }

/* Layout Utilities */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }

/* Padding/Margin */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }

.m-2 { margin: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mr-3 { margin-right: 0.75rem; }

/* Border Radius */
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }

/* Shadows */
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }

/* Borders */
.border { border: 1px solid #d1d5db; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }

/* Width/Height */
.w-full { width: 100%; }
.h-16 { height: 4rem; }
.max-w-7xl { max-width: 80rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Typography */
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Forms */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #111827;
    background-color: white;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-weight: 500;
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: #f9fafb;
}

td {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e7eb;
}

tr:hover {
    background-color: #f9fafb;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal-content {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-width: 32rem;
    width: 100%;
    margin: 1rem;
    max-height: 90vh;
    overflow-y: auto;
}

/* Hidden utility */
.hidden {
    display: none !important;
}

/* Responsive Grid */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .md\\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .md\\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

/* Navigation */
nav {
    background-color: white;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #e5e7eb;
}

/* Cards */
.card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    border: 1px solid;
}

.alert-success {
    background-color: #f0fdf4;
    border-color: #16a34a;
    color: #15803d;
}

.alert-error {
    background-color: #fef2f2;
    border-color: #dc2626;
    color: #b91c1c;
}

/* Ensure all interactive elements are visible */
a, button, input, select, textarea, [role="button"], [tabindex] {
    visibility: visible !important;
    opacity: 1 !important;
}

/* Force button visibility on all states */
button, .btn {
    background-color: #3b82f6 !important;
    color: white !important;
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}