/* ========================================================================
   SHARED COMPONENTS — Clean, consolidated UI component library
   
   STRATEGY: These are ADDED alongside existing CSS. Old classes remain
   until nothing references them. New classes use the `shared-` prefix.
   
   USAGE: Each HTML element gets BOTH its old class AND the new shared
   class until old CSS is confirmed dead:
     class="custom-dropdown shared-custom-dropdown"
   
   COLOUR THEMING: Use CSS variables --accent-color and --accent-hover
   to theme components per page.
   ======================================================================== */

/* shared-styles.css .calculator-header { padding: 20px }
   shared-main-header.js injects .newty-global-header { padding: 16px 20px }
   JS-injected style normally wins, but to guarantee the intended 16px
   vertical padding even if JS is slow, we override here: */
.calculator-header.newty-global-header {
    padding: 16px 20px;
}
:root {
    /* Default theme — green (calculator pages) */
    --accent-color: #2e7d32;
    --accent-hover: #256728;
    --accent-light: #e8f5e9;
    --accent-bg: #f5faf6;
    --warning-bg: #ffeb3b;
    --warning-border: #f57f17;
    --error-text: #d91e63;
    --error-bg: #ffebee;
    --text-primary: #333;
    --text-secondary: #555;
    --text-muted: #999;
    --border-light: #ddd;
    --border-medium: #e0e0e0;
    --bg-white: #fff;
    --bg-light: #f5f5f5;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;
    --font-family: Arial, sans-serif;
    --font-size-sm: 12px;
    --font-size-md: 13px;
    --font-size-base: 14px;
}

/* =========================================================================
   1. SHARED CUSTOM DROPDOWN
      Replaces:
        - login.css .custom-dropdown (purple)
        - taxcalculator_norway.css .custom-dropdown (green)
      Colour is controlled by --accent-color
   ========================================================================= */

.shared-custom-dropdown {
    position: relative;
    width: 100%;
    cursor: pointer;
    user-select: none;
}

.shared-custom-dropdown .shared-dropdown-selected {
    padding: 10px 34px 10px 12px;
    background-color: var(--bg-white);
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-base);
    font-weight: 700;
    line-height: 1.35;
    min-height: 60px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2px;
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Inline (compact) variant — used by UK and USA selectors */
.shared-dropdown-inline .shared-dropdown-selected {
    padding: 10px 28px 10px 12px;
    min-height: 0;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1.2;
    white-space: nowrap;
}

.shared-custom-dropdown .shared-dropdown-selected::after {
    content: '▼';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: var(--accent-color);
    pointer-events: none;
}

.shared-custom-dropdown.shared-dropdown-open .shared-dropdown-selected::after {
    content: '▲';
}

.shared-custom-dropdown .shared-dropdown-selected:hover,
.shared-custom-dropdown.shared-dropdown-open .shared-dropdown-selected,
.shared-custom-dropdown .shared-dropdown-selected:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(46, 125, 50, 0.3);
}

.shared-custom-dropdown .shared-dropdown-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-white);
    border: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
    z-index: 1000;
}

