/* NirmaanSetu Admin Dashboard — Styles */
/* Using vanilla CSS with utility classes matching existing Tailwind patterns */

:root {
    --primary: #f97316;
    --primary-hover: #ea580c;
    --primary-light: #fff7ed;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Remove default browser button borders and outlines */
button,
[type="button"],
[type="reset"],
[type="submit"] {
    border: none;
    outline: none;
    background: none;
    cursor: pointer;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
}

/* ── Layout Utilities ── */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.flex-1 {
    flex: 1;
}

.flex-col {
    flex-direction: column;
}

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

.items-center {
    align-items: center;
}

.items-start {
    align-items: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-end {
    justify-content: flex-end;
}

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

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

.space-x-4>*+* {
    margin-left: 1rem;
}

.space-y-1>*+* {
    margin-top: 0.25rem;
}

.space-y-3>*+* {
    margin-top: 0.75rem;
}

.space-y-4>*+* {
    margin-top: 1rem;
}

.space-y-6>*+* {
    margin-top: 1.5rem;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

.gap-6 {
    gap: 1.5rem;
}

/* Grid */
.grid {
    display: grid;
}

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

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

    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    .md\:flex {
        display: flex;
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }

    .lg\:col-span-2 {
        grid-column: span 2;
    }

    .lg\:flex-row {
        flex-direction: row;
    }

    .lg\:items-center {
        align-items: center;
    }
}

/* ── Sizing ── */
.w-full {
    width: 100%;
}

.w-8 {
    width: 2rem;
}

.w-10 {
    width: 2.5rem;
}

.w-12 {
    width: 3rem;
}

.w-16 {
    width: 4rem;
}

.w-64 {
    width: 16rem;
}

.h-8 {
    height: 2rem;
}

.h-10 {
    height: 2.5rem;
}

.h-12 {
    height: 3rem;
}

.h-16 {
    height: 4rem;
}

.h-64 {
    height: 16rem;
}

.h-full {
    height: 100%;
}

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

.max-w-md {
    max-width: 28rem;
}

.max-w-2xl {
    max-width: 42rem;
}

.max-w-3xl {
    max-width: 48rem;
}

.max-h-96 {
    max-height: 24rem;
}

.max-h-\[80vh\] {
    max-height: 80vh;
}

.ml-64 {
    margin-left: 16rem;
}

/* ── Spacing ── */
.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.p-8 {
    padding: 2rem;
}

.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mb-8 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 1.5rem;
}

.mx-4 {
    margin-left: 1rem;
    margin-right: 1rem;
}

.mx-8 {
    margin-left: 2rem;
    margin-right: 2rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.pl-3 {
    padding-left: 0.75rem;
}

.pl-4 {
    padding-left: 1rem;
}

.pl-10 {
    padding-left: 2.5rem;
}

.pr-3 {
    padding-right: 0.75rem;
}

.pt-4 {
    padding-top: 1rem;
}

.py-0\.5 {
    padding-top: 0.125rem;
    padding-bottom: 0.125rem;
}

/* ── Typography ── */
.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

.tracking-wider {
    letter-spacing: 0.05em;
}

.tracking-widest {
    letter-spacing: 0.1em;
}

.uppercase {
    text-transform: uppercase;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.leading-5 {
    line-height: 1.25rem;
}

.font-mono {
    font-family: ui-monospace, SFMono-Regular, monospace;
}

/* ── Colors ── */
.text-white {
    color: #fff;
}

.text-gray-400 {
    color: var(--gray-400);
}

.text-gray-500 {
    color: var(--gray-500);
}

.text-gray-600 {
    color: var(--gray-600);
}

.text-gray-700 {
    color: var(--gray-700);
}

.text-gray-900 {
    color: var(--gray-900);
}

.text-orange-500 {
    color: #f97316;
}

.text-red-600 {
    color: #dc2626;
}

.text-red-800 {
    color: #991b1b;
}

.text-red-900 {
    color: #7f1d1d;
}

.text-green-600 {
    color: #16a34a;
}

.text-green-800 {
    color: #166534;
}

.text-blue-500 {
    color: #3b82f6;
}

.text-blue-700 {
    color: #1d4ed8;
}

.text-blue-800 {
    color: #1e40af;
}

.text-yellow-600 {
    color: #ca8a04;
}

.text-yellow-800 {
    color: #854d0e;
}

.text-purple-600 {
    color: #9333ea;
}

.bg-white {
    background-color: #fff;
}

.bg-gray-50 {
    background-color: var(--gray-50);
}

.bg-gray-100 {
    background-color: var(--gray-100);
}

.bg-orange-50 {
    background-color: #fff7ed;
}

.bg-orange-500 {
    background-color: #f97316;
}

.bg-red-50 {
    background-color: #fef2f2;
}

.bg-red-100 {
    background-color: #fee2e2;
}

.bg-red-500 {
    background-color: #ef4444;
}

.bg-green-100 {
    background-color: #dcfce7;
}

.bg-green-500 {
    background-color: #22c55e;
}

.bg-blue-50 {
    background-color: #eff6ff;
}

.bg-blue-100 {
    background-color: #dbeafe;
}

.bg-blue-500 {
    background-color: #3b82f6;
}

.bg-yellow-100 {
    background-color: #fef9c3;
}

.bg-yellow-500 {
    background-color: #eab308;
}

.bg-purple-100 {
    background-color: #f3e8ff;
}

.bg-purple-500 {
    background-color: #a855f7;
}

.bg-purple-600 {
    background-color: #9333ea;
}

.hover\:bg-purple-600:hover {
    background-color: #9333ea;
}

.bg-gray-700 {
    background-color: #374151;
}

.bg-gray-800 {
    background-color: #1f2937;
}

.hover\:bg-gray-800:hover {
    background-color: #1f2937;
}

.bg-amber-500 {
    background-color: #f59e0b;
}

.bg-amber-600 {
    background-color: #d97706;
}

.hover\:bg-amber-600:hover {
    background-color: #d97706;
}

.bg-gradient-to-br {
    background: linear-gradient(to bottom right, var(--tw-gradient-from), var(--tw-gradient-to));
}

.from-gray-900 {
    --tw-gradient-from: #111827;
}

.to-gray-800 {
    --tw-gradient-to: #1f2937;
}

body .bg-gradient-to-br.from-gray-900.to-gray-800 {
    background: linear-gradient(to bottom right, #111827, #1f2937);
}

.bg-black {
    background-color: #000;
}

.bg-opacity-50 {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.5);
}

/* ── Borders ── */
.border {
    border: 1px solid var(--gray-200);
}

.border-b {
    border-bottom: 1px solid var(--gray-200);
}

.border-t {
    border-top: 1px solid var(--gray-200);
}

.border-gray-200 {
    border-color: var(--gray-200);
}

.border-gray-300 {
    border-color: var(--gray-200);
}

.border-orange-500 {
    border-color: #f97316;
}

.border-red-300 {
    border-color: #fca5a5;
}

.rounded {
    border-radius: 0.25rem;
}

.rounded-md {
    border-radius: 0.375rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.rounded-2xl {
    border-radius: 1rem;
}

.rounded-full {
    border-radius: 9999px;
}

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

.shadow-lg {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.shadow-2xl {
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.transition-colors {
    transition: color 150ms, background-color 150ms, border-color 150ms;
}

.transition-all {
    transition: all 150ms;
}

.transition-opacity {
    transition: opacity 300ms;
}

/* ── Positioning ── */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.sticky {
    position: sticky;
    top: 0;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

.inset-y-0 {
    top: 0;
    bottom: 0;
}

.top-0 {
    top: 0;
}

.top-1 {
    top: 0.25rem;
}

.top-4 {
    top: 1rem;
}

.right-0 {
    right: 0;
}

.right-1 {
    right: 0.25rem;
}

.right-4 {
    right: 1rem;
}

.left-0 {
    left: 0;
}

.z-20 {
    z-index: 20;
}

.z-30 {
    z-index: 30;
}

.z-50 {
    z-index: 50;
}

.z-\[100\] {
    z-index: 100;
}

.z-\[200\] {
    z-index: 200;
}

.overflow-hidden {
    overflow: hidden;
}

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

.overflow-y-auto {
    overflow-y: auto;
}

/* ── Tables ── */
table {
    border-collapse: collapse;
}

th,
td {
    text-align: left;
}

.divide-y>*+* {
    border-top: 1px solid var(--gray-200);
}

.divide-x>*+* {
    border-left: 1px solid var(--gray-200);
}

/* ── Forms ── */
input,
select,
textarea,
button {
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.4);
    border-color: transparent;
}

select {
    appearance: auto;
    background-color: #fff;
}

input[type="checkbox"] {
    border-radius: 0.25rem;
}

/* ── Hover States ── */
.hover\:bg-orange-600:hover {
    background-color: #ea580c;
}

.hover\:bg-gray-50:hover {
    background-color: var(--gray-50);
}

.hover\:bg-gray-100:hover {
    background-color: var(--gray-100);
}

.hover\:bg-gray-700:hover {
    background-color: var(--gray-700);
}

.hover\:bg-gray-800:hover {
    background-color: var(--gray-800);
}

.hover\:bg-orange-100:hover {
    background-color: #ffedd5;
}

.hover\:bg-green-600:hover {
    background-color: #16a34a;
}

.hover\:text-gray-700:hover {
    color: var(--gray-700);
}

.hover\:text-gray-900:hover {
    color: var(--gray-900);
}

.hover\:text-red-900:hover {
    color: #7f1d1d;
}

.cursor-pointer {
    cursor: pointer;
}

/* ── Animations ── */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ── Flex shrink ── */
.flex-shrink-0 {
    flex-shrink: 0;
}

.self-start {
    align-self: flex-start;
}

/* ── Sidebar Component ── */
.sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 150ms, color 150ms;
    text-decoration: none;
    color: var(--gray-700);
}

.sidebar-item:hover {
    background-color: var(--gray-100);
}

.sidebar-item.active {
    background-color: #f97316;
    color: #fff;
}

.sidebar-item.active span:first-child {
    filter: none;
}

.sidebar-item span:first-child {
    filter: grayscale(1);
}

.sidebar-item.active span:first-child {
    filter: none;
}

/* ── Status Badges ── */
.status-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
}

.status-pending {
    background-color: #fef9c3;
    color: #854d0e;
}

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

.status-rejected,
.status-cancelled {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-confirmed,
.status-in_progress {
    background-color: #dbeafe;
    color: #1e40af;
}

/* ── Card Components ── */
.stat-card {
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    padding: 1rem;
}

.stat-card .icon-wrap {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}

/* ── Tab Component ── */
.tab-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    transition: color 150ms, border-color 150ms;
}

.tab-btn:hover {
    color: var(--gray-700);
}

.tab-btn.active {
    color: #f97316;
    border-bottom-color: #f97316;
}

/* ── Notification Toast ── */
.toast {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    color: #fff;
    font-size: 0.875rem;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    z-index: 100;
    transition: opacity 300ms;
}

.toast-success {
    background-color: #22c55e;
}

.toast-error {
    background-color: #ef4444;
}

.toast-info {
    background-color: #3b82f6;
}

.toast-warning {
    background-color: #eab308;
}

/* ── Border-b-2 for tabs ── */
.border-b-2 {
    border-bottom: 2px solid;
}

/* ── Table row hover ── */
.hover\:bg-gray-50:hover,
tr.hover\:bg-gray-50:hover {
    background-color: var(--gray-50);
}

/* ── Responsive hiding ── */
@media (max-width: 767px) {
    .md\:flex {
        display: none;
    }

    .ml-64 {
        margin-left: 0;
    }

    #sidebar {
        transform: translateX(-100%);
        transition: transform 300ms;
    }

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

/* ── Additional utility ── */
.block {
    display: block;
}

.inline-block {
    display: inline-block;
}

.list-disc {
    list-style-type: disc;
}

.min-h-\[200px\] {
    min-height: 200px;
}

.flex-col.h-full {
    height: 100%;
}