* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f3f6fa;
    color: #172033;
}

button,
input,
select {
    font-family: inherit;
}

button {
    cursor: pointer;
}

.hidden {
    display: none !important;
}


/* ================= LOGIN ================= */

#loginScreen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(
        135deg,
        #123b70,
        #1e5da5
    );
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: #ffffff;
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.18);
}

.logo-circle {
    width: 70px;
    height: 70px;
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #123b70;
    color: #ffffff;
    font-size: 22px;
    font-weight: bold;
}

.login-card h1 {
    text-align: center;
    margin: 0;
    font-size: 25px;
}

.login-subtitle {
    text-align: center;
    color: #718096;
    margin: 8px 0 28px;
}

.login-card label {
    display: block;
    margin: 15px 0 7px;
    font-size: 14px;
    font-weight: 700;
}

.login-card input {
    width: 100%;
    height: 48px;
    border: 1px solid #d7dee8;
    border-radius: 9px;
    padding: 0 13px;
    font-size: 15px;
    outline: none;
}

.login-card input:focus {
    border-color: #123b70;
}

.remember-row {
    display: flex !important;
    align-items: center;
    gap: 5px;
    margin-top: 15px !important;
}

.remember-row input {
    width: auto;
    height: auto;
}


/* ================= BUTTONS ================= */

.primary-button {
    border: 0;
    background: #123b70;
    color: white;
    border-radius: 9px;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: bold;
    transition: 0.2s;
}

.primary-button:hover {
    background: #0d2f5b;
}

.full-button {
    width: 100%;
}

.login-button {
    margin-top: 22px;
    height: 48px;
}

.delete-button {
    border: 0;
    background: #d92d3a;
    color: white;
    border-radius: 8px;
    padding: 10px 15px;
    font-weight: bold;
}

.delete-button:hover {
    background: #b71f2b;
}

.edit-button {
    border: 0;
    background: #198754;
    color: #fff;
    border-radius: 7px;
    padding: 8px 12px;
    font-weight: bold;
}

.edit-button:hover {
    background: #157347;
}

.back-button {
    border: 0;
    background: transparent;
    color: #123b70;
    font-weight: bold;
    font-size: 15px;
    padding: 5px 0;
}

.logout-button {
    border: 1px solid rgba(255,255,255,0.5);
    background: transparent;
    color: white;
    padding: 9px 14px;
    border-radius: 8px;
}

.cancel-button {
    border: 1px solid #d4dbe5;
    background: white;
    color: #4a5568;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: bold;
}


/* ================= HEADER ================= */

.top-header {
    min-height: 68px;
    background: #123b70;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 5%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.app-title {
    font-size: 19px;
    font-weight: bold;
}

.user-type {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 3px;
}


/* ================= PAGES ================= */

.page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px 20px 80px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
}

.page-header h2 {
    margin: 0;
    font-size: 25px;
}

.page-header p {
    margin: 7px 0 0;
    color: #718096;
}


/* ================= SHOP LIST ================= */

.shop-list {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(280px, 1fr)
    );
    gap: 15px;
}

.shop-card {
    background: white;
    border-radius: 13px;
    box-shadow: 0 4px 15px rgba(20,40,70,0.06);
    border: 1px solid #e5eaf0;
}

.shop-card-content {
    padding: 18px;
}

.shop-open {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    padding: 0;
}

.shop-open h3 {
    margin: 0 0 8px;
    color: #123b70;
    font-size: 18px;
}

.shop-info {
    color: #718096;
    font-size: 13px;
}

.category-mini {
    font-weight: bold;
}

.shop-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}


/* Home shop actions: compact EDIT/DELETE buttons on one row. */
#shopList .shop-actions { display:flex; flex-direction:row !important; align-items:center; gap:6px; margin-top:8px; }
#shopList .shop-actions button { flex:0 0 auto; width:auto !important; min-width:68px; padding:6px 10px; font-size:11px; line-height:1.1; }

/* ================= ADMIN MENU ================= */

.admin-menu {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}

.numbered-home-button {
    min-width: 0;
}

@media (max-width: 950px) {
    .admin-menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .admin-menu {
        grid-template-columns: 1fr;
    }
}

.menu-button {
    background: white;
    border: 1px solid #e3e8ef;
    border-radius: 13px;
    padding: 20px;
    text-align: left;
    display: grid;
    grid-template-columns: 35px 1fr;
    align-items: center;
    box-shadow: 0 4px 15px rgba(20,40,70,0.05);
}

.menu-button span {
    font-weight: bold;
    color: #123b70;
}

.menu-button small {
    grid-column: 2;
    color: #718096;
    margin-top: 5px;
}


/* ================= SALESMAN ================= */

.salesman-dashboard {
    max-width: 600px;
    margin: 30px auto;
}

.salesman-report-card {
    background: white;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 7px 25px rgba(20,40,70,0.08);
    border: 1px solid #e4eaf1;
}

.salesman-report-card h3 {
    margin-top: 0;
    font-size: 22px;
}

.salesman-report-card p {
    color: #718096;
}

.salesman-assigned-shop {
    background: #edf4fc;
    color: #123b70;
    border-radius: 9px;
    padding: 12px;
    font-weight: bold;
    margin: 15px 0;
}


/* ================= SHOP PAGE ================= */

.shop-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 20px 0;
}

.shop-page-header h2 {
    margin: 0;
}

.category-badge {
    background: #eaf2fb;
    color: #123b70;
    padding: 7px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}


/* ================= DATE ================= */

.date-card {
    background: white;
    padding: 20px;
    border-radius: 13px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(20,40,70,0.05);
}

.date-card label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 8px;
}

.date-wrapper {
    position: relative;
}

.date-display {
    width: 100%;
    height: 48px;
    border: 1px solid #d8dfe8;
    border-radius: 9px;
    padding: 0 55px 0 13px;
    font-size: 16px;
    background: #f9fafc;
}

.real-date {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.calendar-button {
    position: absolute;
    right: 8px;
    top: 6px;
    width: 36px;
    height: 36px;
    border: 0;
    background: #edf3fb;
    border-radius: 7px;
}


/* ================= AMOUNTS ================= */

.amount-card {
    background: white;
    border-radius: 15px;
    padding: 22px;
    box-shadow: 0 4px 15px rgba(20,40,70,0.05);
}

.amount-field {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.amount-field label {
    width: 105px;
    flex: 0 0 105px;
    margin: 0;
    font-size: 13px;
    font-weight: bold;
    color: #364152;
}

.amount-field label::after {
    content: " =";
}

.money-input {
    display: flex;
    width: 160px;
    height: 40px;
    border: 1px solid #d8dfe8;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.money-input span {
    display: none;
}

.money-input input {
    flex: 1;
    width: 100%;
    border: 0;
    outline: none;
    padding: 0 10px;
    font-size: 15px;
    min-width: 0;
}

.amount-card hr {
    border: 0;
    border-top: 1px solid #e5eaf0;
    margin: 20px 0;
}

/* ================= TOTAL ================= */

.total-box {
    background: #f0f5fb;
    border-radius: 12px;
    padding: 12px 10px;
    text-align: left;
}

.total-box div {
    display: inline-block;
    width: 105px;
    margin: 0;
    font-size: 13px;
    font-weight: bold;
    color: #536174;
}

.total-box strong {
    display: inline-block;
    font-size: 18px;
    color: #123b70;
    margin: 0;
    vertical-align: middle;
}

.total-box small {
    display: block;
    margin-left: 105px;
    margin-top: 4px;
    color: #718096;
}

.save-button {
    width: 100%;
    height: 50px;
    margin-top: 20px;
    font-size: 16px;
}

.save-message {
    text-align: center;
    color: #18864b;
    font-weight: bold;
    min-height: 20px;
    margin-top: 12px;
}


/* ================= HISTORY ================= */

.history-section {
    margin-top: 30px;
}

.history-section h3 {
    margin-bottom: 5px;
}

.history-section > p {
    color: #718096;
}

.history-list {
    display: grid;
    gap: 12px;
}

.history-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5eaf0;
    padding: 17px;
    box-shadow: 0 3px 12px rgba(20,40,70,0.04);
}

.history-card-header {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    padding-bottom: 12px;
    margin-bottom: 10px;
    border-bottom: 1px solid #edf0f4;
}

.history-row {
    display: flex;
    justify-content: space-between;
    padding: 7px 0;
    font-size: 14px;
}

.history-row span {
    color: #657184;
}

.history-row strong {
    color: #273449;
}

.total-row {
    border-top: 2px solid #e7edf4;
    margin-top: 5px;
    padding-top: 12px;
}

.total-row strong {
    color: #123b70;
    font-size: 17px;
}

.history-edit-button {
    width: 100%;
    margin-top: 12px;
}


/* ================= USERS ================= */

.users-list {
    display: grid;
    gap: 12px;
}

.user-card {
    background: white;
    padding: 18px;
    border-radius: 12px;
    border: 1px solid #e5eaf0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.user-info h3 {
    margin: 0 0 5px;
}

.user-info p {
    margin: 0;
    color: #718096;
}

.user-actions {
    display: flex;
    gap: 8px;
}


/* ================= REPORTS ================= */

.report-filter-card {
    background: white;
    border-radius: 13px;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(
        3,
        1fr
    );
    gap: 15px;
    margin-bottom: 20px;
}

.report-filter-card label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 7px;
}