.shared-custom-dropdown.shared-dropdown-open .shared-dropdown-options {
    max-height: 400px;
    overflow-y: auto;
    border: 2px solid var(--accent-color);
    border-top: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.shared-custom-dropdown .shared-dropdown-option {
    padding: 10px 12px;
    font-size: var(--font-size-base);
    font-weight: 700;
    line-height: 1.3;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 2px;
    border-bottom: 1px solid var(--border-medium);
    transition: background-color 0.2s;
}

/* Inline (compact) variant options */
.shared-dropdown-inline .shared-dropdown-option {
    padding: 10px 12px;
    min-height: 0;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1.2;
    white-space: nowrap;
}

.shared-custom-dropdown .shared-dropdown-option:last-child {
    border-bottom: none;
}

.shared-custom-dropdown .shared-dropdown-option:hover {
    background-color: var(--accent-light);
}

.shared-custom-dropdown .shared-dropdown-option.shared-dropdown-opt-selected {
    background-color: var(--accent-light);
    font-weight: 600;
}

.shared-custom-dropdown .shared-dropdown-option .shared-option-title,
.shared-custom-dropdown .shared-dropdown-selected .shared-option-title {
    display: block;
    font-weight: 700;
}

.shared-dropdown-inline .shared-dropdown-option .shared-option-title,
.shared-dropdown-inline .shared-dropdown-selected .shared-option-title {
    display: inline;
}

.shared-custom-dropdown .shared-dropdown-option .shared-option-subtitle,
.shared-custom-dropdown .shared-dropdown-option .option-subtitle,
.shared-custom-dropdown .shared-dropdown-selected .shared-option-subtitle,
.shared-custom-dropdown .shared-dropdown-selected .option-subtitle {
    display: block;
    margin-top: 1px;
    font-size: var(--font-size-sm);
    font-weight: 400 !important;
    line-height: 1.2;
}

.shared-dropdown-inline .shared-dropdown-option .shared-option-subtitle,
.shared-dropdown-inline .shared-dropdown-selected .shared-option-subtitle {
    display: inline;
    margin-top: 0;
    font-weight: 400;
    font-size: var(--font-size-base);
}

/* =========================================================================
   2. SHARED DAYS WORKED / DATE INPUT CONTAINER
      Replaces:
        - taxcalculator_norway.css #daysWorkedContainer
        - taxcalculator_uk.css #ukDaysWorkedContainer
        - taxcalculator_malta.css #daysWorkedContainer
   ========================================================================= */

.shared-days-container {
    width: 95%;
    margin: 10px auto;
    background-color: var(--bg-white);
    padding: 20px;
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    box-sizing: border-box;
}

.shared-days-container > .shared-days-label {
    display: block;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.shared-days-content {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.shared-days-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 250px;
}

.shared-days-checkbox-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: var(--font-size-md);
    color: var(--text-primary);
    line-height: 1.4;
}

.shared-days-checkbox-option input[type="radio"],
.shared-days-checkbox-option input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    accent-color: var(--accent-color);
    flex-shrink: 0;
}

.shared-days-input {
    display: flex;
    gap: 10px;
    flex-direction: column;
    min-width: 100px;
    width: 10%
}

.shared-days-input.shared-days-input-row {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
}

.shared-days-date-box {
    flex-direction: column;
    width: 18%;
    min-width: 170px;
}

.shared-days-date-box input,
.shared-days-input input {
    padding: 10px;
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-md);
    font-family: var(--font-family);
    text-align: center;
    box-sizing: border-box;
}

.shared-days-date-box input:focus,
.shared-days-input input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(46, 125, 50, 0.3);
}

.shared-days-note {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.shared-days-note-stack {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    text-align: left;
}

/* =========================================================================
   3. SHARED FX RATE DISPLAY
      Replaces:
        - taxcalculator_norway.css .fxRateDisplay
        - taxcalculator_malta.css .fxRateDisplay
   ========================================================================= */

.shared-fx-display {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

.shared-fx-display.shared-fx-alert {
    color: var(--error-text);
    font-weight: 700;
}

.shared-fx-note-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 10px;
    text-align: center;
}

/* =========================================================================
   4. SHARED ADMIN WORKER VIEW TOGGLE
      Replaces:
        - taxcalculator_norway.css .admin-worker-view-toggle
        - taxcalculator_malta.css .admin-worker-view-toggle
   ========================================================================= */

.shared-admin-toggle {
    padding: 10px 20px;
    background-color: var(--bg-light);
    border-bottom: 2px solid var(--border-light);
    text-align: right;
}

.shared-admin-toggle .shared-toggle-btn {
    padding: 8px 16px;
    background-color: #2196f3;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: var(--font-size-md);
    font-weight: 600;
    transition: all 0.2s;
}

.shared-admin-toggle .shared-toggle-btn:hover {
    background-color: #1976d2;
}

.shared-admin-toggle .shared-toggle-btn.shared-toggle-external {
    background-color: #ff9800;
}

.shared-admin-toggle .shared-toggle-btn.shared-toggle-external:hover {
    background-color: #f57c00;
}

/* =========================================================================
   5. SHARED CURRENCY / COMMISSION PANEL
      Replaces:
        - taxcalculator_norway.css #currencyContainer and .advanced-commission-group
        - taxcalculator_uk.css #currencyContainer and .advanced-commission-group
   ========================================================================= */

.shared-currency-panel {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    background-color: var(--bg-light);
    padding: 20px;
    flex-shrink: 0;
}

.shared-currency-group {
    display: flex;
    flex-direction: column;
    width: 20%;
    min-width: 120px;
}

.shared-currency-group label {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-align: center;
}

.shared-currency-group select {
    padding: 10px;
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-white);
    color: var(--text-primary);
    font-size: var(--font-size-md);
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
    accent-color: var(--accent-color);
}

.shared-currency-group select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(46, 125, 50, 0.3);
}

.shared-currency-select {
    width: 25%;
    min-width: 60px;
    text-align: center;
    font-weight: bold;
}

