@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    color: #1f2937;
    background: #f3f4f6;
    min-height: 100vh;
}

/* Auth / Login Page Specific */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 420px;
}

@media (min-width: 640px) {
    .login-container {
        padding: 3rem;
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header h1 {
    font-size: 1.75rem;
    color: #111827;
    margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .login-header h1 {
        font-size: 2rem;
    }
}

/* Login specific components */
.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
}

.input-wrapper input {
    padding-left: 2.8rem;
}

.login-btn {
    background: #4f46e5;
    color: #ffffff;
    padding: 0.875rem;
    border-radius: 10px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    width: 100%;
    font-size: 1rem;
    transition: background 0.2s;
}

.login-btn:hover {
    background: #4338ca;
}

.footer-links {
    margin-top: 1.5rem;
    text-align: center;
}

.footer-links a {
    color: #4f46e5;
    text-decoration: none;
    font-size: 0.875rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* Dashboard Layout */
.main-layout {
    display: flex;
    flex-direction: column;
    /* Stack vertically on mobile */
    min-height: 100vh;
    position: relative;
}

@media (min-width: 1024px) {
    .main-layout {
        flex-direction: row;
        /* Side-by-side on desktop */
    }
}

/* Mobile Header */
.mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
}

@media (min-width: 1024px) {
    .mobile-header {
        display: none;
    }
}

.menu-toggle {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #4f46e5;
    /* Match theme color */
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
}

.sidebar {
    width: 280px;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    position: fixed;
    top: 0;
    left: -280px;
    height: 100vh;
    z-index: 50;
    transition: left 0.3s ease;
}

.sidebar.active {
    left: 0;
}

@media (min-width: 1024px) {
    .sidebar {
        position: sticky;
        left: 0;
    }
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 45;
    display: none;
}

.sidebar-overlay.active {
    display: block;
}

@media (min-width: 1024px) {
    .sidebar-overlay {
        display: none !important;
    }
}

.sidebar-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4f46e5;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-menu {
    flex: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.25rem;
    color: #4b5563;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 0.5rem;
}

.nav-link:hover {
    background: #f9fafb;
    color: #111827;
}

.nav-link.active {
    background: #4f46e5;
    color: #ffffff;
}

.content-area {
    flex: 1;
    padding: 1.25rem;
    overflow-y: auto;
    width: 100%;
}

@media (min-width: 640px) {
    .content-area {
        padding: 2.5rem;
    }
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

@media (max-width: 639px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

/* Components */
.card {
    background: #ffffff;
    border-radius: 16px;
    padding: 1.25rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (min-width: 640px) {
    .card {
        padding: 1.5rem;
    }
}

.stat-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .stat-grid {
        gap: 1.5rem;
        margin-bottom: 2.5rem;
    }
}

.stat-card {
    flex: 1;
    min-width: 100%;
    background: #ffffff;
    padding: 1.25rem;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.stat-card:active {
    transform: translateY(-2px) scale(0.98);
}

/* Specific Card Hover States */
.card-blue:hover {
    border-color: #2563eb;
    background: #eff6ff;
}

.card-purple:hover {
    border-color: #7c3aed;
    background: #faf5ff;
}

.card-green:hover {
    border-color: #16a34a;
    background: #f0fdf4;
}

.card-blue:hover .stat-icon {
    background: #2563eb;
    color: #fff;
}

.card-purple:hover .stat-icon {
    background: #7c3aed;
    color: #fff;
}

.card-green:hover .stat-icon {
    background: #16a34a;
    color: #fff;
}

@media (min-width: 640px) {
    .stat-card {
        min-width: 240px;
        padding: 1.5rem;
        gap: 1.25rem;
    }
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
}

@media (min-width: 640px) {
    .stat-icon {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        font-size: 1.25rem;
    }
}

.icon-blue {
    background: #eff6ff;
    color: #2563eb;
}

.icon-purple {
    background: #faf5ff;
    color: #7c3aed;
}

.icon-green {
    background: #f0fdf4;
    color: #16a34a;
}

/* Tables */
.table-container {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
    /* Force scroll on small screens */
}

th {
    background: #f9fafb;
    padding: 0.75rem 1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b7280;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

@media (min-width: 640px) {
    th {
        padding: 1rem 1.5rem;
    }
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    color: #374151;
    font-size: 0.8125rem;
    white-space: nowrap;
}

@media (min-width: 640px) {
    td {
        padding: 1rem 1.5rem;
        font-size: 0.875rem;
    }
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .form-group {
        margin-bottom: 1.25rem;
    }
}

.form-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

@media (min-width: 640px) {
    .form-group label {
        font-size: 0.875rem;
        margin-bottom: 0.5rem;
    }
}

input,
select,
textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.8125rem;
}

@media (min-width: 640px) {

    input,
    select,
    textarea {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }
}

input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.btn-primary {
    background: #4f46e5;
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 0.8125rem;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .btn-primary {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

.btn-primary:hover {
    background: #4338ca;
}

.btn-action,
.btn-delete {
    transition: transform 0.2s, color 0.2s;
}

.btn-action:hover {
    transform: scale(1.1);
    color: #4338ca !important;
}

.btn-delete:hover {
    transform: scale(1.1);
    color: #b91c1c !important;
}

/* Pagination */
.pagination {
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide on Mobile */
.hide-mobile {
    display: none !important;
}

@media (min-width: 640px) {
    .hide-mobile {
        display: block !important;
    }
}