.report-filter-card select,
.report-filter-card input {
    width: 100%;
    height: 44px;
    border: 1px solid #d7dee8;
    border-radius: 8px;
    padding: 0 10px;
    background: white;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(
        4,
        1fr
    );
    gap: 12px;
    margin-bottom: 20px;
}

.report-box {
    background: white;
    border-radius: 12px;
    padding: 17px;
    border: 1px solid #e5eaf0;
}

.report-box span {
    font-size: 11px;
    color: #718096;
    font-weight: bold;
}

.report-box strong {
    display: block;
    margin-top: 8px;
    font-size: 19px;
}

.total-report {
    background: #edf4fc;
}

.total-report strong {
    color: #123b70;
}

.report-list {
    display: grid;
    gap: 12px;
}

.report-day {
    background: white;
    border: 1px solid #e5eaf0;
    border-radius: 12px;
    padding: 17px;
}

.report-shop-name {
    color: #123b70;
    font-weight: bold;
    margin-bottom: 10px;
}

.report-day-header {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #edf0f4;
    padding-bottom: 10px;
    margin-bottom: 5px;
    font-weight: bold;
}

.report-day-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
}


/* ================= BACKUP ================= */

.backup-info-card {
    background: #edf4fc;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.backup-info-card h3 {
    margin-top: 0;
}

.backup-info-card p {
    margin-bottom: 0;
    color: #536174;
}

.backup-list {
    display: grid;
    gap: 12px;
}

.backup-card {
    background: white;
    padding: 17px;
    border-radius: 12px;
    border: 1px solid #e5eaf0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.backup-card p {
    margin: 6px 0 0;
    color: #718096;
    font-size: 13px;
}

.backup-actions {
    display: flex;
    gap: 8px;
}

.restore-backup-button {
    border: 0;
    background: #123b70;
    color: white;
    padding: 9px 12px;
    border-radius: 7px;
    font-weight: bold;
}

.permanent-delete-button {
    border: 0;
    background: #d92d3a;
    color: white;
    padding: 9px 12px;
    border-radius: 7px;
    font-weight: bold;
}


/* ================= EMPTY ================= */

.empty-state {
    background: white;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    color: #718096;
    border: 1px solid #e5eaf0;
}

.empty-state strong {
    color: #364152;
}


/* ================= MODALS ================= */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(10,25,45,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1000;
}

.modal-card {
    width: 100%;
    max-width: 440px;
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    margin: 0;
}

.modal-header button {
    border: 0;
    background: transparent;
    font-size: 28px;
    color: #718096;
}

.modal-card label {
    display: block;
    margin: 14px 0 7px;
    font-size: 13px;
    font-weight: bold;
}

.modal-card input,
.modal-card select {
    width: 100%;
    height: 46px;
    border: 1px solid #d7dee8;
    border-radius: 8px;
    padding: 0 12px;
    outline: none;
    background: white;
}

.modal-card .primary-button {
    margin-top: 20px;
}

.error-message {
    color: #d92d3a;
    font-size: 13px;
    margin-top: 10px;
    min-height: 18px;
}

.confirm-card {
    text-align: center;
}

.confirm-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #fff0f1;
    color: #d92d3a;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 22px;
    font-weight: bold;
}

.confirm-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}


/* ================= RESPONSIVE ================= */

