:root {
    --brand: #FADB5F;
    --brand-dark: #eab308;
    --brand-soft: #fefce8;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #cbd5e1;
    --surface: #ffffff;
    --soft: #f8fafc;
}

* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    margin: 0;
    overflow-x: hidden;
    background: #f7f9fc;
    color: var(--ink);
    font-family: Poppins, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
}

.app-input,
.app-select,
.app-textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 0.625rem;
    background: #ffffff;
    color: var(--ink);
    font-size: 0.875rem;
    font-weight: 400;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.app-input,
.app-select {
    min-height: 2.5rem;
    padding: 0.55rem 0.75rem;
}

.app-textarea {
    min-height: 6.5rem;
    padding: 0.7rem 0.75rem;
}

.app-input:focus,
.app-select:focus,
.app-textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.app-label {
    display: block;
    margin-bottom: 0.35rem;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 800;
}

.app-btn {
    display: inline-flex;
    min-height: 2.35rem;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border-radius: 0.625rem;
    border: 1px solid transparent;
    padding: 0.5rem 0.8rem;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.app-btn-sm {
    min-height: 2rem;
    padding: 0.42rem 0.65rem;
    font-size: 0.78rem;
}

.app-btn-primary {
    background: var(--brand);
    border-color: var(--brand);
    color: #0f172a;
}

.app-btn-primary:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #0f172a;
}

.app-btn-dark {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.app-btn-outline {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #334155;
}

.app-btn-outline:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    color: #0f172a;
}

