
.loader {
  border: 6px solid #f3f3f3;
  border-top: 6px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
  box-shadow: 0 0 8px #3498db88;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

body {
  font-size: 15px;
  color: #333;
  background-color: #fafafa;
}

.header-bar {
    background-color: #0078D4;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header-left {
    font-weight: bold;
    font-size: 16px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px; /* space between toggle, welcome text, and logout */
}


.header-right button {
    background-color: #005A9E;
    color: white;
    border: none;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.header-right button:hover {
    background-color: #003E73;
}

.header-bar a {
    color: #FFEB3B;
    text-decoration: none;
}

.header-bar a:hover {
    text-decoration: underline;
}


.styled-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-top: 20px;
    color: #333;
}

.styled-table th,
.styled-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.styled-table th {
    background: linear-gradient(to right, #f5f7fa, #e4ebf5);
    color: #333;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.styled-table tr:hover {
    background-color: #f9f9f9;
}

.badge-active,
.badge-inactive {
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 13px;
    display: inline-block;
    font-weight: bold;
}

.badge-overdue {
    background-color: #fff8e1; /* light yellow */
    color: #f57f17;            /* dark amber */
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: bold;
}


.showDueClientsMonthly {
    background-color: #fff8e1; /* light yellow */
    color: #f57f17;            /* dark amber */
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: bold;
}

.badge-active {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.badge-inactive {
    background-color: #ffebee;
    color: #c62828;
}

.styled-table a {
    color: #0078D4;
    text-decoration: none;
}

.styled-table a:hover {
    text-decoration: underline;
}

.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination a {
    padding: 6px 12px;
    margin: 0 3px;
    background: #0078D4;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.pagination a:hover,
.pagination a[style*="font-weight:bold"] {
    background: #005fa3;
}

/*add new client button*/
.add-client-container {
    margin: 15px 0;
    text-align: left;
}

.add-client-btn {
    background-color: #28a745;
    color: white;
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.add-client-btn:hover {
    background-color: #218838;
}

/*summary*/
.summary-card {
    background-color: #f9f9f9;
    padding: 20px 25px;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    font-family: 'Segoe UI', sans-serif;
    max-width: 400px;
}

.summary-card h3 {
    margin-bottom: 20px;
    color: #333;
}

.summary-item {
    margin-bottom: 12px;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
}

.summary-item span {
    font-weight: 600;
    color: #555;
}

.summary-item a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
}

.summary-item a:hover {
    text-decoration: underline;
}

/*Filters*/
.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    background-color: #f9f9f9;
    padding: 20px 25px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    font-family: 'Segoe UI', sans-serif;
    margin-bottom: 30px;
    align-items: flex-end;
    max-width: 500px;
}

.filter-form label {
    display: flex;
    flex-direction: column;
    font-size: 14px;
    color: #555;
    flex: 1;
    min-width: 120px;
}

.filter-form input[type="text"],
.filter-form input[type="date"] {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    margin-top: 4px;
}

.filter-form button {
    padding: 10px 16px;
    background-color: #007bff;
    color: white;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    font-weight: 500;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.filter-form button:hover {
    background-color: #0056b3;
}

@media (max-width: 500px) {
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Dark Mode */
:root {
	--blue-main: #0078D4;
	--blue-hover: #005fa3;
	--gray-bg: #f9f9f9;
    --bg-light: #ffffff;
    --bg-dark: #1e1e1e;
    --text-light: #333;
    --text-dark: #f0f0f0;
    --border-light: #ccc;
    --border-dark: #444;
    --primary: #28a745;
    --cancel: #888;
    --shadow: rgba(0, 0, 0, 0.2);
}

body {
    transition: background 0.3s, color 0.3s;
    background-color: var(--blue-main);
    color: var(--text-light);
}

body.dark-mode {
    background-color: var(--bg-dark);
    color: var(--text-dark);
}


/* Modal Base */
.modal {
    display: none;
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    background: var(--bg-light);
    padding: 25px 30px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 20px var(--shadow);
    z-index: 1000;
    overflow-y: auto;
    max-height: 80vh;
    transition: all 0.3s ease-in-out;
}


body.dark-mode .modal {
    background: var(--bg-dark);
    border: 1px solid var(--border-dark);
}

/* Modal Content */
.modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
}

.modal form input,
.modal form select {
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 15px;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 14px;
    background-color: #f9f9f9;
    color: var(--text-light);
    transition: background 0.3s, color 0.3s;
}

body.dark-mode .modal form input,
body.dark-mode .modal form select {
    background-color: #2c2c2c;
    border-color: var(--border-dark);
    color: var(--text-dark);
}


/* Buttons */
.modal button {
    padding: 10px 16px;
    margin-right: 10px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.modal button[type="submit"] {
    background-color: var(--primary);
    color: white;
}

.modal button[type="button"],
.modal button:not([type]) {
    background-color: var(--cancel);
    color: white;
}


/* === LIGHT MODE (DEFAULT) === */
body {
    background-color: #ffffff;
    color: #222222;
    font-family: Arial, sans-serif;
}

/* Header styles for light mode */
.header-bar {
    background-color: #f0f0f0;
    color: #222222;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
}

.header-left,
.header-right,
.header-right a,
.welcome-text,
#darkModeToggle {
    color: #222222;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-right a {
    text-decoration: none;
    font-weight: bold;
}

/* Dark Mode Toggle in light mode */
#darkModeToggle {
    background-color: #eee;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

/* === DARK MODE === */
body.dark-mode {
    background-color: #121212;
    color: #ffffff;
}

/* Form elements in dark mode */
body.dark-mode input,
body.dark-mode button,
body.dark-mode select,
body.dark-mode textarea {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
}

/* Header in dark mode */
body.dark-mode .header-bar {
    background-color: #1e1e1e;
    color: #ffffff;
}

body.dark-mode .header-left,
body.dark-mode .header-right,
body.dark-mode .header-right a,
body.dark-mode .welcome-text,
body.dark-mode #darkModeToggle {
    color: #ffffff;
}

/* Dark Mode Toggle in dark mode */
body.dark-mode #darkModeToggle {
    background-color: #444;
}


/* Toggle button — inline, not fixed */
#darkModeToggle {
    background: #eee;
    color: #333;
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .modal {
        padding: 20px;
        width: 95%;
        font-size: 14px;
    }

    #darkModeToggle {
        font-size: 12px;
        padding: 6px 10px;
    }
}




