/* Legacy utilities – paired with app-theme.css
   Global link-as-button styles were restricted to .action-link (see app-theme.css) */

body {
    font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    background-color: #f5f7fb;
    color: #0f172a;
    margin: 0;
    padding: 0;
}

/* Legacy header/nav (non-Bootstrap shells only) */
header:not(.landing-hero) {
    background-color: #1d4ed8;
    color: white;
    padding: 10px 0;
}

header:not(.landing-hero) nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
}

header:not(.landing-hero) nav ul li {
    display: inline;
    margin-right: 20px;
}

header:not(.landing-hero) nav ul li a {
    color: white;
    text-decoration: none;
    margin-right: 10px;
}

/* Do not restyle Bootstrap navbar dropdowns */
.dropdown:not(.nav-item) {
    position: relative;
    display: inline-block;
}

.dropbtn {
    display: inline-block;
    text-decoration: none;
    color: white;
    padding: 10px;
}

.dropdown:not(.nav-item) .dropdown-content {
    display: none;
    position: absolute;
    background-color: #1d4ed8;
    min-width: 160px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.dropdown:not(.nav-item) .dropdown-content a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}

.dropdown:not(.nav-item):hover .dropdown-content {
    display: block;
}

.dropdown:not(.nav-item) .dropdown-content a:hover {
    background-color: #1e40af;
}

h1 {
    color: #1d4ed8;
    text-align: center;
    margin-top: 20px;
}

main {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* Avoid forcing a white box on themed app pages */
main.dash-wrap,
main.page-wrap,
main.container {
    max-width: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
}

main.container.py-4 {
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
    padding: 1.5rem !important;
}

form:not(.row):not(.d-flex):not(.d-grid) {
    display: flex;
    flex-direction: column;
}

form label {
    margin-bottom: 5px;
    font-weight: bold;
}

form input[type="text"],
form input[type="number"],
form input[type="date"],
form select {
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

form input[type="text"]:focus,
form input[type="number"]:focus,
form input[type="date"]:focus,
form select:focus {
    border-color: #1d4ed8;
    outline: none;
    box-shadow: 0 0 5px rgba(29, 78, 216, 0.35);
}

form button {
    text-align: center;
    max-width: 200px;
    padding: 10px;
    background-color: #1d4ed8;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

form button:hover {
    background-color: #1e40af;
}

.error {
    color: #dc2626;
    margin-bottom: 15px;
    font-weight: bold;
}

.success {
    color: #16a34a;
    margin-bottom: 15px;
    font-weight: bold;
}

/* Explicit action links (replaces former global a {} button look) */
.action-link {
    min-width: 150px;
    max-width: 190px;
    color: white !important;
    text-decoration: none !important;
    background-color: #1d4ed8;
    padding: 10px 15px;
    border-radius: 8px;
    display: inline-block;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s ease;
}

.action-link:hover {
    background-color: #1e40af;
    text-decoration: none !important;
}

form .action-link,
table .action-link {
    display: inline-block;
    margin-top: 10px;
}

/* Tables – scoped to legacy (non-Bootstrap) tables only when needed.
   Bootstrap .table keeps its own look via app-theme. */
table:not(.table) {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

table:not(.table) th,
table:not(.table) td {
    padding: 12px;
    text-align: left;
    border: 1px solid #ddd;
}

table:not(.table) th {
    background-color: #1d4ed8;
    color: white;
    font-weight: bold;
}

table:not(.table) tr:nth-child(even) {
    background-color: #f9f9f9;
}

table:not(.table) tr:hover {
    background-color: #f1f1f1;
}

@media screen and (max-width: 768px) {
    header:not(.landing-hero) {
        padding: 15px 0;
    }

    header:not(.landing-hero) nav ul li {
        margin-bottom: 10px;
    }

    header:not(.landing-hero) nav ul li a {
        padding: 10px;
        background-color: #1d4ed8;
        color: white;
        margin-bottom: 5px;
        text-align: center;
    }

    main:not(.dash-wrap):not(.page-wrap):not(.container) {
        padding: 15px;
    }

    form label,
    form input[type="text"],
    form input[type="number"],
    form input[type="date"],
    form select {
        width: 100%;
        margin-bottom: 10px;
    }

    form button {
        width: 100%;
        margin-top: 10px;
    }

    h1 {
        font-size: 24px;
    }
}

@media screen and (max-width: 480px) {
    header:not(.landing-hero) nav ul {
        text-align: left;
    }

    header:not(.landing-hero) nav ul li {
        margin-bottom: 10px;
        margin-right: 0;
    }

    main:not(.dash-wrap):not(.page-wrap):not(.container) {
        padding: 10px;
    }

    h1 {
        font-size: 20px;
    }

    form button {
        font-size: 14px;
    }

    form input[type="text"],
    form input[type="number"],
    form input[type="date"],
    form select {
        font-size: 14px;
    }
}

.delete-button {
    background-color: #dc2626;
    color: white !important;
    padding: 10px 10px;
    border-radius: 5px;
    text-decoration: none !important;
    display: inline-block;
    min-width: 90px;
}

.delete-button:hover {
    background-color: #b91c1c;
}

.whatsapp-button {
    background-color: #25D366;
    color: white !important;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 10px;
    text-align: center;
    text-decoration: none !important;
    display: inline-block;
    border-radius: 5px;
    max-width: 30px;
}
