/* Basic layout */
body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: #f5f7fb;
    color: #222;
}

/* Main content area – responsive */
.main-content {
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Page sections as cards */
.page-section {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    margin-bottom: 1.5rem;
}

/* Grid of cards (home) */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.card {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.card h2 {
    margin-top: 0;
}

/* Buttons */
.button {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    background-color: #2563eb;
    color: #ffffff;
    text-decoration: none;
    font-size: 0.95rem;
    cursor: pointer;
}

.button:hover {
    background-color: #1d4ed8;
}

/* Form layout – now full width, dynamic */
.form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;              /* fill the card */
    max-width: 100%;          /* no artificial cap */
    box-sizing: border-box;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.form-row label {
    font-size: 0.9rem;
}

.form-row input,
.form-row select,
.form-row textarea {
    padding: 0.45rem 0.55rem;
    border-radius: 0.375rem;
    border: 1px solid #cbd5f5;
    font-size: 0.95rem;
    width: 100%;              /* stretch to full row width */
    box-sizing: border-box;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

.form-note {
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: #555;
}

/* Flash messages */
.flash-messages {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem 0;
}

.flash-messages li {
    padding: 0.4rem 0.6rem;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.flash-error {
    background-color: #fee2e2;
    color: #991b1b;
}

.flash-success {
    background-color: #dcfce7;
    color: #166534;
}

/* Tables (boards, tickets, reports, notes) */
.board-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.75rem;
    table-layout: fixed;
}

.board-table th,
.board-table td {
    border: 1px solid #e5e7eb;
    padding: 0.5rem 0.6rem;
    font-size: 0.9rem;
    vertical-align: top;
    word-wrap: break-word;
}

.board-table th {
    background-color: #f3f4f6;
    text-align: left;
}

/* Responsive tweaks */
@media (max-width: 900px) {
    .main-content {
        padding: 1rem;
    }

    .page-section {
        padding: 1rem;
    }

    .board-table th,
    .board-table td {
        font-size: 0.85rem;
    }
}

@media (max-width: 600px) {
    .header-nav {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .form {
        width: 100%;
        max-width: 100%;
    }
}
