/* Modern Rent App Design System */
:root {
    --primary: #4F46E5;
    /* Indigo 600 */
    --primary-hover: #4338ca;
    --bg-body: #F3F4F6;
    /* Gray 100 */
    --bg-card: #FFFFFF;
    --text-main: #1F2937;
    /* Gray 800 */
    --text-muted: #6B7280;
    /* Gray 500 */
    --border: #E5E7EB;
    /* Gray 200 */
    --danger: #EF4444;
    --success: #10B981;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

/* Dark Mode Support (System Preference) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #111827;
        /* Gray 900 */
        --bg-card: #1F2937;
        /* Gray 800 */
        --text-main: #F3F4F6;
        /* Gray 100 */
        --text-muted: #9CA3AF;
        /* Gray 400 */
        --border: #374151;
        /* Gray 700 */
    }
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

h1,
h2,
h3,
h4 {
    font-weight: 700;
    letter-spacing: -0.025em;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-card {
    background: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

/* New compact card style */
.card-compact {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    /* Softer initial shadow */
    padding: 1.25rem;
    height: 100%;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.card-compact:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border-color: var(--primary);
}

.stats-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.stats-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.dashboard-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Components */
/* Components */
.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.6rem 1.25rem;
    /* Reduced padding */
    border-radius: 8px;
    /* Slightly tighter radius */
    font-weight: 500;
    /* Cleaner weight */
    cursor: pointer;
    border: 1px solid transparent;
    /* Ensure border box consistency */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    line-height: 1.25;
}

@media (min-width: 640px) {
    .btn-block {
        width: 100%;
        display: flex;
    }
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-icon {
    padding: 0.5rem;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.btn-outline:hover {
    border-color: var(--text-main);
    color: var(--text-main);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background-color: var(--bg-body);
    color: var(--text-main);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.alert-error {
    background-color: #FEF2F2;
    color: #991B1B;
    border: 1px solid #F87171;
}

/* Navbar */
.navbar {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-muted);
}

/* Mobile Responsiveness & Grid Systems */
.grid-responsive {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

.grid-2 {
    grid-template-columns: 1fr;
}

.grid-sidebar {
    grid-template-columns: 1fr;
}


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

    .grid-sidebar {
        grid-template-columns: 2fr 1fr;
    }

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

/* Navbar Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-main);
}

@media (max-width: 768px) {
    .nav-container {
        flex-wrap: wrap;
        /* Allow wrapping for toggle */
        flex-direction: row;
        /* Keep logo and toggle in row */
        align-items: center;
    }

    .nav-toggle {
        display: block;
        /* Show hamburger */
    }

    .nav-links {
        display: none;
        /* Hidden by default */
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border);
    }

    .nav-links.active {
        display: flex;
        /* Show when active */
    }

    .nav-link {
        display: block;
        padding: 0.75rem;
        background: var(--bg-body);
        border-radius: var(--radius);
        text-align: center;
    }

    .container {
        padding: 0 1rem;
    }

    /* Responsive Cards instead of Scrolling Tables */
    .table-container {
        border: none;
        background: transparent !important;
        box-shadow: none !important;
    }

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: 1rem;
        padding: 1rem;
        box-shadow: var(--shadow);
    }

    /* Pending row handling in cards */
    tr[style*="background: #FEF3C7"] {
        background: #FEF3C7 !important;
    }

    td {
        border: none;
        position: relative;
        padding: 0.5rem 0 0.5rem 50%;
        text-align: right;
        border-bottom: 1px solid var(--bg-body);
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-left: 0 !important;
        /* Reset */
    }

    td:last-child {
        border-bottom: none;
    }

    td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.85rem;
        text-transform: uppercase;
        margin-right: 1rem;
        text-align: left;
    }

    td:empty {
        display: none;
    }

    /* Adjust Header for Mobile */
    h1 {
        font-size: 1.75rem;
    }

    .btn-mobile-full {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}