header {display: block;  padding: 50px; border-bottom: 5px rgba(255,255,255,0.5);}
h1, h2, h3 {
    font-weight: normal; 
    color: brown; 
    margin-left: 10%; 
    margin-right: 10%;
    text-align: center;
    padding: 1em;
    background-color: rgb(255,255,255); background-color: rgba(255,255,255, 0.6);
}
h1 {padding:0.5em;}
/* Links for events etc */
a {color:brown; text-decoration:none;}
a:hover {
    font-weight:bold;
}

nav {background-color: rgb(255,255,255); background-color: rgba(255,255,255, 0.6);
}
nav a:hover {color: #ddd;}
/* --- Navigation Container ------------------------------------ */
nav {
    width: 100%;
    border-bottom: 1px solid #ccc;
    position: relative;        /* allows submenus to anchor properly */
    z-index: 1000;
}

/* --- Top-level menu ------------------------------------------- */
nav > ul {
    display: flex;             /* ensures one row that NEVER grows taller */
    margin: 0;
    padding: 0;
    list-style: none;
    height: 60px;              /* fixed height of the menu bar */
    align-items: center;
}

/* Top-level items */
nav > ul > li {
    position: relative;        /* required so submenu can be absolute */
    width: 170px;
    text-align: center;
    padding: 1em 0;            /* vertical alignment */
}

/* Links */
nav a {
    text-decoration: none;
    color: brown;
    display: block;            /* makes hovering easier */
}

/* --- Submenus -------------------------------------------------- */
nav ul ul {
    display: none;             /* hidden by default */
    position: absolute;        /* removes submenu from flex-flow height */
    top: 60px;                 /* EXACTLY below top menu */
    left: 0;                   /* align left edge with parent <li> */
    list-style: none;
    margin: 0;
    padding: 0;
    width: 170px;              /* same width as parent item */
    border: 1px solid #ccc;
    z-index: 2000;
}

/* Submenu items */
nav ul ul li {
    padding: 0.7em 1em;
    white-space: nowrap;
    width: 170px;
}

/* Show submenu on hover */
nav > ul > li:hover > ul {
    display: block;
}

/* --- Multi-level submenus (if needed) -------------------------- */
nav ul ul ul {
    top: 0;
    left: 170px;               /* position to the right */
    border: 1px solid #ccc;
}

nav ul ul ul li {
    width: 170px;
}

body {
    font-size: 1.2em; 
    font-family: "Calibri (Detail)",Calibri, sans-serif; 
    background-image: url('images/background.jpeg');
    height: 100%;
    background-position: center;
    background-repeat: repeat;
    background-size: 100%;
}

.img-resize img {
    width: 25px;
    height: 25px;
}

.img-resize-disable img {
    width: 25px;
    height: 25px;
    opacity: 0.5;
}

.img-resize {
    background-color: transparent;
    margin-left: 50px;
    border: none;
    /* cursor: pointer; */
}

.img-resize-disable {
    background-color: transparent;
    margin-left: 50px;
    border: none;
    /* cursor: pointer; */
}

.img-resize  img:hover {
    width: 27px;
    height: 27px;
    margin-left: -2px;
}

.alignleft {
    text-align: left;
    margin-left: auto;
    margin-right: auto;
    padding-left: 15px;
    padding-right: 15px;
}

.bg {
    /* this is used to create the standard brown on white type*/
    background-color: rgba(255,255,255,0.6);
    color: brown;
    margin-left: 10%;
    margin-right: 10%;
    padding: 20px;
}

table {
    border: 2px white;
    border-collapse: collapse;
    color: brown;
    font-family: "Calibri (Detail)",Calibri,sans-serif;
    background-color: rgba(255,255,255,0.6);
}
td {
    position: relative;
    overflow: visible;
    z-index: 10;
}

td, th {
    border-collapse: collapse;
    color: brown;
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 5px;
    padding-bottom: 5px;
    vertical-align:middle;
}

label, select, textarea {
    margin-top: 0.5em; 
    padding: 0.2em; 
    background-color:transparent; 
    color: brown; 
    font-family: inherit; 
    font-size:inherit;
    border-color: white;
}

label {
    display: inline-block;
    width: 100px;
}


/* class for input field on edit form */
.inputEdit {
    color: brown;
    background-color: transparent;
    margin-top: 0.5em;
    font-size: inherit;
    font-family: inherit;
    border-color: white;
}
/* class for wrapper to keep everything in a row */
.row {
    display: flex;
    align-items: center;
    gap: 10px; /* spacing between elements */
    
}

.row label {
    width: 100px; /* keeps everything aligned with the date inputs */
}

.tooltip {
    position: relative;
    display: inline-block;
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tooltip .tooltip-content {
    display: none;
    position: absolute;
    background: #fff;
    border: 1px solid #ccc;
    padding: 8px;
    white-space: normal;
    z-index: 9999;
    width: 300px;
    top: 100%;
    left: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.tooltip:hover .tooltip-content {
    display: block;
}

.truncate {
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: top;
}

#transactions td:nth-child(1) { text-align: left; }   /* Date */
#transactions td:nth-child(2) { text-align: left; }   /* Description */
#transactions td:nth-child(3) { text-align: right; }  /* Debit */
#transactions td:nth-child(4) { text-align: right; }  /* Credit */
#transactions td:nth-child(5) { text-align: right; }  /* Balance */

table.import-review {
    width: 100%;
    border-collapse: collapse;
}

.import-review th,
.import-review td {
    padding: 6px 8px;
    border-bottom: 1px solid #ddd;
}

.import-review td.amount,
.import-review th.amount {
    text-align: right;
    white-space: nowrap;
}
.import-review .note {
   background-color:transparent; 
    border-color: white;
    color: brown;
    font-family: inherit;
    font-size: inherit;
    padding: 5px;
    box-sizing: border-box;
}
.import-review input[type="text"],
.import-review select {
    width: 100%;
}
.import-review td.amount input {
    text-align: right;
    width: 100%;
    color: brown;
    border-color: white;
    font-family: inherit;
    font-size: inherit;
    padding: 5px;
    box-sizing: border-box;
    background-color: transparent;
}
.import-review td.note input,
.import-review td.note textarea {
    width: 100%;
    background-color: transparent;
    border-color: white;
    color: brown;
    font-family: inherit;
    font-size: inherit;
    padding: 5px;
    box-sizing: border-box;
}.error {
    color:red;
    cursor: help;
    visibility: hidden;
}
/* backdrop */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

/* dialog */
.modal > * {
    background-color: rgba(255,255,255,0.6);
    padding: 2rem 2.5rem;
    border-radius: 10px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    text-align: center;
}
.modal-content {
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    font-size: 1.6rem;
    text-decoration: none;
    color: #fff;
}

.modal-close:hover {
    color: brown;
}
.input-wrapper {
    display: inline-flex;          /* key line */
    align-items: center;           /* vertical alignment */
    gap: 0.3rem;                   /* space between select and star */
}

.input-wrapper .error {
    color: red;
    font-weight: bold;
}
button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.state-none {color: brown;}
.state-owed     { color: #d97706; }
.state-paid     { color: #2563eb; }
.state-received { color: #16a34a; }
.split-none {color: darkblue;}
.split-done {color: orange;}
.confirm-split {color: green;}
.end-split {color: red;}
.add-line {color: green;}
.remove-line {color: red;}


.icon-button {
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.icon {
    width: 24px;
    height: 24px;
    position: relative;
    top: 3px;
    stroke: currentColor;
    fill: currentColor;
}

.repayment-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
}

.repayment-toggle:hover {
    opacity: 0.7;
}

.repayment-modal {
    background: rgba(255,255,255,0.8);
    border: 1px solid #ccc;
    padding: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
}

.repayment-option {
    display: block;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
}

.repayment-option.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
.message-modal {
    position: absolute;
    overflow-y: auto;
    overflow-x: auto;
    max-height: 60vh;
    width:auto;
    z-index: 9999;
    transition: opacity 0.6s ease;
}

.message-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.message-box {
    background: rgba(255,255,255,0.8);      /* pale amber #fef3c7 */
    border: 1px solid brown;
    color: #92400e;
    padding: 12px 18px;
    border-radius: 10px;
    min-width: 500px;     
    max-width: 90vw;    
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
    position: relative;
}

.message-close {
    position: absolute;
    top: 4px;
    right: 6px;
    border: none;
    background: none;
    font-size: 14px;
    cursor: pointer;
    color: #92400e;
}

.message-close:hover {
    color: #451a03;
}

.hidden {
    display: none;
}
.link-results-table {
    table-layout: fixed;
    width: 100%;
    border-collapse: collapse;
}

.link-results-table tr.selected {
    background-color: #e0f2fe; /* light blue */
}

.link-results-table tr:hover {
    background-color: #f1f5f9;
    cursor: pointer;
}

.linked {
    background-color: rgba(100,255,100,0.2);
}

.unlinked {
    background-color: rgba(0,255,255,0.2);
}

.link-results-table td,
.link-results-table th {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;   /* or remove this if you want wrapping */
}

/* normal rows */
tr {
  transition: opacity 0.2s;
}

/* dimmed rows */
tr.dimmed {
  opacity: 0.3;
  pointer-events: none;   /* makes them unclickable */
  user-select: none;
}

/* active split rows */
tr.split-active {
  background-color: #fffbe6; /* subtle highlight */
  opacity: 1;
  pointer-events: auto;
}
tr.split-parent {
  background-color: #ffe29d; /* subtle highlight */
  opacity: 1;
  pointer-events: auto;
}
