/* ================================
   QH System - Mobile First Theme
   ================================ */

/* General body styling (mobile default) */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #8B5A2B;
    margin: 0;
    padding: 0;
    color: #333;
    font-size: 16px; /* good readability on mobile */
}

/* Header */
header {
    background-color: #5A3E36;
    color: #FFFDD0;
    padding: 12px;
    text-align: center;
}
header h1 {
    font-size: 20px; /* smaller on mobile */
    margin: 0;
}

/* Navbar - stacked on mobile */
.navbar {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background-color: #8B5A2B;
}
.navbar a {
    color: #FFFDD0;
    text-decoration: none;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
    background-color: #5A3E36;
}
.navbar a:hover {
    background-color: #3c2823;
}

/* Container */
.container {
    margin: 10px;
    padding: 15px;
    background: #FFFDD0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Forms */
label {
    display: block;
    margin-top: 12px;
    font-weight: bold;
    color: #5A3E36;
}
input, select, textarea, button {
    width: 100%;
    padding: 12px;
    margin: 6px 0 16px;
    border: 1px solid #D2B48C;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}
button {
    background-color: #8B5A2B;
    color: #FFF;
    border: none;
    cursor: pointer;
    font-size: 18px;
    border-radius: 6px;
    padding: 12px;
    transition: background 0.3s;
}
button:hover {
    background-color: #5A3E36;
}

/* Tables - scrollable on mobile */
.table-wrapper {
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    background: #FFFDD0;
    font-size: 14px;
}
table th, table td {
    border: 1px solid #D2B48C;
    padding: 8px;
    text-align: left;
}
table th {
    background-color: #5A3E36;
    color: #FFFDD0;
}

/* Cards */
.card {
    background: #FFFDD0;
    border: 1px solid #D2B48C;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.card h2 {
    margin-top: 0;
    color: #5A3E36;
}

/* Alerts */
.alert {
    padding: 12px;
    margin: 10px 0;
    border-radius: 5px;
}
.alert-success { background: #d4edda; color: #155724; }
.alert-error   { background: #f8d7da; color: #721c24; }
.alert-warning { background: #fff3cd; color: #856404; }

/* Footer */
footer {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background-color: #5A3E36;
    color: #FFFDD0;
    font-size: 14px;
    border-top: 2px solid #8B5A2B;
}

/* ================================
   Larger Screens Enhancements
   ================================ */

/* Tablet */
@media (min-width: 600px) {
    header h1 { font-size: 24px; }
    .navbar { flex-direction: row; justify-content: center; }
    .navbar a { flex: 1; }
}

/* Desktop */
@media (min-width: 992px) {
    .container { max-width: 900px; margin: 20px auto; }
    table { font-size: 16px; }
    header h1 { font-size: 28px; }
}


/* Navbar */
.navbar {
    background: var(--primary);
    padding: 10px;
    display: flex;
    gap: 15px;
    justify-content: center;
}
.navbar a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}
.navbar a:hover {
    text-decoration: underline;
}

/* Table */
.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: #fff;
    box-shadow: var(--shadow);
}
.styled-table th, .styled-table td {
    padding: 10px;
    border: 1px solid #ddd;
    text-align: center;
}
.styled-table tr {
    cursor: pointer;
    transition: background 0.2s;
}
.styled-table tr:hover {
    background: #f0f8ff;
}
.transactions {
    list-style: none;
    padding: 0;
}
.transactions li {
    padding: 8px;
    margin: 5px 0;
    border-radius: 5px;
}
.transactions li.inflow {
    background: #e6ffe6;
    color: #006600;
}
.transactions li.outflow {
    background: #ffe6e6;
    color: #990000;
}