.app-btn-danger {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

.app-btn-success {
    background: #059669;
    border-color: #059669;
    color: #ffffff;
}

.app-card {
    border: 1px solid var(--line);
    border-radius: 0.875rem;
    background: var(--surface);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.sidebar {
}

.sidebar::after {
    content: "";
    display: block;
    height: 2rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.55rem;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.back-link:hover {
    color: var(--brand);
}

.font-black {
    font-weight: 700 !important;
}

.status-pill {
    display: inline-flex;
    min-height: 1.55rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1;
}

.status-approved,
.status-active,
.status-converted {
    background: #dcfce7;
    color: #166534;
}

.status-success{
    background: #dcfce7;
    color: #166534;
}

.status-pending,
.status-maintenance {
    background: #fef3c7;
    color: #92400e;
}

.status-rejected,
.status-inactive,
.status-closed,
.status-danger {
    background: #fee2e2;
    color: #991b1b;
}

.status-soft {
    background: #dbeafe;
    color: #1d4ed8;
}

.switch-control {
    position: relative;
    width: 2.6rem;
    height: 1.35rem;
    appearance: none;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #e2e8f0;
    cursor: pointer;
    transition: background 0.18s ease;
}

.switch-control::after {
    content: "";
    position: absolute;
    left: 0.18rem;
    top: 0.17rem;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
    transition: transform 0.18s ease;
}

.switch-control:checked {
    border-color: var(--brand);
    background: var(--brand);
}

.switch-control:checked::after {
    transform: translateX(1.18rem);
}

.lucide {
    width: 1rem;
    height: 1rem;
    stroke-width: 2.2;
}

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

.nav-open .mobile-backdrop {
    display: block;
}

/* Temporary compatibility for older Blade screens while the app is Tailwind-first. */
.form-section,
.table-wrap,
.auth-card,
.page-hero,
.dash-hero {
    border: 1px solid var(--line);
    border-radius: 0.875rem;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.form-section {
    padding: 1.25rem;
}

.page-hero,
.dash-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1.25rem;
}

.page-hero h1,
.dash-hero h1 {
    color: #0f172a;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.15;
}

.page-hero p,
.dash-hero p {
    margin-top: 0.25rem;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
}

.table-wrap {
    overflow-x: auto;
}

.metric {
    border: 1px solid var(--line);
    border-radius: 0.875rem;
    background: #ffffff;
    padding: 1rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.metric span {
    display: block;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.metric strong {
    display: block;
    margin-top: 0.35rem;
    color: #0f172a;
    font-size: 1.35rem;
    font-weight: 700;
}

.form-control {
    width: 100%;
    min-height: 2.5rem;
    border: 1px solid var(--line);
    border-radius: 0.625rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    outline: none;
}

.form-select {
    width: 100%;
    min-height: 2.5rem;
    border: 1px solid var(--line);
    border-radius: 0.625rem;
    background: #ffffff;
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.form-label {
    display: block;
    margin-bottom: 0.35rem;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 800;
}

.btn {
    display: inline-flex;
    min-height: 2.35rem;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    border-radius: 0.625rem;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #334155;
    padding: 0.5rem 0.8rem;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.btn-sm {
    min-height: 2rem;
    padding: 0.42rem 0.65rem;
    font-size: 0.78rem;
}

.btn-primary {
    border-color: var(--brand);
    background: var(--brand);
    color: #ffffff;
}

.btn-dark {
    border-color: #0f172a;
    background: #0f172a;
    color: #ffffff;
}

.btn-success {
    border-color: #059669;
    background: #059669;
    color: #ffffff;
}

.btn-danger {
    border-color: #dc2 la-red-600;
    background: #dc2626;
    color: #ffffff;
}

.btn-outline-primary,
.btn-outline-dark {
    border-color: #cbd5e1;
    background: #ffffff;
    color: #334155;
}

.btn-outline-danger {
    border-color: #fecaca;
    background: #ffffff;
    color: #dc2626;
}

.table {
    width: 100%;
    min-width: 820px;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
}

.table th,
.table td {
    border-bottom: 1px solid #f1f5f9;
    padding: 0.8rem 1rem;
    vertical-align: middle;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.badge-approved,
.badge-rejected,
.badge-pending {
    display: inline-flex;
    min-height: 1.55rem;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0.25rem 0.65rem;
    font-size: 0.72rem;
    font-weight: 700;
}

.badge-approved {
    background: #dcfce7;
    color: #166534;
}

.badge-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.stat-label {
    display: block;
    margin-bottom: 0.2rem;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.table-hover tbody tr:hover {
    background: #f8fafc;
}

.align-middle td,
.align-middle th {
    vertical-align: middle;
}

nav[aria-label="pagination"] {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

nav[aria-label="pagination"] .flex {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

nav[aria-label="pagination"] span,
nav[aria-label="pagination"] a {
    display: inline-flex;
    min-height: 2rem;
    min-width: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

nav[aria-label="pagination"] a:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

nav[aria-label="pagination"] span[aria-current="page"] span,
nav[aria-label="pagination"] span[aria-current="page"] {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

nav[aria-label="pagination"] span[aria-disabled] span {
    color: #cbd5e1;
    cursor: not-allowed;
}

.table tbody td[colspan] {
    text-align: center;
    padding: 2.5rem 1rem;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 600;
}

@media (max-width: 640px) {
    .table-wrap {
        border-radius: 0.875rem;
    }
    .table-actions {
        flex-direction: column;
        align-items: flex-end;
    }
}

form[method="post"] button.btn-outline-danger:hover,
form[method="post"] button.app-btn-danger:hover {
    opacity: 0.85;
}

@media (max-width: 767px) {
    .col-md-4 .metric {
        margin-bottom: 0.5rem;
    }
}

input:required:user-invalid,
select:required:user-invalid,
textarea:required:user-invalid {
    border-color: #f87171 !important;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15) !important;
}

input[type="date"]:required:placeholder-shown {
    border-color: #f87171 !important;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.15) !important;
}

input[type="file"] {
    font-size: 0.8rem;
    padding: 0.4rem .5rem;
    /* border: 1px solid var(--line); */
    border-radius: 0.625rem;
    background: #ffffff;
    cursor: pointer;
    width: 100%;
}

input[type="file"]::file-selector-button {
    background: var(--brand);
    border-color: var(--brand);
    color: #0f172a;
    border: none;
    border-radius: 0.5rem;
    padding: 0.3rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 0.75rem;
}

input[type="file"]::file-selector-button:hover {
    background: var(--brand-dark);
    border-color: var(--brand-dark);
}