/* Internal worker layout — 2-column grid */
.shared-currency-panel.shared-worker-grid {
    display: grid;
    width: 95% !important;
    margin: 0 auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 22px;
    row-gap: 16px;
    align-items: stretch;
    padding: 20px;
    box-sizing: border-box;
}

.shared-worker-grid .shared-currency-group {
    width: 100% !important;
    min-width: 0;
    justify-content: flex-start;
    align-items: stretch;
    background-color: var(--bg-white);
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    box-sizing: border-box;
}

/* Advanced commission selectors */
.shared-commission-panel {
    min-width: 260px;
    align-items: stretch;
    justify-content: flex-start;
}

.shared-commission-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.shared-commission-header > label {
    margin-bottom: 0;
}

.shared-commission-toggle {
    border: 1px solid var(--accent-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-white);
    color: var(--accent-color);
    font-size: var(--font-size-sm);
    font-weight: 600;
    padding: 6px 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.shared-commission-toggle:hover {
    background-color: var(--accent-color);
    color: white;
}

.shared-commission-select {
    padding: 8px;
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-md);
    font-family: var(--font-family);
}

.shared-commission-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(46, 125, 50, 0.3);
}

/* Payroll inline summary */
.shared-commission-summary {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 8px;
    gap: 8px;
    overflow-x: visible;
}

.shared-commission-summary .shared-summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-sm);
    text-align: center;
    min-width: 0;
    flex: 1 1 0;
    padding: 0;
    border: none;
    border-radius: 0;
}

.shared-commission-summary .shared-summary-commission {
    background-color: transparent;
}

/* Manual commission panel */
.shared-manual-commission {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shared-manual-commission .shared-commission-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
}

.shared-commission-field > label {
    text-align: left;
    margin-bottom: 0;
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
}



.shared-manual-commission .shared-commission-row {
    display: grid;
    grid-template-columns: minmax(90px, 1fr) auto auto;
    gap: 8px;
    align-items: center;
}

.shared-manual-commission .shared-commission-radio {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

/* Client notes & rates display */
.shared-client-notes {
    margin-top: 15px;
    padding: 10px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background-color: #f9f9f9;
}

.shared-client-notes .shared-notes-text {
    min-height: 94px;
    padding: 10px;
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-md);
    line-height: 1.4;
    color: var(--text-primary);
    background-color: var(--bg-white);
    white-space: pre-wrap;
    overflow-y: auto;
}

.shared-client-notes .shared-notes-text.shared-notes-empty {
    color: var(--text-secondary);
}

.shared-client-notes .shared-rates-date {
    margin-top: 8px;
    color: var(--text-primary);
    font-size: var(--font-size-md);
    line-height: 1.4;
}

.shared-client-notes .shared-insurance-display {
    margin-top: 8px;
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: var(--font-size-md);
    line-height: 1.4;
    color: var(--text-primary);
}

.shared-client-notes .shared-insurance-display .shared-ins-item {
    display: flex;
    gap: 5px;
    align-items: center;
}

.shared-client-notes .shared-insurance-display .shared-ins-label {
    font-weight: 600;
    color: var(--text-primary);
}

.shared-client-notes .shared-insurance-display .shared-ins-value {
    color: var(--text-secondary);
}

/* Commission settings error */
.shared-commission-error {
    min-height: 15px;
    margin-top: 4px;
    text-align: left;
}

/* Commission helper note */
.shared-helper-note {
    margin-left: 8px;
}

/* =========================================================================
   6. SHARED RATES DISPLAY TABLE + PAGINATION
      Replaces:
        - taxcalculator_norway.css .rates-display-table + .rates-pagination-display
        - taxcalculator_uk.css .rates-display-table + .rates-pagination-display
   ========================================================================= */

.shared-rates-table-wrap {
    overflow-x: auto;
}

.shared-rates-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    background-color: var(--bg-white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
}

.shared-rates-table th:nth-child(1),
.shared-rates-table td:nth-child(1) {
    width: 50%;
}

.shared-rates-table th:nth-child(5),
.shared-rates-table td:nth-child(5) {
    width: 30%;
}

.shared-rates-table th:nth-child(2),
.shared-rates-table td:nth-child(2),
.shared-rates-table th:nth-child(3),
.shared-rates-table td:nth-child(3),
.shared-rates-table th:nth-child(4),
.shared-rates-table td:nth-child(4) {
    width: calc(20% / 3);
}

.shared-rates-table thead {
    background-color: #f0f0f0;
}

.shared-rates-table th {
    padding: 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
}

