/* ==========================================================================
   App stylesheet — plain CSS, no build step required.
   Tailwind utility classes used throughout the Blade views are provided at
   runtime by the Tailwind Play CDN script (see layout <head> sections).
   This file only holds hand-written component classes and overrides that
   used to rely on Tailwind's @apply — expanded here into literal CSS so
   nothing needs to be compiled ahead of time.
   ========================================================================== */

body {
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}

[x-cloak] {
    display: none !important;
}

/* Brand button/utility classes — used across the app UI redesign */
.btn-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 0.625rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #fff;
    background: linear-gradient(135deg, #232849, #c41e3a);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.22);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-brand:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(196, 30, 58, 0.3);
    color: #fff;
}

.btn-brand-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 0.625rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: #232849;
    background: #fff;
    border: 1.5px solid #e5e0d8;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-brand-outline:hover {
    border-color: #232849;
    background: #f8f7f4;
    color: #232849;
}

.card-elevated {
    background: #fff;
    border-radius: 1rem;
    border: 1px solid #f0eee9;
    box-shadow: 0 1px 3px rgba(23, 26, 48, 0.06), 0 1px 2px rgba(23, 26, 48, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card-elevated:hover {
    box-shadow: 0 10px 24px rgba(23, 26, 48, 0.1), 0 3px 8px rgba(23, 26, 48, 0.06);
    transform: translateY(-1px);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* --------------------------------------------------------------------
   Buttons — unified with the brand system (var(--primary)/var(--secondary)
   are declared globally in layouts/app.blade.php's <style> block).
   Kept as .btn / .btn-primary etc. for backward compatibility with
   existing views, but now visually consistent with .btn-brand.
   -------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.15rem;
    border-radius: 0.625rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, background-color 0.15s ease;
    outline: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
}

.btn:active { transform: translateY(0) scale(0.98); }

.btn:focus-visible {
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(35, 40, 73, 0.4);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary, #232849), var(--secondary, #c41e3a));
    color: #fff;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.2);
}

.btn-primary:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(196, 30, 58, 0.28);
    color: #fff;
}

.btn-secondary {
    background: #fff;
    color: var(--primary, #232849);
    border: 1.5px solid var(--border, #e5e0d8);
}

.btn-secondary:hover {
    border-color: var(--primary, #232849);
    background: var(--light, #faf9f7);
}

.btn-success {
    background-color: #16a34a;
    color: #fff;
}

.btn-success:hover {
    background-color: #15803d;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: #dc2626;
    color: #fff;
}

.btn-danger:hover {
    background-color: #b91c1c;
    transform: translateY(-1px);
}

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-lg { padding: 0.8rem 1.6rem; font-size: 1rem; }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    background: #f3f4f6;
    color: #4b5563;
}

.btn-icon:hover { transform: translateY(-1px); }
.btn-icon.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-icon.btn-danger:hover { background: #dc2626; color: #fff; }

/* --------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------- */
.card {
    background-color: #fff;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(23, 26, 48, 0.05), 0 1px 2px rgba(23, 26, 48, 0.04);
    border: 1px solid #f0eee9;
    overflow: hidden;
}

.card-header {
    padding: 1.1rem 1.5rem;
    border-bottom: 1px solid #f3f2ee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-body {
    padding: 1.25rem 1.5rem;
}

/* --------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------- */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 1.5px solid #e5e0d8;
    border-radius: 0.625rem;
    outline: none;
    font-size: 0.925rem;
    color: var(--text, #2c3e50);
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    box-shadow: 0 0 0 3px rgba(35, 40, 73, 0.12);
    border-color: var(--primary, #232849);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.4rem;
}

/* --------------------------------------------------------------------
   Badges — softer, pill-shaped, on-brand colors
   -------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.badge-primary { background-color: #e6e8f0; color: var(--primary, #232849); }
.badge-success { background-color: #dcfce7; color: #166534; }
.badge-warning { background-color: #fef3c7; color: #92400e; }
.badge-danger  { background-color: #fee2e2; color: #991b1b; }
.badge-secondary { background-color: #f3f4f6; color: #1f2937; }

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

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

::-webkit-scrollbar-thumb {
    background: #d4d0c8;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b5b0a5;
}

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

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

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

/* --------------------------------------------------------------------
   Tables — consistent, sleeker data tables across every module
   -------------------------------------------------------------------- */
.table-modern {
    width: 100%;
    border-collapse: collapse;
}

.table-modern thead th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    padding: 0.85rem 1.25rem;
    background: #faf9f7;
    border-bottom: 1px solid #f0eee9;
}

.table-modern tbody td {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid #f5f4f1;
    font-size: 0.9rem;
    color: var(--text, #2c3e50);
}

.table-modern tbody tr:last-child td { border-bottom: none; }
.table-modern tbody tr { transition: background-color 0.12s ease; }
.table-modern tbody tr:hover { background: #faf9f7; }
