:root {
    --primary-color: #c18482;
    --primary-dark: #d3b76e;
    --secondary-color: #f39c12;
    --accent-color: #3498db;
    --background-color: #fdf2e9;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --white: #ffffff;
    --error: #e74c3c;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.12);
}

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

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    width: 90%;
    max-width: 400px;
    text-align: center;
}

h1,
h2,
h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.navbar {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 900;
}

.navbar a {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.navbar a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.card {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h1 {
    margin: 0;
    font-size: 1.8rem;
}

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

.form-group {
    margin-bottom: 1.2rem;
    text-align: left;
    display: flex;
    align-items: center;
    /*gap: 1rem;*/
    flex-wrap: wrap;
    /* Supports wrapping on mobile if labels are too wide */
}

label {
    display: block;
    margin-bottom: 0.6rem;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--secondary-color);
}

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0 15px;
    height: 48px;
    /* Fixed height for consistency */
    min-width: 140px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(211, 84, 0, 0.2);
    line-height: normal;
    border: none;
}

button:hover,
.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(211, 84, 0, 0.3);
}

.btn-secondary {
    background-color: #34495e;
    box-shadow: 0 4px 6px rgba(52, 73, 94, 0.2);
}

.btn-secondary:hover {
    background-color: #2c3e50;
    box-shadow: 0 6px 12px rgba(52, 73, 94, 0.3);
}

.btn-whatsapp {
    background-color: #25D366;
    box-shadow: 0 4px 6px rgba(37, 211, 102, 0.2);
}

.btn-whatsapp:hover {
    background-color: #128C7E;
    box-shadow: 0 6px 12px rgba(37, 211, 102, 0.3);
}

.category-pill:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
}

.category-pill button:hover {
    opacity: 1 !important;
    transform: scale(1.1);
}

.btn-small {
    height: 32px !important;
    min-width: 32px !important;
    padding: 0 8px !important;
    font-size: 0.85rem !important;
    gap: 0 !important;
    border-radius: 4px !important;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

th,
td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

th {
    background-color: #f8f9fa;
    color: var(--text-color);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.summary-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    border-top: 4px solid var(--secondary-color);
}

.summary-item>div:first-child {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 800;
}

/* Responsiveness & Mobile UI */
@media (max-width: 768px) {
    body {
        padding-bottom: 75px;
        /* Space for bottom nav */
    }

    .navbar {
        padding: 0.8rem 1rem;
        position: sticky;
        top: 0;
    }

    .navbar .desktop-nav {
        display: none !important;
    }

    .navbar .mobile-brand {
        display: block !important;
        font-weight: 800;
        font-size: 1.2rem;
    }

    .bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--white);
        height: 65px;
        box-shadow: 0 -2px 15px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom);
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-decoration: none;
        color: var(--text-light);
        font-size: 0.7rem;
        font-weight: 700;
        gap: 4px;
        flex: 1;
        padding: 8px 0;
        transition: color 0.2s;
    }

    .bottom-nav-item i {
        font-size: 1.5rem;
    }

    .bottom-nav-item.active {
        color: var(--primary-color);
    }

    .section-header h1 {
        font-size: 1.4rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 1rem;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
    }

    .header-actions a,
    .header-actions button {
        width: 100%;
    }

    .container {
        margin: 1rem auto;
        padding: 0 0.8rem;
    }

    .card {
        padding: 1.2rem;
        border-radius: 8px;
    }

    .table-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 1.5rem;
        border-radius: 12px;
        box-shadow: var(--shadow);
    }

    table {
        display: table;
        /* Back to normal table layout */
        min-width: 100%;
        /* Slightly more width for better spacing */
        margin-top: 0;
        box-shadow: none;
        /* Shadow moved to container */
    }

    .card form>div {
        flex-direction: column !important;
        gap: 1.2rem !important;
        align-items: stretch !important;
    }

    .mobile-border-top {
        border-left: none !important;
        padding-left: 0 !important;
        border-top: 1px solid #eee;
        padding-top: 1.5rem;
        margin-top: 1.5rem;
    }
}

.bottom-nav,
.mobile-brand {
    display: none;
}