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

body {
    font-family: 'Segoe UI', 'Noto Sans Bengali', Arial, sans-serif;
    background: #f7f5f0;
    color: #2b2b2b;
}

/* Auth pages */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.auth-box {
    background: #fff;
    border-radius: 14px;
    padding: 32px 28px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.auth-box h1 { font-size: 22px; text-align: center; color: #8a6d1e; }
.auth-box .subtitle { text-align: center; color: #777; margin: 6px 0 20px; }

label { display: block; margin: 14px 0 6px; font-size: 14px; color: #555; }
input[type=text], input[type=tel], input[type=email], input[type=password],
input[type=date], input[type=number] {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
}

.btn-primary {
    width: 100%;
    margin-top: 22px;
    padding: 13px;
    background: #c9a13b;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}
.btn-primary:disabled { background: #ddd; cursor: not-allowed; }
.btn-secondary {
    padding: 10px 16px;
    background: #efe9db;
    color: #6b5518;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}
.btn-secondary.small { padding: 5px 10px; font-size: 12px; margin-left: 8px; }
.btn-danger {
    padding: 10px 16px;
    background: #f6dede;
    color: #a33;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.link-row { text-align: center; margin-top: 18px; font-size: 14px; color: #777; }
.link-row a { color: #c9a13b; text-decoration: none; font-weight: 600; }

.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 14px; }
.alert-error { background: #f6dede; color: #a33; }
.alert-success { background: #e3f3e3; color: #2a7a2a; }

/* App shell */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 14px 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    position: sticky; top: 0; z-index: 10;
}
.top-bar .brand { font-weight: 700; color: #8a6d1e; }
.top-bar .user-name { font-size: 14px; color: #555; }
.top-bar .logout-link, .back-link { color: #a33; text-decoration: none; font-size: 14px; }

.container { max-width: 520px; margin: 0 auto; padding: 18px; }

.summary-card {
    display: flex;
    justify-content: space-around;
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.summary-label { font-size: 12px; color: #888; text-align: center; }
.summary-value { font-size: 20px; font-weight: 700; text-align: center; color: #333; }

.search-row { display: flex; gap: 8px; margin-bottom: 16px; }
.search-row input { flex: 1; }
.search-row button { padding: 0 16px; border: none; background: #efe9db; border-radius: 8px; color: #6b5518; }

.bill-list { display: flex; flex-direction: column; gap: 10px; }
.bill-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    padding: 14px 16px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.bill-title { font-weight: 600; }
.bill-date { font-size: 12px; color: #888; margin-top: 2px; }
.bill-amount { font-weight: 700; color: #8a6d1e; }
.badge-inactive { font-size: 11px; background: #f6dede; color: #a33; padding: 2px 6px; border-radius: 6px; margin-left: 6px; }

.empty-state { text-align: center; color: #999; padding: 40px 0; }

.fab {
    position: fixed;
    bottom: 24px; right: 24px;
    width: 58px; height: 58px;
    background: #c9a13b;
    color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Add bill form */
.items-header { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #666; margin: 0; }
.checkbox-label input { width: auto; }

.item-row {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    margin-top: 8px;
}
.item-name { flex: 1; font-size: 14px; }
.item-input { width: 68px; padding: 6px 8px; font-size: 13px; border: 1px solid #ddd; border-radius: 6px; }
.item-delete { background: none; border: none; color: #a33; font-size: 15px; cursor: pointer; padding: 4px; }

.add-item-row { display: flex; gap: 6px; margin-top: 14px; }
.add-item-row input { flex: 1; }
.add-item-row button { border: none; border-radius: 8px; padding: 0 14px; cursor: pointer; }
#micBtn { background: #efe9db; font-size: 16px; }
#micBtn.listening { background: #c9a13b; color: #fff; }

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    font-weight: 700;
    background: #fff;
    padding: 16px;
    border-radius: 10px;
    margin-top: 18px;
    color: #8a6d1e;
}

/* Bill view / print */
.bill-paper { background: #fff; padding: 22px; border-radius: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.bill-paper h2 { color: #8a6d1e; }
.bill-meta { color: #888; font-size: 13px; margin-bottom: 14px; }
.bill-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.bill-table th, .bill-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid #eee; font-size: 14px; }
.bill-table th { color: #888; font-weight: 600; font-size: 12px; text-transform: uppercase; }

.action-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }

@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
    .bill-paper { box-shadow: none; }
}