@media (max-width: 750px) {

    .top-header {
        padding: 12px 18px;
    }

    .page {
        padding: 22px 15px 90px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-header .primary-button {
        width: 100%;
    }

    .shop-page-header {
        align-items: flex-start;
        gap: 10px;
    }

    .report-filter-card {
        grid-template-columns: 1fr;
    }

    .report-summary {
        grid-template-columns: repeat(2, 1fr);
    }

    .backup-card,
    .user-card {
        flex-direction: column;
        align-items: stretch;
    }

    .backup-actions,
    .user-actions {
        width: 100%;
    }

    .backup-actions button,
    .user-actions button {
        flex: 1;
    }

}

@media (max-width: 480px) {

    .login-card {
        padding: 25px 20px;
    }

    .app-title {
        font-size: 16px;
    }

    .logout-button {
        font-size: 12px;
        padding: 8px 10px;
    }

    .report-summary {
        grid-template-columns: 1fr;
    }

    .shop-actions {
        flex-direction: column;
    }

    .shop-actions button {
        width: 100%;
    }

}

/* Daily Sales Entry - exact same-line compact layout */
.daily-sales-row,
.sales-entry-row,
.amount-row,
.form-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.daily-sales-row label,
.sales-entry-row label,
.amount-row label,
.form-row label {
  display: inline-block;
  width: 110px;
  min-width: 110px;
  margin: 0;
}

.daily-sales-row input,
.sales-entry-row input,
.amount-row input,
.form-row input {
  width: 120px;
  margin: 0;
}

@media (max-width: 600px) {
  .daily-sales-row,
  .sales-entry-row,
  .amount-row,
  .form-row {
    gap: 8px;
  }
  .daily-sales-row label,
  .sales-entry-row label,
  .amount-row label,
  .form-row label {
    width: 95px;
    min-width: 95px;
  }
  .daily-sales-row input,
  .sales-entry-row input,
  .amount-row input,
  .form-row input {
    width: 120px;
  }
}


/* Center the label + amount group together */
.daily-sales-row,
.sales-entry-row,
.amount-row,
.form-row {
  justify-content: center;
}

/* Final positioning: center the complete label + amount group */
.amount-field {
    width: 273px;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.total-box {
    text-align: center;
}

.total-box div {
    vertical-align: middle;
}

.total-box small {
    text-align: center;
    margin-left: 0;
}


/* Final compact aligned sales rows */
.daily-sales-row,
.sales-entry-row,
.amount-row,
.form-row {
  display: grid !important;
  grid-template-columns: 110px 120px !important;
  column-gap: 8px !important;
  align-items: center !important;
  justify-content: center !important;
  width: max-content !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.daily-sales-row label,
.sales-entry-row label,
.amount-row label,
.form-row label {
  width: 110px !important;
  min-width: 110px !important;
  margin: 0 !important;
  text-align: right !important;
}

.daily-sales-row input,
.sales-entry-row input,
.amount-row input,
.form-row input {
  width: 120px !important;
  min-width: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.total-box {
  width: max-content !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 8px 0 !important;
  text-align: left !important;
}

.total-box div {
  display: inline-block !important;
  width: 110px !important;
  min-width: 110px !important;
  margin: 0 !important;
  text-align: right !important;
  vertical-align: middle !important;
}

.total-box strong {
  display: inline-block !important;
  width: 120px !important;
  min-width: 120px !important;
  margin: 0 0 0 8px !important;
  text-align: left !important;
  vertical-align: middle !important;
}

.total-box small {
  display: none !important;
}


/* Center and align Date row with the same label/field columns */
.date-row,
.daily-date-row,
.date-field,
.form-group.date-group {
  display: grid !important;
  grid-template-columns: 110px 120px !important;
  column-gap: 8px !important;
  align-items: center !important;
  justify-content: center !important;
  width: max-content !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.date-row label,
.daily-date-row label,
.date-field label,
.form-group.date-group label {
  width: 110px !important;
  min-width: 110px !important;
  margin: 0 !important;
  text-align: right !important;
}

.date-row input,
.daily-date-row input,
.date-field input,
.form-group.date-group input {
  width: 120px !important;
  min-width: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}


/* Daily Sales Date: centered on page, directly above amount rows */
.date-card {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 0 auto 10px !important;
  text-align: center !important;
}

.date-card > label {
  margin: 0 !important;
  width: auto !important;
  min-width: auto !important;
  text-align: right !important;
}

.date-card .date-wrapper {
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
  margin: 0 !important;
}

.date-card .date-display {
  width: 120px !important;
  margin: 0 !important;
  text-align: center !important;
}

.date-card .real-date {
  width: 38px !important;
  height: 38px !important;
  margin: 0 !important;
  padding: 2px !important;
}


/* Final: wider centered date box so the full date is visible */
.date-card {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  width: 100% !important;
  margin: 0 auto 10px !important;
}

.date-card .date-wrapper {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.date-card .date-display {
  width: 180px !important;
  min-width: 180px !important;
  height: 42px !important;
  box-sizing: border-box !important;
  text-align: center !important;
  font-size: 16px !important;
  margin: 0 !important;
}

.date-card .real-date {
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  margin: 0 !important;
  padding: 2px !important;
}

@media (max-width: 600px) {
  .date-card .date-display {
    width: 165px !important;
    min-width: 165px !important;
  }
}


/* Daily Sales Entry - larger writing only */
.daily-sales-row label,
.sales-entry-row label,
.amount-row label,
.form-row label {
  font-size: 18px !important;
  font-weight: 700 !important;
}

.daily-sales-row input,
.sales-entry-row input,
.amount-row input,
.form-row input {
  font-size: 18px !important;
  font-weight: 700 !important;
}

.total-box div {
  font-size: 18px !important;
  font-weight: 700 !important;
}

.total-box strong {
  font-size: 22px !important;
  font-weight: 800 !important;
}

.date-card .date-display {
  font-size: 20px !important;
  font-weight: 700 !important;
}


/* TOTAL SALES: exactly the same two-column row as every other amount */
.total-box {
  display: grid !important;
  grid-template-columns: 110px 120px !important;
  column-gap: 8px !important;
  align-items: center !important;
  justify-content: center !important;
  width: max-content !important;
  max-width: 100% !important;
  margin: 0 auto !important;
  padding: 8px 0 !important;
  text-align: initial !important;
}

.total-box > div {
  grid-column: 1 !important;
  width: 110px !important;
  min-width: 110px !important;
  margin: 0 !important;
  text-align: right !important;
}

.total-box > strong {
  grid-column: 2 !important;
  width: 120px !important;
  min-width: 120px !important;
  margin: 0 !important;
  text-align: left !important;
}

.total-box > small {
  display: none !important;
}


/* Final Total Sales: keep label and amount on one row */
.total-box {
  display: grid !important;
  grid-template-columns: 150px 120px !important;
  column-gap: 8px !important;
  align-items: center !important;
  justify-content: center !important;
  width: max-content !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 8px 0 !important;
  text-align: left !important;
}

.total-box div {
  display: block !important;
  width: 150px !important;
  min-width: 150px !important;
  white-space: nowrap !important;
  margin: 0 !important;
  text-align: right !important;
}

.total-box strong {
  display: block !important;
  width: 120px !important;
  min-width: 120px !important;
  margin: 0 !important;
  white-space: nowrap !important;
  text-align: left !important;
}

.total-box small {
  display: none !important;
}

/* ================= SALESMAN PERMISSIONS ================= */

.salesman-extra-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.salesman-action-button {
    width: 100%;
    min-height: 72px;
    text-align: left;
}

.salesman-permissions {
    margin-top: 18px;
    padding: 14px;
    border: 1px solid #d7dee8;
    border-radius: 10px;
    background: #f8fafc;
}

.permissions-title {
    font-weight: 700;
    margin-bottom: 10px;
}

.permission-row {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin: 9px 0 !important;
    cursor: pointer;
}

.permission-row input {
    width: 18px !important;
    height: 18px !important;
    margin: 0;
}

@media (max-width: 520px) {
    .salesman-extra-actions {
        grid-template-columns: 1fr;
    }
}

.permission-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.permission-summary span {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 7px;
    border-radius: 999px;
    border: 1px solid #d7dee8;
}

.permission-on {
    background: #eef8f0;
}

.permission-off {
    background: #f4f4f4;
    opacity: 0.6;
}


/* =========================================================
   ADMIN FEATURE ADDITIONS — keeps the original visual system
========================================================= */
.admin-feature-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.admin-feature-button { white-space: nowrap; }
.admin-feature-page { max-width: 1100px; margin: 0 auto; padding: 0 20px 80px; }
.admin-feature-page .page-header { margin-top: 0; }
.admin-feature-page .page-header h2 { margin-top: 7px; }
.feature-table-wrap { overflow-x: auto; background: #fff; border: 1px solid #e5eaf0; border-radius: 13px; box-shadow: 0 4px 15px rgba(20,40,70,0.06); }
.feature-table { width: 100%; border-collapse: collapse; min-width: 650px; }
.feature-table th, .feature-table td { padding: 13px 14px; border-bottom: 1px solid #e8edf3; text-align: left; }
.feature-table th { color: #123b70; background: #f8fafc; font-size: 13px; }
.feature-table tfoot th { background: #edf4fc; font-size: 15px; }
.empty-cell, .empty-state { color: #718096; text-align: center !important; padding: 30px !important; }
.feature-item-list { display: grid; gap: 12px; }
.feature-item-card { background: #fff; border: 1px solid #e5eaf0; border-radius: 13px; padding: 17px; box-shadow: 0 4px 15px rgba(20,40,70,0.05); display: flex; justify-content: space-between; gap: 15px; align-items: flex-start; }
.feature-item-card strong { color: #123b70; }
.feature-muted { color: #718096; margin-top: 6px; white-space: pre-wrap; }
.feature-item-actions { display: flex; gap: 7px; flex-shrink: 0; }
.attachment-line { margin-top: 9px; color: #123b70; font-size: 13px; font-weight: 600; }
.feature-share-row { display: flex; gap: 9px; margin-top: 16px; flex-wrap: wrap; }
.file-label { display: block; background: #edf3fb; color: #123b70; border-radius: 8px; padding: 11px 13px; font-weight: 700; cursor: pointer; text-align: center; }
.feature-print-area { display: none; }
@media print {
    body > *:not(.feature-print-area) { display: none !important; }
    .feature-print-area { display: block !important; padding: 25px; font-family: Arial, sans-serif; color: #111; }
    .feature-print-area h1 { color: #123b70; }
    .feature-print-area pre { white-space: pre-wrap; font: 13px/1.6 Arial, sans-serif; }
}
@media (max-width: 760px) {
    .admin-feature-buttons { width: 100%; justify-content: flex-start; }
    .admin-feature-button { flex: 1 1 calc(50% - 8px); }
    .feature-item-card { flex-direction: column; }
    .feature-item-actions { width: 100%; }
}
@media (max-width: 520px) {
    .admin-feature-button { flex: 1 1 100%; }
}

/* Shop dashboard feature buttons: keeps the existing card style and puts all four shop actions together. */
.shop-feature-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}
.shop-feature-option {
    min-width: 0;
}
.shop-feature-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 700px) {
    .shop-feature-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Shop dashboard: shown only after opening a shop. Existing page styling is preserved. */
.shop-action-dashboard{display:flex;flex-direction:column;gap:12px;margin:18px 0 24px;}
.shop-dashboard-title{font-size:24px;font-weight:700;margin-bottom:4px;}
.shop-dashboard-button{width:100%;min-height:48px;}


/* Shop dashboard: hide original daily-entry content until Daily Sales Entry is opened. */
#shopPage.dsa-dashboard-mode > .shop-page-header,
#shopPage.dsa-dashboard-mode > .date-card,
#shopPage.dsa-dashboard-mode > .amount-card,
#shopPage.dsa-dashboard-mode > .history-section {
    display: none !important;
}

/* Monthly Accounting + Received Amount — added without changing the existing V14 visual system. */
.monthly-accounting-content,.received-amount-content{max-width:100%;}
.monthly-head{display:flex;justify-content:space-between;align-items:end;gap:16px;background:#fff;border:1px solid #e5eaf0;border-radius:13px;padding:18px;margin-bottom:14px;box-shadow:0 4px 15px rgba(20,40,70,.05)}
.monthly-head strong{font-size:22px;color:#123b70}.monthly-title{margin-top:5px;text-transform:capitalize;font-weight:700}.monthly-head label{display:flex;flex-direction:column;gap:6px;font-weight:700}.monthly-head select{min-width:180px;padding:10px;border:1px solid #d8e0e8;border-radius:8px;background:#fff}
.monthly-section{background:#fff;border:1px solid #e5eaf0;border-radius:13px;padding:17px;margin-bottom:14px;box-shadow:0 4px 15px rgba(20,40,70,.05)}
.monthly-section-title{font-size:18px;font-weight:800;color:#123b70;margin-bottom:10px}.monthly-grid{display:grid;grid-template-columns:minmax(0,1fr) 180px 54px;gap:8px;align-items:center}.monthly-grid-head{font-size:13px;font-weight:800;color:#718096;padding:0 4px 7px}.monthly-row{margin-bottom:8px}.monthly-row input{width:100%;box-sizing:border-box;padding:10px 11px;border:1px solid #d8e0e8;border-radius:8px;background:#fff}.monthly-row-delete{min-height:40px}.monthly-controls{display:flex;gap:8px;margin-top:10px;flex-wrap:wrap}.monthly-total{display:flex;justify-content:space-between;align-items:center;background:#edf4fc;border-radius:9px;padding:12px 14px;margin-top:12px;color:#123b70}.monthly-total strong{font-size:17px}.monthly-final{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:30px}.monthly-final>div{background:#fff;border:1px solid #e5eaf0;border-radius:13px;padding:17px;box-shadow:0 4px 15px rgba(20,40,70,.05)}.monthly-final span{display:block;color:#718096;font-size:13px;font-weight:700}.monthly-final strong{display:block;color:#123b70;font-size:22px;margin-top:6px}.received-add-card{display:grid;grid-template-columns:160px minmax(0,1fr) 180px 120px;gap:9px;background:#fff;border:1px solid #e5eaf0;border-radius:13px;padding:15px;margin-bottom:14px;box-shadow:0 4px 15px rgba(20,40,70,.05)}.received-add-card input{width:100%;box-sizing:border-box;padding:10px 11px;border:1px solid #d8e0e8;border-radius:8px}.received-table th,.received-table td{text-align:left;vertical-align:middle}
@media(max-width:760px){.monthly-head{flex-direction:column;align-items:stretch}.monthly-grid{grid-template-columns:minmax(0,1fr) 120px 48px}.monthly-final{grid-template-columns:1fr}.received-add-card{grid-template-columns:1fr 1fr}.received-add-card button{grid-column:1/-1}}
@media(max-width:520px){.monthly-grid{grid-template-columns:minmax(0,1fr) 100px 42px}.received-add-card{grid-template-columns:1fr}.received-add-card button{grid-column:auto}}

.partner-calc{display:grid!important;grid-template-columns:1fr 110px 1fr auto!important;gap:8px;align-items:center}.partner-calc input{width:100%;box-sizing:border-box;padding:10px 11px;border:1px solid #d8e0e8;border-radius:8px}.partner-calc strong{margin-top:0!important}@media(max-width:760px){.partner-calc{grid-template-columns:1fr 100px!important}.partner-calc span:last-of-type{grid-column:1}.partner-calc strong{grid-column:2;grid-row:2}}
/* Monthly Account page */
.monthly-list-head,.monthly-editor-head{display:flex;justify-content:space-between;align-items:center;gap:16px;background:#fff;border:1px solid #e5eaf0;border-radius:13px;padding:18px;margin-bottom:14px;box-shadow:0 4px 15px rgba(20,40,70,.05)}
.monthly-list-head strong,.monthly-editor-head strong{font-size:22px;color:#123b70;display:block}.monthly-editor-head{align-items:end}.monthly-editor-head>div{display:flex;flex-direction:column;gap:5px}.monthly-editor-head .back-button{align-self:flex-start;margin-bottom:4px}.monthly-editor-head label{display:flex;flex-direction:column;gap:6px;font-weight:700}.monthly-editor-head select{min-width:190px;padding:10px;border:1px solid #d8e0e8;border-radius:8px;background:#fff}
.monthly-account-list{display:flex;flex-direction:column;gap:10px}.monthly-account-card{display:flex;justify-content:space-between;align-items:center;gap:12px;background:#fff;border:1px solid #e5eaf0;border-radius:12px;padding:15px;box-shadow:0 4px 15px rgba(20,40,70,.04)}.monthly-account-card strong{color:#123b70;font-size:17px}.monthly-account-actions{display:flex;gap:8px;flex-wrap:wrap}.monthly-pdf-actions{display:flex;gap:9px;justify-content:flex-end;flex-wrap:wrap;margin:0 0 14px}.monthly-pdf-actions-bottom{justify-content:center;margin:0 0 14px}.monthly-save-area{display:flex;justify-content:center;margin:4px 0 18px}.monthly-save-button{min-width:180px;font-size:16px}.monthly-final{margin-bottom:18px}
@media(max-width:760px){.monthly-list-head,.monthly-editor-head{flex-direction:column;align-items:stretch}.monthly-editor-head select{width:100%;box-sizing:border-box}.monthly-account-card{align-items:stretch;flex-direction:column}.monthly-account-actions{width:100%}.monthly-account-actions button{flex:1}.monthly-pdf-actions{justify-content:stretch}.monthly-pdf-actions button{flex:1}}

.monthly-section-title-row{display:flex;justify-content:space-between;align-items:center;gap:10px}.monthly-section-title-row .monthly-section-title{margin-bottom:0}.monthly-linked-note{font-size:12px;color:#718096;font-weight:700}.monthly-linked-salary input{background:#f3f6f9;font-weight:800;color:#123b70}.monthly-linked-salary .monthly-row-delete{visibility:hidden}
.monthly-final-controls{display:flex;align-items:center;justify-content:flex-start;background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important}
.monthly-final-controls button:disabled,.monthly-row-delete:disabled{opacity:1!important;cursor:not-allowed!important;pointer-events:none!important;filter:none!important;background:#e3e9f1!important;color:#64748b!important;border-color:#c7d0dc!important;box-shadow:inset 0 0 0 1px rgba(100,116,139,.08)!important}
.monthly-control-locked{opacity:1!important;cursor:not-allowed!important;filter:none!important;background:#e3e9f1!important;color:#64748b!important;border-color:#c7d0dc!important}
.partner-controls button:disabled{opacity:1!important;cursor:not-allowed!important;pointer-events:none!important;filter:none!important;background:#e3e9f1!important;color:#64748b!important;border-color:#c7d0dc!important;box-shadow:inset 0 0 0 1px rgba(100,116,139,.08)!important}
.monthly-summary-highlight{background:#f4f8fd!important;border-color:#b9cbe0!important;box-shadow:0 3px 12px rgba(18,59,112,.10)!important}
.monthly-summary-highlight span{color:#123b70!important;font-weight:800!important}
.monthly-summary-highlight strong{color:#123b70!important;font-weight:900!important}
/* V119: Monthly Accounting summary name and amount stay on the same row.
   Applies to both Grocery and Cafe/Restaurant; extra editable rows keep their existing layout. */
.monthly-final > .monthly-summary-highlight:not(.monthly-summary-extra-row){
  display:flex!important;
  flex-direction:row!important;
  align-items:center!important;
  justify-content:space-between!important;
  gap:18px!important;
}
.monthly-final > .monthly-summary-highlight:not(.monthly-summary-extra-row) span{
  display:block!important;
  flex:1 1 auto!important;
  margin:0!important;
}
.monthly-final > .monthly-summary-highlight:not(.monthly-summary-extra-row) strong{
  display:block!important;
  flex:0 0 auto!important;
  margin:0!important;
  text-align:right!important;
}

.monthly-final-controls .primary-button{margin:0}
#extraSaveRows,#extraCostRows{display:contents}
.monthly-final .monthly-row{display:grid;grid-template-columns:minmax(0,1fr) 180px 54px;gap:8px;align-items:center;background:#fff;border:1px solid #e5eaf0;border-radius:13px;padding:17px;box-sizing:border-box;margin:0}
@media(max-width:760px){.monthly-final .monthly-row{grid-template-columns:minmax(0,1fr) 120px 48px}}

/* V55: Extra Save / Extra Cost rows use the same clean bordered row design as the Final Summary. */
.monthly-final .monthly-summary-extra-name,.monthly-final .monthly-summary-extra-name{border-right:1px solid #e5eaf0;}
@media(max-width:760px){.monthly-final .monthly-extra-row{grid-template-columns:minmax(0,1fr) 120px 48px;}}

/* Extra Save / Extra Cost rows use the same Final Summary box design as Card Save, Cash Save and Total Save. */
.monthly-final .monthly-summary-extra-value{gap:8px;}
.monthly-final .monthly-summary-extra-value .monthly-amount{text-align:center;}
.monthly-final .monthly-summary-extra-value .monthly-row-delete{flex:0 0 42px;min-width:42px;}
@media(max-width:760px){.monthly-final .monthly-summary-extra-value .monthly-row-delete{flex:0 0 40px;min-width:40px;}}
/* Exact Final Summary card size for added Save/Cost rows */
.monthly-final .monthly-summary-extra-name,@media(max-width:760px){}

/* V60: extra Save/Cost rows are individual cards matching Cash Save/Card Save/Total Save */
.monthly-final #extraSaveRows,.monthly-final #extraCostRows{display:contents}
.monthly-final .monthly-summary-extra-row{position:relative;background:#fff;border:1px solid #e5eaf0;border-radius:13px;padding:17px;box-shadow:0 4px 15px rgba(20,40,70,.05);box-sizing:border-box;min-width:0;min-height:0;width:auto;margin:0;display:grid;grid-template-columns:minmax(0,1fr) 180px 42px;align-items:center;column-gap:12px}
.monthly-final .monthly-summary-extra-name,.monthly-final .monthly-summary-extra-amount{min-width:0;padding:0;margin:0;display:block;border:0}
.monthly-final .monthly-summary-extra-row input{width:100%;box-sizing:border-box;background:transparent;border:0;outline:0;border-radius:0;padding:0;margin:0;font-size:inherit;font-family:inherit}
.monthly-final .monthly-summary-extra-name input{color:#718096;font-size:13px;font-weight:700;line-height:1.2}
.monthly-final .monthly-summary-extra-amount input{color:#123b70;font-size:22px;font-weight:800;line-height:1.2;text-align:left}
.monthly-final .monthly-summary-extra-delete{position:absolute;top:7px;right:7px;width:22px;min-width:22px;height:22px;min-height:22px;padding:0!important;border:0!important;border-radius:50%!important;background:transparent!important;box-shadow:none!important;font-size:18px;line-height:22px}
@media(max-width:760px){.monthly-final .monthly-summary-extra-row{min-height:0;grid-template-columns:minmax(0,1fr) 120px 40px;column-gap:8px}.monthly-final .monthly-summary-extra-delete{top:6px;right:6px}}

/* V67: Monthly Final Summary items must appear one full-width row at a time. */
.monthly-final{grid-template-columns:1fr!important;}
.monthly-final>div{grid-column:1!important;width:100%;box-sizing:border-box;}
.monthly-final-controls{grid-column:1!important;}
.monthly-final #extraSaveRows,.monthly-final #extraCostRows{grid-column:1!important;}
.monthly-final .monthly-summary-extra-row{width:100%;}
/* V68: Final Summary optional Save/Cost row controls */
.monthly-final-controls{gap:8px;flex-wrap:wrap;}
.monthly-final-controls .delete-button{margin:0;}

/* =========================================================
   REPORT ACTION BUTTONS - TOP RIGHT
========================================================= */
.report-actions-top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin: -44px 18px 12px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.report-action-group {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    width: auto;
}

.report-action-title {
    display: none;
}

.report-action-buttons {
    display: flex;
    gap: 5px;
}

.report-action-button {
    width: auto;
    min-width: 0;
    min-height: 32px;
    margin: 0;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.whatsapp-button {
    background: #25D366;
    color: white;
    border: 1px solid #25D366;
    border-radius: 8px;
    padding: 9px 12px;
    font-weight: 700;
    cursor: pointer;
}

.whatsapp-button:hover {
    filter: brightness(0.96);
}

@media (max-width: 600px) {
    .report-action-buttons {
        grid-template-columns: 1fr;
    }
}


/* V92: report action buttons at the upper-right of the Reports page. */
#reportsPage {
    position: relative;
}
.report-actions-top {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    position: absolute;
    top: 0;
    right: 0;
    margin: 0 !important;
    z-index: 10;
}
.report-action-buttons {
    display: flex;
    gap: 5px;
}
.report-action-button {
    width: auto;
    min-width: 0;
    min-height: 32px;
    margin: 0;
    padding: 5px 9px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

/* V92: preserve the existing compact report cards. */
.report-summary {
    grid-template-columns: 1fr;
    gap: 7px;
}
.report-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    padding: 10px 14px;
    min-height: 48px;
}
.report-box span { font-size: 12px; }
.report-box strong {
    margin-top: 0;
    font-size: 19px;
    text-align: right;
    white-space: nowrap;
}
.report-day-row {
    display: grid;
    grid-template-columns: 105px max-content;
    justify-content: start;
    column-gap: 12px;
    align-items: center;
    padding: 5px 0;
}
.report-day-row strong { text-align: left; white-space: nowrap; }

@media (max-width: 700px) {
    .report-actions-top {
        position: static;
        justify-content: flex-end;
        margin: 0 0 10px !important;
    }
}


/* V93: Report-page action buttons stay at the bottom of the report list.
   The PDF itself is unchanged. */
#reportsPage .report-actions-top {
    position: absolute !important;
    top: 96px !important;
    right: 28px !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 10 !important;
}

#reportsPage .report-action-buttons {
    display: flex !important;
    gap: 5px !important;
}

#reportsPage .report-action-button {
    width: auto !important;
    min-width: 0 !important;
    min-height: 32px !important;
    margin: 0 !important;
    padding: 9px 12px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    box-sizing: border-box;
}

/* Make SHARE / WHATSAPP the exact same blue as DOWNLOAD PDF. */
#reportsPage .report-action-button.secondary-button,
#reportsPage .report-action-button.whatsapp-button {
    background: #123b70 !important;
    color: #fff !important;
    border: 0 !important;
    border-radius: 9px !important;
}

#reportsPage .report-action-button.secondary-button:hover,
#reportsPage .report-action-button.whatsapp-button:hover {
    background: #0d2f5b !important;
}

@media (max-width: 700px) {
    #reportsPage .report-actions-top {
        position: static !important;
        justify-content: flex-end !important;
        margin: 0 12px 10px !important;
    }
}

/* V114: Extra Save / Extra Cost rows stay highlighted like the Final Summary values. */
.monthly-summary-extra-row.monthly-summary-highlight .monthly-name,.monthly-summary-extra-row.monthly-summary-highlight .monthly-amount{background:#f4f8fd!important;border-color:#b9cbe0!important;color:#123b70!important;font-weight:800!important}

/* V132: Extra Save/Cost rows use the same three-column layout as Salary/Cost rows.
   The delete X stays in the dedicated right-side column instead of floating over the row. */
.monthly-final .monthly-summary-extra-row{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 180px 54px!important;
  gap:8px!important;
  align-items:center!important;
  position:relative!important;
  padding:10px 0!important;
  min-height:40px!important;
  width:100%!important;
  box-sizing:border-box!important;
  margin:0 0 8px!important;
}
.monthly-final .monthly-summary-extra-name,
.monthly-final .monthly-summary-extra-amount{
  min-width:0!important;
  width:auto!important;
  padding:0 11px!important;
  margin:0!important;
  display:block!important;
  border:0!important;
}
.monthly-final .monthly-summary-extra-row input{
  width:100%!important;
  box-sizing:border-box!important;
  background:transparent!important;
  border:0!important;
  outline:0!important;
  border-radius:0!important;
  padding:0!important;
  margin:0!important;
}
.monthly-final .monthly-summary-extra-name input{
  color:#123b70!important;
  font-size:13px!important;
  font-weight:800!important;
  line-height:1.2!important;
}
.monthly-final .monthly-summary-extra-amount input{
  color:#123b70!important;
  font-size:22px!important;
  font-weight:800!important;
  line-height:1.2!important;
  text-align:right!important;
}
.monthly-final .monthly-summary-extra-delete{
  position:static!important;
  top:auto!important;
  right:auto!important;
  width:100%!important;
  min-width:0!important;
  min-height:40px!important;
  margin:0!important;
  padding:10px 12px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}
@media(max-width:760px){
  .monthly-final .monthly-summary-extra-row{
    grid-template-columns:minmax(0,1fr) 120px 40px!important;
    gap:8px!important;
    padding:10px 0!important;
  }
}
/* V122: duplicate Save/Cost controls after Balance, matching the controls above. */
.monthly-final-controls-bottom{margin-top:8px!important;gap:10px;flex-wrap:wrap}


/* V134: Monthly Accounting Final Summary rows use the same columns as
   the editable Extra Save / Extra Cost rows.  Only layout is changed. */
.monthly-final > .monthly-summary-highlight:not(.monthly-summary-extra-row){
  display:grid!important;
  grid-template-columns:minmax(0,1fr) 180px 54px!important;
  gap:8px!important;
  align-items:center!important;
  box-sizing:border-box!important;
  padding:17px!important;
}
.monthly-final > .monthly-summary-highlight:not(.monthly-summary-extra-row) span{
  grid-column:1!important;
  display:block!important;
  margin:0!important;
  min-width:0!important;
}
.monthly-final > .monthly-summary-highlight:not(.monthly-summary-extra-row) strong{
  grid-column:2!important;
  display:block!important;
  margin:0!important;
  text-align:right!important;
  min-width:0!important;
}

/* V134: In EDIT mode every removable Monthly Accounting row has the same
   red delete button as Salary / Total Cost rows. After SAVE it becomes the
   normal locked neutral color. */
.monthly-final .monthly-summary-extra-delete{
  grid-column:3!important;
  position:static!important;
  width:100%!important;
  min-width:0!important;
  min-height:40px!important;
  margin:0!important;
  padding:10px 12px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border:0!important;
  border-radius:8px!important;
  background:#e02a3b!important;
  color:#fff!important;
  box-shadow:none!important;
  font-size:18px!important;
  line-height:1!important;
}
.monthly-final .monthly-summary-extra-delete.monthly-control-locked,
.monthly-final .monthly-summary-extra-delete:disabled{
  background:#e3e9f1!important;
  color:#64748b!important;
  border-color:#c7d0dc!important;
  opacity:1!important;
  cursor:not-allowed!important;
  pointer-events:none!important;
}
@media(max-width:760px){
  .monthly-final > .monthly-summary-highlight:not(.monthly-summary-extra-row){
    grid-template-columns:minmax(0,1fr) 120px 40px!important;
    gap:8px!important;
    padding:17px!important;
  }
}

/* V135: Bottom Save Row uses the exact same direct-row layout as the other
   editable Save/Cost rows. Prevent the container itself from becoming a card. */
.monthly-final #extraSaveRowsBottom{
  display:contents!important;
  grid-column:1!important;
}

/* V135: Keep the Monthly Accounting action buttons compact and consistent. */
.monthly-final-controls button,
.partner-controls button{
  min-height:40px!important;
  padding:10px 14px!important;
  font-size:14px!important;
  line-height:20px!important;
  border-radius:8px!important;
  box-sizing:border-box!important;
}

/* V135: Remove Partners has the same compact button height/style as the
   Add Save / Add Cost controls. */
#addPartnerBox,
#removePartnerBox,
#addExtraSaveRow,
#addExtraCostRow,
#addExtraSaveRowBottom{
  min-height:40px!important;
  padding:10px 14px!important;
  font-size:14px!important;
  line-height:20px!important;
  border-radius:8px!important;
  box-sizing:border-box!important;
}

/* V136: Make Monthly Accounting action controls smaller and remove the
   unwanted white card/row around the Remove Partners control. */
.monthly-final-controls,
.partner-controls{
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  padding:0!important;
  margin:8px 0!important;
  min-height:0!important;
}
.monthly-final-controls button,
.partner-controls button,
#addPartnerBox,
#removePartnerBox{
  min-height:34px!important;
  height:34px!important;
  padding:6px 11px!important;
  font-size:13px!important;
  line-height:18px!important;
  border-radius:7px!important;
  box-sizing:border-box!important;
  margin:0!important;
}
.partner-controls{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  gap:8px!important;
}

/* V142 — single-page Shop navigation. Existing inner page layouts are not restyled. */
#shopPage.dsa-dashboard-mode > .shop-page-header{
    display:flex !important;
}
#shopPage.dsa-dashboard-mode > .shopActionDashboard,
#shopActionDashboard{
    width:100%;
}
.shop-action-dashboard{
    display:grid !important;
    grid-template-columns:repeat(7,minmax(0,1fr));
    gap:7px;
    margin:12px 0 14px;
    padding:0;
}
.shop-dashboard-button{
    min-width:0;
    min-height:58px;
    height:58px;
    border:1px solid rgba(255,255,255,.35);
    border-radius:9px;
    padding:6px 5px;
    font-size:12px;
    line-height:15px;
    font-weight:800;
    color:#fff;
    background:#1976d2;
    box-shadow:0 3px 8px rgba(18,59,112,.14);
    transition:transform .12s ease,box-shadow .12s ease,filter .12s ease;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
}
.shop-dashboard-button:nth-child(2){background:#16a34a}
.shop-dashboard-button:nth-child(3){background:#7c3aed}
.shop-dashboard-button:nth-child(4){background:#f59e0b}
.shop-dashboard-button:nth-child(5){background:#08a7a7}
.shop-dashboard-button:nth-child(6){background:#ef476f}
.shop-dashboard-button:nth-child(7){background:#64748b}
.shop-dashboard-button:hover{filter:brightness(1.04);transform:translateY(-1px)}
.shop-dashboard-button.active{
    outline:3px solid #ffffff;
    outline-offset:-4px;
    box-shadow:0 0 0 3px #123b70,0 5px 12px rgba(18,59,112,.24);
    transform:translateY(-1px);
}
.shop-dashboard-content{
    width:100%;
    min-height:20px;
}
.shop-dashboard-content.hidden{display:none !important}
/* The existing daily page is shown directly underneath the navigation. */
#shopPage.dsa-dashboard-mode > .date-card,
#shopPage.dsa-dashboard-mode > .amount-card,
#shopPage.dsa-dashboard-mode > .history-section{display:none !important}
@media(max-width:900px){
    .shop-action-dashboard{grid-template-columns:repeat(4,minmax(0,1fr));}
}
@media(max-width:560px){
    .shop-action-dashboard{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;}
    .shop-dashboard-button{height:54px;min-height:54px;font-size:12px;}
}

/* V143 — Keep Shop feature controls visible inside the single-page dashboard. */
#shopDashboardContent .feature-add-shop{
    display:inline-flex !important;
    width:auto !important;
    min-height:38px !important;
    height:38px !important;
    margin:0 0 12px !important;
    padding:7px 13px !important;
    align-items:center !important;
    justify-content:center !important;
    font-size:13px !important;
    font-weight:800 !important;
    border-radius:8px !important;
}

/* Report DOWNLOAD PDF / SHARE buttons must remain visible at the top of the
   selected report section after the report controls are moved into the dashboard. */
#shopDashboardContent .report-actions-top{
    position:static !important;
    display:flex !important;
    width:100% !important;
    box-sizing:border-box !important;
    justify-content:flex-end !important;
    align-items:center !important;
    gap:6px !important;
    margin:0 0 10px !important;
    padding:0 !important;
    z-index:20 !important;
}
#shopDashboardContent .report-action-buttons{
    display:flex !important;
    gap:5px !important;
}
#shopDashboardContent .report-action-button{
    display:inline-flex !important;
    width:auto !important;
    min-width:0 !important;
    min-height:34px !important;
    height:34px !important;
    margin:0 !important;
    padding:7px 11px !important;
    align-items:center !important;
    justify-content:center !important;
    font-size:11px !important;
    font-weight:800 !important;
    white-space:nowrap !important;
    box-sizing:border-box !important;
}

@media(max-width:700px){
    #shopDashboardContent .report-actions-top{
        justify-content:flex-end !important;
        margin:0 0 10px !important;
    }
    #shopDashboardContent .report-action-button{
        font-size:10px !important;
        padding:7px 9px !important;
    }
}


/* V147: Welcome panel shown when a shop is first opened. Existing inner page
   layouts remain unchanged after a dashboard option is selected. */
#shopDashboardContent .shop-dashboard-welcome{
    min-height:260px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
    padding:30px 20px;
    box-sizing:border-box;
    border:1px solid rgba(0,0,0,.08);
    border-radius:12px;
    background:#fff;
    margin-top:8px;
}
#shopDashboardContent .shop-dashboard-welcome-title{
    font-size:30px;
    font-weight:900;
    margin-bottom:8px;
}
#shopDashboardContent .shop-dashboard-welcome-shop{
    font-size:22px;
    font-weight:900;
    margin-bottom:10px;
}
#shopDashboardContent .shop-dashboard-welcome-text{
    font-size:15px;
    font-weight:600;
    opacity:.75;
}

/* V148: welcome screen shown when a shop is first opened. */
#shopDashboardContent .shop-dashboard-welcome{
    min-height:220px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
    padding:35px 20px;
    box-sizing:border-box;
}
#shopDashboardContent .shop-dashboard-welcome-title{
    font-size:28px;
    font-weight:900;
    margin-bottom:8px;
}
#shopDashboardContent .shop-dashboard-welcome-shop{
    font-size:24px;
    font-weight:900;
    margin-bottom:10px;
}
#shopDashboardContent .shop-dashboard-welcome-text{
    font-size:15px;
    font-weight:600;
    opacity:.75;
}

@media (max-width: 480px) { #shopList .shop-actions { flex-direction:row !important; } #shopList .shop-actions button { width:auto !important; } }


/* ================= CHEQUE DATE ================= */
.cheque-shop-list{display:grid;gap:10px;margin-top:14px}
.cheque-shop-button{width:100%;text-align:left}
.cheque-subhead{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:8px 0 14px}
.cheque-subhead h3{margin:0;flex:1;min-width:180px}
.cheque-subhead .back-button{margin:0}
@media(max-width:600px){.cheque-subhead{align-items:stretch}.cheque-subhead h3{width:100%;order:2}.cheque-subhead #addChequeDateButton{width:100%;order:3}.cheque-subhead .back-button{order:1}}

.cheque-name-row{display:flex;align-items:center;gap:6px;margin:8px 0}
.cheque-name-button{flex:1;text-align:left;border:1px solid #d9e0ea;background:#fff;border-radius:8px;padding:10px 12px;font-weight:600;cursor:pointer}
.cheque-small-button{padding:5px 8px!important;font-size:11px!important;line-height:1!important;min-width:auto!important}
.cheque-subhead{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:8px 0 14px}
.cheque-subhead h3{margin:0;flex:1;min-width:180px}
@media(max-width:600px){.cheque-name-row{gap:4px}.cheque-small-button{padding:5px 6px!important;font-size:10px!important}.cheque-subhead{align-items:stretch}.cheque-subhead h3{width:100%}.cheque-subhead #addChequeDateButton{width:100%}}

/* V159 cheque controls: keep the two add buttons small and side-by-side. */
.cheque-add-actions{display:flex;align-items:center;gap:6px;flex-wrap:nowrap}
.cheque-add-actions .cheque-small-button{width:auto!important;white-space:nowrap}
@media(max-width:600px){.cheque-add-actions{width:100%;gap:5px}.cheque-add-actions .cheque-small-button{flex:1;padding:5px 6px!important;font-size:10px!important}}

/* V161: cheque name uses the same primary button appearance as ADD NAME. */
.cheque-name-button{
    width:100%;
    text-align:left;
    border:1px solid #007bff;
    background:#007bff;
    color:#fff;
    border-radius:8px;
    padding:10px 12px;
    font-weight:700;
    cursor:pointer;
}
.cheque-name-button:hover{filter:brightness(.95)}
.cheque-add-actions{display:flex;align-items:center;gap:6px;flex-wrap:nowrap}
.cheque-add-actions .cheque-small-button{width:auto!important;white-space:nowrap}
@media(max-width:600px){
    .cheque-add-actions{width:100%;gap:5px}
    .cheque-add-actions .cheque-small-button{flex:1;padding:5px 6px!important;font-size:10px!important}
}


/* V162 cheque layout: add buttons are taller, not wider. */
.cheque-add-actions .cheque-small-button{
    min-height:42px!important;
    padding-top:10px!important;
    padding-bottom:10px!important;
    font-size:11px!important;
}
@media(max-width:600px){
    .cheque-add-actions .cheque-small-button{
        min-height:44px!important;
        padding-top:11px!important;
        padding-bottom:11px!important;
        font-size:10px!important;
    }
}


/* V162: cheque detail add buttons are taller without becoming longer. */
.cheque-add-actions .cheque-small-button{min-height:44px!important;padding-top:11px!important;padding-bottom:11px!important}
@media(max-width:600px){.cheque-add-actions .cheque-small-button{min-height:46px!important;padding-top:12px!important;padding-bottom:12px!important}}


/* V182: Cheque home Back and ADD NAME share one row. */
.cheque-home-top-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:8px 0 14px;width:100%;}
.cheque-home-top-row .cheque-inline-back{margin:0!important;padding:10px 0!important;}
.cheque-home-top-row #addChequeShopButton{margin-left:auto;}

/* V182: all Share / WhatsApp actions use the same primary/download color. */
.share-action-button{background:#123b70!important;color:#fff!important;border:0!important;border-radius:9px!important;}
.share-action-button:hover{background:#0d2f5b!important;}

/* V182: ADD CHEQUE COPY is a full-size add control like ADD CHEQUE DATA. */
.cheque-copy-add-row{display:flex;justify-content:flex-end;margin:12px 0 0;}
.cheque-add-copy-button{min-height:46px!important;padding:12px 18px!important;font-size:14px!important;font-weight:800!important;}
.cheque-copy-download-button{padding:8px 12px!important;font-weight:800!important;}
@media(max-width:600px){.cheque-home-top-row{gap:8px}.cheque-add-copy-button{width:100%;min-height:46px!important;padding:12px 14px!important;font-size:13px!important}.cheque-copy-add-row{display:block;}.cheque-copy-download-button,.cheque-copy-wrap .share-action-button{padding:8px 10px!important;font-size:11px!important;}}

/* Upcoming cheque */
.upcoming-cheque-home-button{margin-top:0;}
.upcoming-paid-button{min-width:82px!important;padding:7px 12px!important;font-size:12px!important;font-weight:800!important;}
.cheque-status-paid{font-weight:900;text-transform:uppercase;}
.cheque-status-unpaid{font-weight:900;text-transform:uppercase;}

/* V324 Save Received & Cost / Cost monthly-style editor compatibility */

.received-amount-content .monthly-editor-head,.costFeaturePage .monthly-editor-head{width:100%;box-sizing:border-box;}
.received-amount-content .monthly-section,.costFeaturePage .monthly-section{width:100%;box-sizing:border-box;}
.received-amount-content .monthly-row input,.costFeaturePage .monthly-row input{min-width:0;}

/* V324 Cost / Save Received & Cost — multi-table Monthly Accounting layout */
.cost-table-date-row{display:flex;align-items:center;gap:12px;margin:0 0 12px;color:#123b70;font-weight:800}
.cost-table-date-row>label{min-width:72px}
.cost-date-wrap{display:flex;align-items:center;gap:10px}
.cost-table-date,.received-table-date{padding:10px 11px;border:1px solid #d8e0e8;border-radius:8px;background:#fff;font:inherit;color:#172033;min-width:180px;box-sizing:border-box}
.cost-date-wrap span{color:#718096;font-size:13px;font-weight:700}
.monthly-table-number{color:#718096;font-size:12px;font-weight:800}
.monthly-table-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin-top:14px}
.monthly-table-actions button{min-width:120px}
.cost-add-table-area,.received-add-table-area{margin:0 0 14px}
.cost-overall-total,.received-overall-summary{margin-bottom:10px}
.cost-table-card .monthly-section-title,.received-table-card .monthly-section-title{margin-bottom:10px}
.cost-table-card .monthly-row,.received-table-card .monthly-row{margin-bottom:8px}
@media(max-width:760px){
  .cost-table-date-row{align-items:stretch;flex-direction:column;gap:6px}
  .cost-date-wrap{align-items:stretch;flex-direction:column}
  .cost-table-date,.received-table-date{width:100%;min-width:0}
  .monthly-table-actions button{flex:1;min-width:100px}
}

/* V324 clean Cost / Save Received & Cost layout.  The old renderer is no longer used. */
.cost-new-table-card,.received-new-table-card{overflow:hidden;}
.cost-new-date-line,.received-new-date-line{display:flex;align-items:center;gap:10px;margin:8px 0 14px;flex-wrap:wrap;}
.cost-new-date-line label,.received-new-date-line label{font-weight:800;color:#123b70;min-width:55px;}
.cost-new-date,.received-new-date{width:140px!important;min-width:140px;padding:10px 11px;border:1px solid #d8e0e8;border-radius:8px;background:#fff;box-sizing:border-box;}
.cost-new-date-display,.received-new-date-display{color:#718096;font-weight:700;font-size:13px;}
.cost-new-head{display:grid;grid-template-columns:minmax(0,1fr) 140px 54px;gap:8px;padding:0 4px 7px;font-size:13px;font-weight:800;color:#718096;}
.cost-new-row{display:grid;grid-template-columns:150px minmax(0,1fr) 140px 54px;gap:8px;align-items:center;margin-bottom:8px;}
.cost-new-label,.received-new-row-type{padding:10px 11px;border:1px solid #d8e0e8;border-radius:8px;background:#f3f6f9;color:#123b70;font-weight:800;min-height:40px;display:flex;align-items:center;box-sizing:border-box;}
.cost-new-name,.cost-new-amount,.received-new-name,.received-new-amount{width:100%;box-sizing:border-box;padding:10px 11px;border:1px solid #d8e0e8;border-radius:8px;background:#fff;min-height:40px;}
.cost-new-amount,.received-new-amount{text-align:right;}
.cost-new-row-delete,.received-new-row-delete{min-height:40px!important;width:54px!important;min-width:54px!important;padding:0!important;}
.cost-new-actions,.received-new-actions{display:grid;grid-template-columns:minmax(180px,1fr) 160px 160px;gap:10px;margin-top:12px;}
.cost-new-actions button,.received-new-actions button{min-height:44px;}
.received-new-head{display:grid;grid-template-columns:150px minmax(0,1fr) 140px 54px;gap:8px;padding:0 4px 7px;font-size:13px;font-weight:800;color:#718096;}
.received-new-row{display:grid;grid-template-columns:150px minmax(0,1fr) 140px 54px;gap:8px;align-items:center;margin-bottom:8px;}
.received-new-save-row .received-new-row-type{color:#123b70;}
.received-new-cost-row .received-new-row-type{color:#123b70;}
@media(max-width:760px){
 .cost-new-head,.received-new-head{grid-template-columns:minmax(0,1fr) 120px 48px;}
 .cost-new-row,.received-new-row{grid-template-columns:120px minmax(0,1fr) 120px 48px;}
 .cost-new-row-delete,.received-new-row-delete{width:48px!important;min-width:48px!important;}
 .cost-new-actions,.received-new-actions{grid-template-columns:1fr;}
}
@media(max-width:560px){
 .cost-new-head,.received-new-head{display:none;}
 .cost-new-row,.received-new-row{grid-template-columns:1fr 110px 42px;}
 .cost-new-label,.received-new-row-type{grid-column:1/-1;}
 .cost-new-row-delete,.received-new-row-delete{width:42px!important;min-width:42px!important;}
}

/* Save and Cost Details — per-table and selected-month summaries. */
.received-new-page-title{font-size:22px!important;font-weight:800!important;color:#123b70!important;margin:0!important;text-transform:none!important;}
.received-new-table-summary,.received-new-monthly-summary{margin-top:12px;padding:8px;background:#edf4fc;border:1px solid #d7e4f2;border-radius:11px;box-sizing:border-box;}
.received-new-summary-row{display:flex;justify-content:space-between;align-items:center;gap:18px;background:#f4f8fd;border:1px solid #b9cbe0;border-radius:9px;padding:13px 16px;margin:4px 0;color:#123b70;box-sizing:border-box;min-height:48px;}
.received-new-summary-row span{font-weight:800;color:#123b70;}
.received-new-summary-row strong{font-size:19px;font-weight:900;color:#123b70;text-align:right;}
.received-new-summary-final{background:#e4effc;border-color:#a9c5e6;min-height:56px;}
.received-new-summary-final span{font-size:18px;}
.received-new-summary-final strong{font-size:23px;}
.received-new-monthly-summary{margin:18px 0 30px;padding:10px;background:#edf4fc;}
.received-new-monthly-summary-title{font-size:20px;font-weight:800;color:#123b70;padding:4px 6px 8px;}
@media(max-width:560px){.received-new-summary-row{padding:11px 12px;gap:10px}.received-new-summary-row strong{font-size:17px}.received-new-summary-final span{font-size:16px}.received-new-summary-final strong{font-size:20px}.received-new-monthly-summary-title{font-size:18px;}}

/* V324 Cost page final layout: match the Save Received & Cost summary style. */
.cost-details-page-head{
  align-items:center!important;
  min-height:92px;
}
.cost-details-page-head>div{justify-content:center;}
.cost-details-page-head>div strong{
  font-size:28px!important;
  color:#123b70!important;
}
.cost-details-page-head label{min-width:190px;}
.cost-new-date-display{display:none!important;}
.cost-table-summary,.cost-monthly-summary{
  margin-top:12px;
  padding:8px;
  background:#edf4fc;
  border:1px solid #d7e4f2;
  border-radius:11px;
  box-sizing:border-box;
}
.cost-table-summary .received-new-summary-row,
.cost-monthly-summary .received-new-summary-row{
  margin:4px 0;
  min-height:48px;
}
.cost-monthly-summary{
  margin:18px 0 30px;
  padding:10px;
}
.cost-monthly-summary .received-new-monthly-summary-title{
  color:#123b70;
}
.cost-new-actions{
  display:grid!important;
  grid-template-columns:160px 160px 160px!important;
  justify-content:center!important;
  gap:10px!important;
  margin-top:12px!important;
}
.cost-new-actions button{
  width:160px!important;
  min-width:160px!important;
  max-width:160px!important;
  min-height:44px!important;
  height:44px!important;
}
@media(max-width:760px){
  .cost-new-actions{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  .cost-new-actions button{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
  }
}
@media(max-width:560px){
  .cost-details-page-head{
    align-items:stretch!important;
  }
  .cost-details-page-head label{min-width:0;}
  .cost-new-actions{
    grid-template-columns:1fr!important;
  }
  .cost-new-actions button{
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
  }
}


/* V324: PDF and SHARE controls for Cost and SAVE & COST. */
.feature-pdf-button{background:#6f35e8!important;color:#fff!important;border:0!important;}
.feature-pdf-button:hover{background:#5b25cc!important;}
.feature-monthly-pdf-actions{display:flex;justify-content:center;align-items:center;gap:10px;flex-wrap:wrap;margin-top:10px;}
.cost-new-actions,.received-new-actions{grid-template-columns:repeat(5,160px)!important;justify-content:center!important;}
.cost-new-actions button,.received-new-actions button{width:160px!important;min-width:160px!important;max-width:160px!important;}
@media(max-width:900px){.cost-new-actions,.received-new-actions{grid-template-columns:repeat(3,minmax(120px,1fr))!important;}.cost-new-actions button,.received-new-actions button{width:100%!important;min-width:0!important;max-width:none!important;}}
@media(max-width:560px){.cost-new-actions,.received-new-actions{grid-template-columns:repeat(2,minmax(0,1fr))!important;}.feature-monthly-pdf-actions button{flex:1;min-width:130px;}}