/* === Toast Style === */
#toast {
    visibility: hidden;
    min-width: 220px;
    background-color: #222;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 12px 16px;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

/*login page*/
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 20px;
    border-radius: 8px;
    background-color: #fafafa;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

body.dark-mode .login-container {
    background-color: #1e1e1e;
}

.login-form input,
.login-form button {
    width: 100%;
    margin-bottom: 10px;
    padding: 10px;
    box-sizing: border-box;
}

.error-text {
    color: red;
    font-weight: bold;
}

.app-title {
    text-align: center;
    font-size: 20px;
    margin-bottom: 15px;
    font-weight: bold;
    color: #222;
}

body.dark-mode .app-title {
    color: #fff;
}


/* === CLIENTS DUE TABLE STYLING === */
.client-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.client-table th,
.client-table td {
    padding: 10px;
    text-align: left;
    border: 1px solid #ccc;
}

.client-table th {
    background-color: #f4f4f4;
    font-weight: bold;
    color: #222;
}

.client-table tr:nth-child(even) {
    background-color: #fafafa;
}

.client-table tr:hover {
    background-color: #f0f0f0;
    cursor: default;
}

/* === SEARCH FORM === */
#dueSearchForm {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

#dueSearchForm input[type="text"] {
    padding: 6px;
    font-size: 14px;
}