.shared-rates-table td {
    padding: 8px;
    border-bottom: 1px solid #eee;
    color: var(--text-primary);
}

.shared-rates-table tbody tr:hover {
    background-color: var(--bg-light);
}

.shared-rates-table tbody tr.shared-empty-row:hover {
    background-color: transparent;
}

.shared-rates-table tbody tr.shared-empty-row td {
    height: 1em;
}

.shared-rates-pagination {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.shared-rates-pagination button {
    padding: 4px 10px;
    background-color: #2196f3;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
}

.shared-rates-pagination button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.shared-rates-pagination button:hover:not(:disabled) {
    background-color: #1976d2;
}

.shared-rates-pagination .shared-page-indicator {
    font-size: 11px;
    color: #666;
    padding: 0 5px;
}

.shared-rates-empty {
    font-size: var(--font-size-md);
    color: var(--text-secondary);
    line-height: 1.4;
    padding: 4px 0 0;
}

/* =========================================================================
   7. SHARED BREAKDOWN TABLE
      Replaces:
        - taxcalculator_norway.css .norway-breakdown-table
        - taxcalculator_uk.css .uk-month-breakdown-table
   ========================================================================= */

.shared-breakdown-container {
    overflow-x: auto;
    padding: 10px 0px;
}

.shared-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-md);
}

.shared-breakdown-table th,
.shared-breakdown-table td {
    padding: 7px 10px;
    text-align: right;
    border: 1px solid var(--border-light);
    white-space: nowrap;
}

.shared-breakdown-table th:first-child,
.shared-breakdown-table td:first-child {
    text-align: left;
}

.shared-breakdown-table thead th {
    background-color: var(--accent-color);
    color: var(--bg-white);
    font-weight: 700;
}

.shared-breakdown-table tbody tr:nth-child(even) {
    background-color: var(--bg-light);
}

.shared-breakdown-table .shared-total-row td {
    font-weight: 700;
    background-color: var(--accent-light);
    border-top: 2px solid var(--accent-color);
}

/* =========================================================================
   8. SHARED CALCULATION BOXES (Chargeable / Gross / Net)
      Replaces:
        - shared-styles.css .calcBox / .calcBox input / .calcBox.inputBox
        - taxcalculator_norway.css .calcBox overrides
   ========================================================================= */

.shared-calc-boxes {
    display: flex;
    gap: 25px;
    flex-wrap: nowrap;
    justify-content: center;
}

.shared-calc-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.shared-calc-box label {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.shared-calc-box input {
    width: 100%;
    padding: 8px;
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-family: var(--font-family);
    text-align: center;
}

.shared-calc-box input:focus {
    outline: none;
    border-color: #a01447;
    box-shadow: 0 0 5px rgba(217, 30, 99, 0.3);
}

.shared-calc-box input[type="number"]::-webkit-outer-spin-button,
.shared-calc-box input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.shared-calc-box input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

/* Editable (input) box — yellow background */
.shared-calc-box.shared-box-input input {
    background-color: var(--warning-bg);
    border-color: var(--warning-border);
}

.shared-calc-box.shared-box-input input:focus {
    border-color: var(--warning-border);
    box-shadow: 0 0 5px rgba(245, 127, 23, 0.3);
}

.shared-calc-box.shared-box-input input.shared-fixed-point {
    background-color: #b9f6ca;
    border-color: var(--accent-color);
}

.shared-calc-box.shared-box-input input.shared-fixed-point:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(46, 125, 50, 0.35);
}

/* Readonly (calculated) box */
.shared-calc-box input[readonly] {
    background-color: #e8e8e8;
    color: #666;
    cursor: not-allowed;
}

.shared-calc-box.shared-box-input:hover input {
    border-color: var(--accent-color);
}

/* =========================================================================
   9. SHARED ADDITIONAL INFO SECTION
      Replaces: Duplicated HTML in norway.html, uk.html, usa.html
   ========================================================================= */

.shared-info-section {
    background-color: var(--bg-white);
    padding: 20px;
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    width: 95%;
    margin: 10px auto;
    box-sizing: border-box;
}

.shared-info-label {
    display: inline-block;
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    white-space: nowrap;
}

.shared-info-section .shared-info-fields {
    display: flex;
    flex-direction: row;
    gap: 15px;
    justify-content: center;
}

.shared-info-section .shared-info-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.shared-info-section .shared-info-field label {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
}

.shared-info-section .shared-info-field input[type="text"] {
    padding: 10px;
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-sm);
    font-size: var(--font-size-md);
    font-family: var(--font-family);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.shared-info-section .shared-info-field input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 5px rgba(46, 125, 50, 0.3);
}