#dueSearchForm button {
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
}

/* === PAGINATION LINKS === */
.due-page-link {
    text-decoration: none;
    color: #333;
}

.due-page-link:hover {
    text-decoration: underline;
}

/* === DARK MODE SUPPORT === */
body.dark-mode .client-table {
    border-color: #444;
}

body.dark-mode .client-table th {
    background-color: #222;
    color: #fff;
}

body.dark-mode .client-table td {
    background-color: #1e1e1e;
    color: #ccc;
}

body.dark-mode .client-table tr:nth-child(even) {
    background-color: #2a2a2a;
}

body.dark-mode .client-table tr:hover {
    background-color: #333;
}

body.dark-mode #dueSearchForm input,
body.dark-mode #dueSearchForm button {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
}

body.dark-mode .due-page-link {
    color: #ccc;
}

/*payments_total*/
.payment-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.payment-table th,
.payment-table td {
    padding: 10px;
    text-align: left;
    border: 1px solid #ccc;
}

.payment-table th {
    background-color: #f4f4f4;
    font-weight: bold;
    color: #222;
}

.payment-table tr:nth-child(even) {
    background-color: #fafafa;
}

.payment-table tr:hover {
    background-color: #f0f0f0;
    cursor: default;
}

body.dark-mode .payment-table {
    border-color: #444;
}

body.dark-mode .payment-table th {
    background-color: #222;
    color: #fff;
}

body.dark-mode .payment-table td {
    background-color: #1e1e1e;
    color: #ccc;
}

body.dark-mode .payment-table tr:nth-child(even) {
    background-color: #2a2a2a;
}

body.dark-mode .payment-table tr:hover {
    background-color: #333;
}

#paidSearchForm {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

#paidSearchForm input[type="text"] {
    padding: 6px;
    font-size: 14px;
}

#paidSearchForm button {
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
}

body.dark-mode #paidSearchForm input,
body.dark-mode #paidSearchForm button {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
}

.pagination-controls {
    margin-top: 10px;
    text-align: center;
}

.paid-page-link {
    margin: 0 5px;
    text-decoration: none;
    color: #333;
}

.paid-page-link.active {
    font-weight: bold;
    color: blue;
}

.paid-page-link:hover {
    text-decoration: underline;
}

body.dark-mode .paid-page-link {
    color: #ccc;
}


/*clients Active*/
.active-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.active-table th,
.active-table td {
    padding: 10px;
    text-align: left;
    border: 1px solid #ccc;
}

.active-table th {
    background-color: #f4f4f4;
    font-weight: bold;
    color: #222;
}

.active-table tr:nth-child(even) {
    background-color: #fafafa;
}

.active-table tr:hover {
    background-color: #f0f0f0;
    cursor: default;
}

/* Dark Mode */
body.dark-mode .active-table {
    border-color: #444;
}

body.dark-mode .active-table th {
    background-color: #222;
    color: #fff;
}

body.dark-mode .active-table td {
    background-color: #1e1e1e;
    color: #ccc;
}

body.dark-mode .active-table tr:nth-child(even) {
    background-color: #2a2a2a;
}

body.dark-mode .active-table tr:hover {
    background-color: #333;
}

#activeSearchForm {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

#activeSearchForm input[type="text"] {
    padding: 6px;
    font-size: 14px;
}

#activeSearchForm button {
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
}

body.dark-mode #activeSearchForm input,
body.dark-mode #activeSearchForm button {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
}

.active-page-link {
    margin: 0 5px;
    text-decoration: none;
    color: #333;
}

.active-page-link.active {
    font-weight: bold;
    color: blue;
}

.active-page-link:hover {
    text-decoration: underline;
}

body.dark-mode .active-page-link {
    color: #ccc;
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: var(--bg-dark);
    color: var(--text-dark);
  }
}
button:focus, input:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}


/*Clients Inactive*/
.inactive-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.inactive-table th,
.inactive-table td {
    padding: 10px;
    text-align: left;
    border: 1px solid #ccc;
}

.inactive-table th {
    background-color: #f4f4f4;
    font-weight: bold;
    color: #222;
}

.inactive-table tr:nth-child(even) {
    background-color: #fafafa;
}

.inactive-table tr:hover {
    background-color: #f0f0f0;
    cursor: default;
}

/* Dark mode styling */
body.dark-mode .inactive-table {
    border-color: #444;
}

body.dark-mode .inactive-table th {
    background-color: #222;
    color: #fff;
}

body.dark-mode .inactive-table td {
    background-color: #1e1e1e;
    color: #ccc;
}

body.dark-mode .inactive-table tr:nth-child(even) {
    background-color: #2a2a2a;
}

body.dark-mode .inactive-table tr:hover {
    background-color: #333;
}

#inactiveSearchForm {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

#inactiveSearchForm input[type="text"] {
    padding: 6px;
    font-size: 14px;
}

#inactiveSearchForm button {
    padding: 6px 12px;
    font-size: 14px;
    cursor: pointer;
}

body.dark-mode #inactiveSearchForm input,
body.dark-mode #inactiveSearchForm button {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
}

.inactive-page-link {
    margin: 0 5px;
    text-decoration: none;
    color: #333;
}

.inactive-page-link.active {
    font-weight: bold;
    color: blue;
}

.inactive-page-link:hover {
    text-decoration: underline;
}

body.dark-mode .inactive-page-link {
    color: #ccc;
}



/*summary graph position beside*/
.summary-container {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 20px;
}

.summary-card {
    flex: 1;
    max-width: 400px;
}

#summaryChart {
    max-width: 400px;
    max-height: 250px;
    width: 100%;
    height: auto;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-sizing: border-box;
}


@media (max-width: 768px) {
    .summary-container {
        flex-direction: column;
        align-items: center;
    }

    #summaryChart, .summary-card {
        max-width: 100%;
    }
}

/*Pie Chart*/
#statusPieChart {
    max-width: 400px;
    max-height: 250px;
    width: 100%;
    height: auto;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-sizing: border-box;
}


/*clients due inactive*/
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
}

.client-table {
    width: 100%;
    border-collapse: collapse;
}

.client-table th,
.client-table td {
    padding: 8px;
    border: 1px solid #ddd;
    font-size: 14px;
    white-space: nowrap;
}

/* Highlight inactive status */
.status-inactive {
    color: red;
    font-weight: bold;
}

.status-active {
    color: green;
}

/* Mobile adjustments */
@media screen and (max-width: 768px) {
    .client-table th,
    .client-table td {
        font-size: 12px;
        padding: 6px;
    }

    #dueSearchForm input[type="text"],
    #dueSearchForm button {
        width: 100%;
        box-sizing: border-box;
        margin-bottom: 10px;
    }

    .due-page-link {
        display: inline-block;
        margin: 4px 6px;
    }
}

.login-form img.logo {
    display: block;
    margin: 0 auto 10px auto;
    height: 80px;
    object-fit: contain;
}

/*index.php logo*/ 
.yourlogo {
    display: block;
    margin: 0 auto 10px auto;
    height: 40px;
    object-fit: contain;
}


.features-link {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 16px;
    background-color: #e3f2fd;
    color: #007bff;
    font-weight: 500;
    font-size: 14px;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.15);
}

/* Center using the container form */
.login-form .features-link {
    display: block;
    text-align: center;
}
.features-link:hover {
    background-color: #d0e8ff;
    color: #0056b3;
    text-decoration: none;
}

body.dark-mode .features-link {
    background-color: #2c3e50;
    color: #7dcfff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.25);
}

body.dark-mode .features-link:hover {
    background-color: #34495e;
    color: #a9dcff;
}