.shared-info-section .shared-info-field input[type="text"]:hover {
    border-color: var(--accent-color);
}

/* =========================================================================
   10. SHARED CALCULATION CONTAINER
       Replaces: shared-styles.css .calculation-container + norway #calculationContainer
   ========================================================================= */

.shared-calc-container {
    width: 95%;
    margin: 10px auto;
    background-color: var(--bg-white);
    padding: 20px;
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-sm);
    box-sizing: border-box;
}

.shared-calc-container > .shared-calc-hint {
    display: block;
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    line-height: 1.4;
}

.shared-calc-container > .shared-calc-hint.shared-hint-alert {
    color: var(--error-text);
    font-size: var(--font-size-sm);
    font-weight: 700;
}

.shared-calc-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
}

.shared-calc-title {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-color);
}

.shared-percent-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.shared-percent-btn {
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-sm);
    background-color: var(--bg-light);
    color: var(--text-primary);
    padding: 6px 10px;
    font-size: var(--font-size-sm);
    font-weight: 700;
    font-family: var(--font-family);
    cursor: pointer;
}

.shared-percent-btn.shared-percent-active {
    background-color: var(--accent-light);
}

.shared-percent-btn:hover {
    border-color: #1b5e20;
}

/* =========================================================================
   11. SHARED GENERATE REPORT BUTTON
       Replaces:
        - taxcalculator_norway.css #generateReportBtn
        - taxcalculator_uk.css #generateUkReportBtn / .uk-generate-btn
        - taxcalculator_malta.html inline style (generateMaltaReportBtn)
        - taxcalculator_usa.html inline style (usaGenerateReportBtn)
   ========================================================================= */

.shared-generate-btn {
    padding: 12px 20px;
    background-color: #387c2b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.2s, background-color 0.2s;
}

.shared-generate-btn:hover {
    opacity: 0.9;
    background-color: #2d5a1f;
}

.shared-generate-btn:disabled {
    opacity: 0.75;
    cursor: not-allowed;
}


/* =========================================================================
   MOBILE RESPONSIVE — Shared media queries
   ========================================================================= */

@media (max-width: 768px) {
    /* Days container */
    .shared-days-content {
        flex-direction: column;
        gap: 15px;
    }

    /* Currency panel */
    .shared-currency-panel {
        flex-direction: column;
        padding: 15px;
        gap: 15px;
    }

    .shared-currency-panel .shared-currency-group {
        width: 100%;
        min-width: unset;
    }

    .shared-currency-panel.shared-worker-grid {
        grid-template-columns: 1fr;
    }

    .shared-worker-grid .shared-currency-group > label {
        text-align: center;
    }

    /* Commission panel */
    .shared-commission-panel {
        width: 100% !important;
        min-width: unset;
    }

    .shared-manual-commission .shared-commission-row {
        grid-template-columns: 1fr;
    }

    /* Custom dropdown */
    .shared-custom-dropdown .shared-dropdown-selected {
        font-size: var(--font-size-md);
        padding: 10px 12px;
        min-height: 40px;
    }

    .shared-custom-dropdown .shared-dropdown-option {
        font-size: var(--font-size-md);
        padding: 12px;
        min-height: 40px;
    }

    .shared-dropdown-inline .shared-dropdown-selected {
        font-size: var(--font-size-md);
        min-height: 0;
    }

    /* Calc boxes */
    .shared-calc-boxes {
        flex-wrap: wrap;
        gap: 12px;
    }

    .shared-calc-box {
        flex: 0 0 100%;
        min-width: unset;
    }

    .shared-calc-box label {
        font-size: var(--font-size-base);
    }

    .shared-calc-box input {
        font-size: 16px;
        padding: 12px;
    }

    /* Calc container */
    .shared-calc-container {
        padding: 15px;
    }

    .shared-calc-header {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 15px;
    }

    /* Info section */
    .shared-info-section {
        padding: 15px;
    }

    .shared-info-section .shared-info-fields {
        gap: 12px;
    }

    .shared-fx-note-container {
        flex-direction: column;
        gap: 10px;
        justify-content: center;
        align-items: center;
        text-align: center;
    }

    /* Breakdown table */
    .shared-breakdown-table {
        font-size: var(--font-size-sm);
    }

    .shared-breakdown-table th,
    .shared-breakdown-table td {
        padding: 6px 4px;
        white-space: normal;
    }
}

/* Larger mobile / small tablet */
@media (max-width: 900px) {
    .shared-commission-summary {
        width: 100%;
    }
}