/* Import Google Font - Rubik */
@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');

/* Import Google Font - Rubik */
@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');

/* ========================================= */
/* COLOR PALETTE - CSS CUSTOM PROPERTIES */
/* ========================================= */

:root {
    /* Font Families */
    --font-primary: 'Rubik', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-fallback: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    
    /* Primary Colors */
    --primary-blue: #2a2b2c;
    --primary-dark: #252728;
    --primary-navy: #333334;
    --primary-light: #3498db;
    --primary-hover: #2980b9;
    
    /* Background Colors */
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --bg-dark: #2c3e50;
    --bg-gray: #f8f9fa;
    --bg-dropdown: #2a2b2c;
    
    /* Text Colors */
    --text-dark: #333;
    --text-light: #ffffff;
    --text-muted: #2c3e50;
    --text-secondary: #6c757d;
    
    /* Status Colors */
    --success-green: #27ae60;
    --success-hover: #229954;
    --success-light: #d4edda;
    --success-text: #155724;
    --danger-red: #e74c3c;
    --danger-hover: #c0392b;
    --danger-light: #f8d7da;
    --warning-yellow: #ffc107;
    --info-blue: #17a2b8;
    --neutral-gray: #95a5a6;
    --neutral-hover: #7f8c8d;
    
    /* Border Colors */
    --border-light: #ddd;
    --border-gray: #eee;
    --border-focus: #3498db;
    --border-error: #e74c3c;
    
    /* Shadow Colors */
    --shadow-light: rgba(0,0,0,0.05);
    --shadow-medium: rgba(0,0,0,0.1);
    --shadow-dark: rgba(0,0,0,0.2);
    --shadow-focus: rgba(52, 152, 219, 0.2);
    
    /* Gradient Colors */
    --gradient-purple: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-primary: linear-gradient(135deg, #2a2b2c 0%, #3498db 100%);
    
    /* Table Colors */
    --table-header: #f8f9fa;
    --table-border: #ddd;
    --table-hover: #f8f9fa;
    --table-stripe: #f9f9f9;
    --table-accent: #3498db;
}

/* ×ž×¢×¨×›×ª ×—×™×•×'×™× - Billing System Styles */

/* ========================================= */
/* GLOBAL STYLES */
/* ========================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Apply Rubik font to all elements */
html, body, * {
    font-family: var(--font-primary);
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    direction: rtl;
    text-align: right;
}

.container {
    max-width: 95%;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* ========================================= */
/* HEADER AND NAVIGATION STYLES */
/* ========================================= */

/* Header Styles */
.header-container {
    max-width: 95%;
    margin: 0 auto;
    width: 100%;
}

/* Sticky Header Wrapper */
.sticky-header-wrapper {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: transparent;
}

.main-header {
    background-color: var(--primary-dark);
    color: var(--text-light);
    padding: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px var(--shadow-medium);
}

.main-header-content {
    max-width: calc(95% - 40px);
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-section img {
    height: 30px;
    width: auto;
}

.title-section {
    text-align: left;
    flex-grow: 1;
}

.title-section h1 {
    font-size: 28px;
    font-weight: 600;
    margin: 0;
    color: white;
}

/* Navigation Bar */
.nav-bar {
    background-color: var(--primary-navy);
    padding: 8px 0;
    box-shadow: 0 2px 4px var(--shadow-light);
}

.nav-bar-content {
    max-width: calc(95% - 40px);
    margin: 0 auto;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.nav-links {
    display: flex;
    gap: 25px;
    list-style: none;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    color: var(--text-light);
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-links a:hover {
    background-color: var(--primary-blue);
    transform: translateY(-1px);
}

.nav-links a.active {
    background-color: var(--primary-blue);
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
    transition: all 0.1s ease;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--bg-dropdown);
    min-width: 180px;
    box-shadow: 0px 8px 16px 0px var(--shadow-dark);
    z-index: 1000;
    border-radius: 4px;
    margin-top: 2px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.dropdown-content a {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    border-radius: 0;
    margin: 0;
}

.dropdown-content a:first-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.dropdown-content a:last-child {
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}

.dropdown-content a:hover {
    background-color: var(--primary-blue);
    transform: none;
}

.dropdown:hover .dropdown-content,
.dropdown-content:hover {
    display: block;
    opacity: 1;
    visibility: visible;
}

.dropdown:hover .dropdown-content {
    transition-delay: 0.1s;
}

.dropdown > a::after {
    content: ' ▼';
    font-size: 10px;
    margin-right: 5px;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-light);
}

.user-name {
    font-weight: 500;
}

.logout-btn {
    color: var(--text-light);
    text-decoration: none;
    padding: 8px 15px;
    border: 1px solid var(--primary-blue);
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.logout-btn img {
    background: none;
    border: none;
    padding: 0;
    width: 24px;
    height: 24px;
    display: block;
}

.logout-btn:has(img) {
    background: none;
    border: none;
    padding: 4px;
}

.logout-btn:hover {
    background-color: var(--primary-blue);
    transform: translateY(-1px);
}

.logout-btn:has(img):hover {
    background: none;
    transform: none;
}

/* Legacy Header (for compatibility) */
.header {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logout-btn {
    background-color: var(--danger-red);
    color: var(--text-light);
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
}

.logout-btn:hover {
    background-color: var(--danger-hover);
}

/* Navigation */
.nav {
    background-color: var(--bg-white);
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px var(--shadow-medium);
}

.nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav a:hover,
.nav a.active {
    background-color: var(--primary-light);
    color: var(--text-light);
}

/* Login Form */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--gradient-purple);
}

.login-form {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px var(--shadow-medium);
    width: 100%;
    max-width: 400px;
}

.login-form h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

/* Metronic input styling */
.input {
    width: 100%;
    max-width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

/* Disable browser autocomplete styling */
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-white) inset !important;
    -webkit-text-fill-color: var(--text-dark) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Disable browser autocomplete styling for input class */
.input:-webkit-autofill,
.input:-webkit-autofill:hover,
.input:-webkit-autofill:focus,
.input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-white) inset !important;
    -webkit-text-fill-color: var(--text-dark) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--shadow-focus);
}

.input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--shadow-focus);
}

/* Darker placeholder text for better visibility */
.input::placeholder {
    color: #555 !important;
    opacity: 1 !important;
}

.input::-webkit-input-placeholder {
    color: #555 !important;
    opacity: 1 !important;
}

.input::-moz-placeholder {
    color: #555 !important;
    opacity: 1 !important;
}

.input:-ms-input-placeholder {
    color: #555 !important;
    opacity: 1 !important;
}

.form-control.error {
    border-color: var(--border-error);
}

.input.error {
    border-color: var(--border-error);
}

/* Flex utilities for checkbox layout */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-start {
    align-items: flex-start;
}

.items-center {
    align-items: center;
}

.gap-4 {
    gap: 1rem;
}

.gap-2\.5 {
    gap: 0.625rem;
}

.gap-2 {
    gap: 0.5rem;
}

.p-2 {
    padding: 0.5rem;
}

/* Form label styling */
.form-label {
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
}

/* Checkbox styling */
.checkbox {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border-light);
    border-radius: 0.25rem;
    background-color: var(--bg-white);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox:checked {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.875rem;
    font-weight: bold;
}

.checkbox:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 2px var(--shadow-focus);
}

.checkbox-sm {
    width: 1rem;
    height: 1rem;
}

.checkbox-sm:checked::after {
    font-size: 0.75rem;
}

/* Grid system */
.grid {
    display: grid;
    gap: 1rem;
}

/* Card components */
.card {
    background-color: var(--bg-white);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
}

.card-grid {
    display: flex;
    flex-direction: column;
}

.min-w-full {
    min-width: 100%;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.py-5 {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
}

.flex-wrap {
    flex-wrap: wrap;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

.gap-6 {
    gap: 1.5rem;
}

.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.left-0 {
    left: 0;
}

.top-1\/2 {
    top: 50%;
}

.-translate-y-1\/2 {
    transform: translateY(-50%);
}

.text-gray-500 {
    color: #6b7280;
}

.text-md {
    font-size: 1rem;
}

.leading-none {
    line-height: 1;
}

.ml-3 {
    margin-left: 0.75rem;
}

.pl-8 {
    padding-left: 2rem;
}

.card-body {
    padding: 1.5rem;
}

.scrollable-x-auto {
    overflow-x: auto;
}

/* Table styling */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    table-layout: auto !important;
}

.table-auto {
    table-layout: auto !important;
}
/* Force fixed layout for resizable tables so widths apply */
table.resizable-table,
table[data-resizable="true"] {
    table-layout: fixed !important;
}

.table-border {
    border: 1px solid #e5e7eb;
}

.table thead th {
    background-color: #f9fafb;
    padding: 0.75rem;
    text-align: right;
    font-weight: 500;
    color: var(--text-dark);
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
    width: auto !important;
    min-width: unset !important;
    max-width: none !important;
    position: relative;
}

/* --- Column resize handles --- */
.col-resize-handle {
  position: absolute;
  top: 0; bottom: 0;
  width: 8px;
  cursor: col-resize;
  /* Place on the left edge for RTL so resizing feels natural */
  left: -4px;
  right: auto;
  transform: translateX(0);
  opacity: 0;
}
.table thead th:hover .col-resize-handle { opacity: 1; }
.col-resize-handle::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: 3px; right: 3px;
}
.col-resize-active * { cursor: col-resize !important; }
/* --- End column resize handles --- */

.table tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    white-space: nowrap;
    width: auto !important;
    min-width: unset !important;
    max-width: none !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Automatic Charges Table - Optimized Column Widths */
.automatic-charges-table .col-client {
    width: 15%;
    min-width: 120px;
}

.automatic-charges-table .col-service {
    width: 12%;
    min-width: 100px;
}

.automatic-charges-table .col-price-table {
    width: 12%;
    min-width: 110px;
}

.automatic-charges-table .col-price {
    width: 8%;
    min-width: 80px;
    text-align: left;
}

.automatic-charges-table .col-frequency {
    width: 8%;
    min-width: 70px;
}

.automatic-charges-table .col-start-date,
.automatic-charges-table .col-next-charge {
    width: 10%;
    min-width: 90px;
}

.automatic-charges-table .col-status {
    width: 8%;
    min-width: 70px;
    text-align: center;
}

.automatic-charges-table .col-description {
    width: 15%;
    min-width: 120px;
    white-space: normal !important;
    max-width: 200px !important;
}

.automatic-charges-table .col-created-by {
    width: 10%;
    min-width: 90px;
}

.automatic-charges-table .col-actions {
    width: 12%;
    min-width: 140px;
    white-space: nowrap !important;
    padding: 0.5rem !important;
}

/* Action buttons container */
.action-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.action-buttons .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    min-width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Specific styling for action column */
.table tbody td:last-child {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    white-space: nowrap !important;
    padding: 0.5rem !important;
}

/* ID column styling - smaller and lighter */
.table tbody td:first-child {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    text-align: center !important;
}

/* Client name column styling */
.table tbody td:nth-child(3) {
    white-space: normal !important;
    max-width: 200px !important;
}

.table tbody tr:hover {
    background-color: #f9fafb;
}

/* Sort styling */
.sort-label {
    font-weight: 500;
    color: var(--text-dark);
}

/* Badge styling */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
}

.badge-sm {
    padding: 0.125rem 0.375rem;
    font-size: 0.6875rem;
}

.badge-outline {
    background-color: transparent;
    border: 1px solid currentColor;
}

.badge-success {
    color: #059669;
    border-color: #059669;
}

.badge-warning {
    color: #d97706;
    border-color: #d97706;
}

.badge-primary {
    color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.badge-danger {
    color: #dc2626;
    border-color: #dc2626;
}

.badge-secondary {
    color: #6b7280;
    border-color: #6b7280;
}

/* Button styling */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

.btn-light {
    background-color: #f9fafb;
    color: var(--text-dark);
    border-color: #e5e7eb;
}

.btn-light:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

/* Spacing utilities */
.gap-0\.5 {
    gap: 0.125rem;
}

.gap-1\.5 {
    gap: 0.375rem;
}

.h-4 {
    height: 1rem;
}

.h-9 {
    height: 2.25rem;
}

.rounded-full {
    border-radius: 9999px;
}

.font-semibold {
    font-weight: 600;
}

.text-sm {
    font-size: 0.875rem;
}

.text-2sm {
    font-size: 0.8125rem;
}

.text-gray-900 {
    color: #111827;
}

.text-gray-600 {
    color: #4b5563;
}

.text-gray-700 {
    color: #374151;
}

.hover\:text-primary:hover {
    color: var(--primary-blue);
}

.autocomplete-container {
    position: relative;
}

.autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-light);
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.autocomplete-item {
    padding: 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-gray);
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: var(--table-header);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-light);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-success {
    background-color: var(--success-green);
    color: var(--text-light);
}

.btn-success:hover {
    background-color: var(--success-hover);
}

.btn-danger {
    background-color: var(--danger-red);
    color: var(--text-light);
}

.btn-danger:hover {
    background-color: var(--danger-hover);
}

.btn-secondary {
    background-color: var(--neutral-gray);
    color: var(--text-light);
}

.btn-secondary:hover {
    background-color: var(--neutral-hover);
}

.btn-full {
    width: 100%;
}

/* Dashboard Layout */
.dashboard {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
}

.charges-list,
.charge-form {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px var(--shadow-medium);
}

.charges-list h2,
.charge-form h2 {
    margin-bottom: 1rem;
    color: var(--text-muted);
    border-bottom: 2px solid var(--table-accent);
    padding-bottom: 0.5rem;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    table-layout: fixed; /* Enable fixed layout for better column control */
}

/* Force table layout reset for better column control */
.table * {
    box-sizing: border-box;
}

/* Table column widths for charges table - Updated */
.table th:nth-child(1), /* ID */
.table td:nth-child(1) {
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
}

/* File attachment icon in charges table */
.charge-file-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    color: #369bd4;
    background: #e8f4fd;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.charge-file-icon:hover {
    background: #369bd4;
    color: white;
}

.table th:nth-child(2), /* ×ª××¨×™×š */
.table td:nth-child(2) {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
}

.table th:nth-child(3), /* ×œ×§×•×— */
.table td:nth-child(3) {
    width: auto !important;
    min-width: 200px !important;
}

.table th:nth-child(4), /* ×œ×§×•×— ×¡×•×¤×™ */
.table td:nth-child(4) {
    width: auto !important;
    min-width: 120px !important;
}

.table th:nth-child(5), /* ×¤×¨×•×™×§×˜ */
.table td:nth-child(5) {
    width: auto !important;
    min-width: 150px !important;
}

.table th:nth-child(6), /* ×›×ž×•×ª */
.table td:nth-child(6) {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
}

.table th:nth-child(7), /* ×©×™×¨×•×ª */
.table td:nth-child(7) {
    width: auto !important;
    min-width: 180px !important;
}

.table th:last-child, /* ×¤×¢×•×œ×•×ª */
.table td:last-child {
    width: 60px !important;
    min-width: 60px !important;
    max-width: 60px !important;
    text-align: left !important;
}

/* Specific styling for action buttons in table cells */
.table td:last-child .action-buttons {
    justify-content: flex-start;
    margin: 0;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: right;
    border-bottom: 1px solid var(--table-border);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table th {
    background-color: var(--table-header);
    font-weight: 600;
    color: var(--text-muted);
}

.table tbody tr:hover {
    background-color: var(--table-hover);
}

/* Status badges */
.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-charged {
    background-color: var(--success-light);
    color: var(--success-text);
}

.status-order-sent {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-invoice-sent {
    background-color: #f8d7da;
    color: #721c24;
}

/* Disabled button styles for invoiced charges */
.btn.disabled,
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.btn.disabled:hover,
.btn:disabled:hover {
    opacity: 0.5;
    transform: none;
}

.action-buttons .btn.disabled {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
}

/* Filtering styles */
.filtered-hidden {
    display: none !important;
}

/* General badge for price tables - restored original styling */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    background-color: #17a2b8;
    color: white;
}

/* Ensure consistent badge styling in tables */
.table .badge {
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    padding: 0.25rem 0.5rem !important;
    border-radius: 4px !important;
    line-height: 1 !important;
}

.table .badge-sm {
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
}

/* Badge colors based on status */
.table .badge-success {
    background-color: #28a745 !important;
    color: white !important;
    border: none !important;
}

.table .badge-warning {
    background-color: #dc3545 !important;
    color: white !important;
    border: none !important;
    animation: blink 1.5s infinite;
}

/* Blinking animation for overdue badges */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Text utilities */
.text-muted {
    color: #6c757d;
    font-style: italic;
}

.text-left {
    text-align: left !important;
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.5rem;
    justify-content: flex-start;
    align-items: center;
}

/* Specific styling for action buttons in table cells */
.table td:last-child .action-buttons {
    justify-content: flex-start;
    margin: 0;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 3px;
}

/* Icon-only buttons */
.btn-icon {
    padding: 0.25rem;
    min-width: 32px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    position: relative;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.btn-icon svg {
    pointer-events: none;
}

.btn-icon:hover {
    background-color: #f8f9fa;
}

/* Tooltip for icon buttons */
.btn-icon[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

.btn-icon[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
    z-index: 1000;
}

/* Role badges */
.role-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.role-admin {
    background-color: #dc3545;
    color: white;
}

.role-employee {
    background-color: #28a745;
    color: white;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.card-title {
    margin: 0;
    color: #2c3e50;
}

/* Grid layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Clients page layout */
.clients-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    align-items: start;
}

.add-client-form {
    max-width: 400px;
}

/* Users page layout - form takes ~1/3, table takes ~2/3 */
.users-layout {
    display: grid;
    grid-template-columns: minmax(320px, 1fr) minmax(700px, 2fr);
    gap: 2rem;
    align-items: start;
    width: 100%;
    max-width: none; /* Remove max-width constraint */
}

.add-user-form {
    max-width: 100%;
    min-width: 320px;
    flex-shrink: 0;
}

/* Make users table container take full width */
.users-layout .table-container {
    width: 100%;
    min-width: 0; /* Allow shrinking */
    flex: 1; /* Take remaining space */
}

/* Ensure the users layout uses full container width */
.users-layout {
    width: 100%;
    max-width: 100%;
}

/* Price tables page layout */
.price-tables-layout {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 2rem;
    align-items: start;
}

.add-price-table-form {
    max-width: 400px;
}

/* Client employees page layout */
.client-employees-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 2rem;
    align-items: start;
}

.add-employee-form {
    max-width: 350px;
}

@media (max-width: 768px) {
    .clients-layout,
    .users-layout,
    .price-tables-layout,
    .client-employees-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .add-client-form,
    .add-user-form,
    .add-price-table-form,
    .add-employee-form {
        max-width: 100%;
    }
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

/* Notification System */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-width: 400px;
    word-wrap: break-word;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-success {
    background-color: var(--success-green);
}

.notification-error {
    background-color: var(--danger-red);
}

.notification-info {
    background-color: var(--info-blue);
}

.notification-warning {
    background-color: var(--warning-yellow);
    color: var(--text-dark);
}

/* Responsive Table Design */
@media (max-width: 1200px) {
    .automatic-charges-table .col-description {
        display: none;
    }
    
    .automatic-charges-table .col-created-by {
        display: none;
    }
}

@media (max-width: 992px) {
    .automatic-charges-table .col-price-table {
        display: none;
    }
    
    .automatic-charges-table .col-start-date {
        display: none;
    }
}

@media (max-width: 768px) {
    .automatic-charges-table .col-frequency {
        display: none;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 2px;
    }
    
    .action-buttons .btn {
        width: 100%;
        font-size: 0.7rem;
        padding: 0.2rem 0.3rem;
        height: 28px;
    }
    
    .automatic-charges-table .col-actions {
        min-width: 60px;
        width: 60px;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 900px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #333;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Row update animation */
.row-updated {
    background-color: #d4edda !important;
    transition: background-color 0.3s ease;
}

.row-updated.fade-out {
    background-color: transparent;
    transition: background-color 2s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }
    
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }
}

/* Wide screen optimizations (1920px and above) */
@media (min-width: 1920px) {
    .container {
        max-width: 100%;
        padding: 30px;
    }
    
    .dashboard {
        grid-template-columns: 4fr 1fr;
        gap: 3rem;
    }
    
    .grid-2 {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .grid-3 {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
    
    .table th,
    .table td {
        padding: 1rem 0.75rem;
    }
    
    .form-control {
        font-size: 1rem;
        padding: 0.75rem;
    }
    
    .input {
        font-size: 1rem;
        padding: 0.75rem;
    }
}

/* Ultra-wide screen optimizations (2560px and above) */
@media (min-width: 2560px) {
    .container {
        max-width: 95%;
        padding: 40px;
    }
    
    .dashboard {
        grid-template-columns: 5fr 1fr;
        gap: 4rem;
    }
    
    .grid-3 {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Hebrew text support */
.hebrew {
    direction: rtl;
    text-align: right;
}

/* Client logo preview */
.logo-preview {
    max-width: 100px;
    max-height: 100px;
    object-fit: contain;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.5rem;
}

/* File upload styling */
.file-upload {
    position: relative;
    display: inline-block;
    cursor: pointer;
    width: 100%;
    max-width: 300px; /* Prevent the field from becoming too wide */
}

.file-upload input[type=file] {
    position: absolute;
    left: -9999px;
}

.file-upload-label {
    display: block;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-upload-label:hover {
    background-color: #e9ecef;
}

/* Price display for admin */
.price-display {
    font-weight: bold;
    color: #27ae60;
}

.price-editable {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
}

/* Statistics cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: transparent;
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

/* Align key stat cards with header theme */
#this-month-charges-card.stat-card,
#last-6-months-card.stat-card {
    background: var(--gradient-primary);
    color: var(--text-light);
}

/* Current month card typography adjustments */
#this-month-charges-card .stat-number {
    font-size: 4rem;
}

/* All detail lines in the current month card */
#this-month-charges-card .stat-detail {
    font-size: 1.75rem;
}

/* Side-by-side layout for total and projection */
#this-month-charges-card .current-month-head {
    display: flex;
    align-items: center; /* vertically center children */
    justify-content: space-between;
    gap: 16px;
}
#this-month-charges-card .projection-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}


#this-month-charges-card .current-month-head .stat-number {
    margin-bottom: 0;
}

#this-month-charges-card .current-month-head .stat-detail {
    margin-top: 0;
}

@media (max-width: 640px) {
    #this-month-charges-card .current-month-head {
        flex-direction: column;
        align-items: center;
    }
}

/* Increase readability of the 4-months breakdown by ~30% */
#last-4-months-card .stat-number {
    font-size: 1.3em;
}
#last-4-months-card .month-item-label {
    font-size: 1.3em;
}
#last-4-months-card .month-item-total {
    font-size: 1.3em;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.stat-detail {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.stat-detail small {
    font-size: 0.7rem;
    opacity: 0.7;
}

/* =================================================================
   ADMIN DASHBOARD SPECIFIC STYLES
   ================================================================= */

/* Clickable month rows */
.clickable-month:hover {
    background-color: #f8f9fa !important;
    transform: scale(1.02);
    transition: all 0.2s ease;
}

.clickable-month td:first-child {
    font-weight: 600;
}

/* Client charges grouping */
.client-charges-group {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    overflow: hidden;
}

/* Enhanced button styles */
.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* Table layout improvements */
.table {
    table-layout: fixed;
    width: 100%;
}

.table th,
.table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0.5rem;
    vertical-align: middle;
}

/* Recent charges table column widths */
.table th:nth-child(1), .table td:nth-child(1) { width: 40px; }  /* checkbox */
.table th:nth-child(2), .table td:nth-child(2) { width: 8%; }    /* ×ª××¨×™×š */
.table th:nth-child(3), .table td:nth-child(3) { width: 14%; }   /* ×œ×§×•×— ×¡×•×¤×™ */
.table th:nth-child(4), .table td:nth-child(4) { width: 16%; }   /* ×¤×¨×•×™×§×˜ */
.table th:nth-child(5), .table td:nth-child(5) { width: 14%; }   /* ×©×™×¨×•×ª */
.table th:nth-child(6), .table td:nth-child(6) { width: 6%; }    /* ×›×ž×•×ª */
.table th:nth-child(7), .table td:nth-child(7) { width: 9%; }    /* ×ž×—×™×¨ ×™×—×™×“×” */
.table th:nth-child(8), .table td:nth-child(8) { width: 9%; }    /* ×¡×›×•× ×›×•×œ×œ */
.table th:nth-child(9), .table td:nth-child(9) { width: 12%; }   /* ×”×–×ž×™×Ÿ */
.table th:nth-child(10), .table td:nth-child(10) { width: 8%; }  /* ×¢×•×‘×“ */
.table th:nth-child(11), .table td:nth-child(11) { width: 12%; } /* ×¤×¢×•×œ×•×ª + ×¡×˜×˜×•×¡ */

/* Monthly charges table column widths */
.monthly-charges-table th:nth-child(1), 
.monthly-charges-table td:nth-child(1) { width: 40%; }
.monthly-charges-table th:nth-child(2), 
.monthly-charges-table td:nth-child(2) { width: 20%; }
.monthly-charges-table th:nth-child(3), 
.monthly-charges-table td:nth-child(3) { width: 40%; }

/* Charges by client table column widths */
.client-charges-table th:nth-child(1), 
.client-charges-table td:nth-child(1) { width: 50%; }
.client-charges-table th:nth-child(2), 
.client-charges-table td:nth-child(2) { width: 25%; }
.client-charges-table th:nth-child(3), 
.client-charges-table td:nth-child(3) { width: 25%; }

/* Table tooltips */
.table td[title] {
    cursor: help;
}

/* Status filter buttons */
.status-filter-buttons {
    padding: 10px 0;
    border-top: 1px solid #dee2e6;
}

.status-filter-btn {
    padding: 5px 12px;
    font-size: 0.875rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.status-filter-btn.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.status-filter-btn:not(.active):hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Hidden rows for filtering */
.filtered-hidden {
    display: none !important;
}

/* Checkbox and selection styles */
.charge-select, .select-all-client {
    transform: scale(1.2);
    margin: 0;
}

.charge-select:disabled, .select-all-client:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.client-selection-controls {
    font-size: 0.9em;
}

.client-selection-controls .btn {
    font-size: 0.8em;
    padding: 0.25rem 0.5rem;
}

.selected-count {
    font-weight: bold;
    white-space: nowrap;
}

/* Make checkbox column not truncate */
.table th:nth-child(1), .table td:nth-child(1) {
    overflow: visible;
    text-overflow: unset;
    white-space: unset;
    text-align: center;
}

/* Status select styling */
.status-select {
    width: 100%;
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    background-color: white;
    margin-bottom: 0.5rem;
}

.status-select:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.status-select:disabled {
    background-color: #f8f9fa;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Action buttons in table */
.table td:last-child {
    overflow: visible;
}

/* =================================================================
   DOCUMENT GENERATION MODAL STYLES
   ================================================================= */

.email-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.email-input-container input {
    flex: 1;
}

.charges-summary {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    margin-bottom: 15px;
}

.charges-summary .table {
    margin-bottom: 0;
    font-size: 0.9em;
}

.total-summary {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    text-align: right;
    margin-top: 10px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

.form-text {
    font-size: 0.875em;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Modal improvements */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.modal[style*="block"] {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 20px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    margin: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
}

.modal-close {
    cursor: pointer;
    font-size: 24px;
    font-weight: bold;
    color: #999;
}

.modal-close:hover {
    color: #000;
}

/* ========================================= */
/* EDIT CHARGE MODAL STYLES */
/* ========================================= */

.edit-charge-modal {
    width: 580px;
    max-width: 95vw;
    padding: 0 !important;
    border-radius: 12px !important;
    overflow: visible;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 4px 16px rgba(0, 0, 0, 0.1);
}

.edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #1a73e8, #1557b0);
    color: white;
}

.edit-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
}

.edit-modal-header .modal-close {
    color: rgba(255, 255, 255, 0.8);
    font-size: 22px;
    line-height: 1;
    transition: color 0.15s;
}

.edit-modal-header .modal-close:hover {
    color: white;
}

.edit-modal-charge-id {
    font-weight: 400;
    opacity: 0.7;
    font-size: 0.9em;
    margin-right: 0.25rem;
}

.edit-charge-modal form {
    padding: 0;
    margin: 0;
}

.edit-modal-grid {
    padding: 1.25rem 1.5rem 0.5rem;
}

.edit-modal-section {
    margin-bottom: 0.25rem;
}

.edit-modal-section-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.6rem;
    padding-bottom: 0;
}

.edit-modal-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.edit-modal-field {
    display: flex;
    flex-direction: column;
}

.edit-modal-field > label {
    font-size: 0.82rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.edit-modal-field .input,
.edit-modal-field .form-control,
.edit-modal-field input[type="text"],
.edit-modal-field input[type="number"],
.edit-modal-field input[type="date"],
.edit-modal-field textarea,
.edit-modal-field select {
    font-size: 0.9rem;
    padding: 0.45rem 0.6rem;
    border: 1.5px solid #d1d5db;
    border-radius: 6px;
    background: #fafbfc;
    transition: border-color 0.15s, box-shadow 0.15s;
    height: auto;
    min-height: unset;
}

.edit-modal-field .input:focus,
.edit-modal-field .form-control:focus,
.edit-modal-field input:focus,
.edit-modal-field textarea:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
    background: white;
    outline: none;
}

.edit-modal-field textarea {
    resize: vertical;
    min-height: 50px;
}

.edit-modal-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.88rem;
    color: #374151;
    padding-top: 1.5rem;
}

.edit-modal-checkbox-label span {
    font-weight: 500;
}

.edit-modal-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.5rem 0 0.75rem;
}

.edit-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.edit-modal-footer .btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.9rem;
    border-radius: 6px;
    font-weight: 500;
}

.edit-modal-footer .btn-light {
    background: white;
    border: 1.5px solid #d1d5db;
    color: #374151;
}

.edit-modal-footer .btn-light:hover {
    background: #f3f4f6;
}

.edit-modal-footer .btn-primary {
    min-width: 120px;
}

/* Responsive: stack fields on small screens */
@media (max-width: 500px) {
    .edit-modal-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    .edit-modal-field {
        flex: 1 1 100% !important;
    }
    .edit-charge-modal {
        width: 100vw;
        max-width: 100vw;
        border-radius: 0 !important;
    }
}

/* Center align quantity column */
.table td:nth-child(6) {
    text-align: center;
}

/* ========================================= */
/* USERS PAGE STYLES */
/* ========================================= */

/* Users table styling - responsive and readable */
.users-layout .table {
    width: 100% !important;
    margin-bottom: 20px;

    min-width: 100%;
}

/* Ensure table container takes full width */
.users-layout .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.users-layout .card {
    width: 100%;
    min-width: 0;
}

/* Force table to expand to full container width */
.users-layout .table-container {
    width: 100% !important;
    min-width: 600px; /* Minimum width for readability */
}

.users-layout .table th,
.users-layout .table td {
    padding: 12px 8px;
    vertical-align: middle;
    border-bottom: 1px solid #dee2e6;
}

.users-layout .table th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-top: 2px solid #2a2b2c;
}

/* Column specific styling */
.users-layout .table th:nth-child(1), /* שם */
.users-layout .table td:nth-child(1) {
    width: 20%;
    min-width: 120px;
}

.users-layout .table th:nth-child(2), /* אימייל */
.users-layout .table td:nth-child(2) {
    width: 25%;
    min-width: 180px;
    word-break: break-word;
}

.users-layout .table th:nth-child(3), /* תפקיד */
.users-layout .table td:nth-child(3) {
    width: 15%;
    text-align: center;
    min-width: 80px;
}

.users-layout .table th:nth-child(4), /* סטטוס */
.users-layout .table td:nth-child(4) {
    width: 15%;
    text-align: center;
    min-width: 80px;
}

.users-layout .table th:nth-child(5), /* תאריך הצטרפות */
.users-layout .table td:nth-child(5) {
    width: 15%;
    text-align: center;
    min-width: 110px;
}

.users-layout .table th:nth-child(6), /* פעולות */
.users-layout .table td:nth-child(6) {
    width: 10%;
    text-align: center;
    min-width: 160px;
}

/* Role and status badges styling */
.role-badge, .status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.role-admin {
    background-color: #2a2b2c;
    color: white;
}

.role-employee {
    background-color: #6c757d;
    color: white;
}

.status-charged {
    background-color: #28a745;
    color: white;
}

.status-invoice-sent {
    background-color: #dc3545;
    color: white;
}

/* Button styling in actions column */
.users-layout .table td:nth-child(6) .btn {
    margin: 2px;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
}

.users-layout .table td:nth-child(6) .text-muted {
    font-size: 12px;
    font-style: italic;
}

/* ========================================= */
/* DASHBOARD PAGE STYLES */
/* ========================================= */

.email-buttons {
    display: flex;
    gap: 5px;
    margin-top: 5px;
    flex-wrap: wrap;
}

.email-buttons .btn {
    font-size: 12px;
    padding: 4px 8px;
}

.form-check {
    margin-bottom: 10px;
}

.form-check-input {
    margin-left: 5px;
}

/* Manual price checkbox and label spacing adjustments */
label[for="use_manual_price_dashboard"],
label:has(#use_manual_price_dashboard) {
    margin-top: -8px !important;
    margin-bottom: 8px !important;
}

#accountant_email {
    transition: all 0.3s ease;
}

.document-modal .form-group {
    margin-bottom: 15px;
}

/* ========================================= */
/* CLIENTS PAGE STYLES */
/* ========================================= */

.portal-link-cell {
    min-width: 120px;
    text-align: center;
}

.copy-portal-link, .regenerate-token {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    margin: 0.1rem;
    white-space: nowrap;
}

.btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
    color: white;
}

.btn-warning {
    background-color: #ffc107;
    border-color: #ffc107;
    color: #212529;
}

/* Autocomplete Styles */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: none;
}

.autocomplete-suggestion {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.autocomplete-suggestion:hover,
.autocomplete-suggestion.selected {
    background-color: #f8f9fa;
}

.autocomplete-suggestion:last-child {
    border-bottom: none;
}

.form-group {
    position: relative;
}

.icount-autocomplete {
    position: relative;
}

/* Row update animation */
.row-updated {
    background-color: #d4edda !important;
    transition: background-color 0.3s ease;
}

.fade-out {
    background-color: transparent !important;
    transition: background-color 2s ease;
}

/* ========================================= */
/* SERVICES PAGE STYLES */
/* ========================================= */

.services-price-table {
    min-width: 100%;
    margin-bottom: 0;
}

.services-price-table th,
.services-price-table td {
    border: 1px solid #ddd;
    padding: 8px;
    vertical-align: middle;
}

.services-price-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    text-align: center;
}

.table-responsive {
    max-height: 70vh;
    overflow: auto;
    border: 1px solid #ddd;
}

.price-input {
    border: 1px solid #ddd;
    padding: 5px;
    text-align: center;
    font-size: 14px;
}

.price-input:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0,123,255,0.3);
}

.form-inline {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.form-inline .form-group {
    display: flex;
    align-items: center;
    margin: 0;
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.switch + label {
    margin-right: 10px;
    margin-bottom: 0;
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.services-table th,
.services-table td {
    vertical-align: middle;
}

.service-actions .btn {
    margin: 0 2px;
}

.editable-field {
    position: relative;
}

.editable-field .service-name-display,
.editable-field .service-description-display {
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.editable-field .service-name-display:hover,
.editable-field .service-description-display:hover {
    background-color: #f8f9fa;
}

.editable-field .service-name-input,
.editable-field .service-description-input {
    display: none;
}

.editing .editable-field .service-name-display,
.editing .editable-field .service-description-display {
    display: none;
}

.editing .editable-field .service-name-input,
.editing .editable-field .service-description-input {
    display: block !important;
}

/* ========================================= */
/* PRICE TABLES PAGE STYLES */
/* ========================================= */

.badge-default {
    background: #3498db;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.8em;
    margin-right: 5px;
}

.assigned-clients-list {
    max-height: 200px;
    overflow-y: auto;
}

.assigned-client-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.btn-small {
    padding: 4px 8px;
    font-size: 0.8em;
}

/* ========================================= */
/* OPEN DOCUMENTS PAGE STYLES */
/* ========================================= */

.client-portal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.month-section {
    background: white;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.month-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.month-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #333;
}

.month-summary {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.summary-item {
    text-align: center;
}

.summary-value {
    font-size: 1.1rem;
    font-weight: bold;
}

.summary-label {
    font-size: 0.9rem;
}

/* ========================================= */
/* RESPONSIVE DESIGN */
/* ========================================= */

@media (max-width: 768px) {
    .main-header-content {
        flex-direction: column;
        gap: 10px;
    }

    .title-section h1 {
        font-size: 24px;
    }

    .nav-bar-content {
        flex-direction: column;
        gap: 15px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .user-section {
        flex-direction: column;
        gap: 10px;
    }

    /* Users table responsive */
    .users-layout .table {
        font-size: 12px;
    }

    .users-layout .table th,
    .users-layout .table td {
        padding: 8px 4px;
    }

    .users-layout .table th:nth-child(5), /* Hide date on mobile */
    .users-layout .table td:nth-child(5) {
        display: none;
    }

    .users-layout .table td:nth-child(6) .btn {
        padding: 4px 8px;
        font-size: 11px;
        margin: 1px;
    }
}

/* Open Documents Page - Additional inline styles moved to CSS */
.overall-summary-description {
    color: #6c757d;
    margin-bottom: 1rem;
}

.overdue-month-header {
    background: #f8d7da !important;
    border-bottom: 2px solid #dc3545 !important;
}

.overdue-month-title {
    color: #721c24 !important;
    font-weight: bold !important;
}

.overdue-summary-label {
    color: #721c24 !important;
    font-weight: bold !important;
}

.overdue-row {
    background-color: #fff5f5 !important;
}

.overdue-text {
    color: #dc3545;
    font-weight: bold;
}

.amount-bold {
    font-weight: bold;
}

.not-available-text {
    color: #6c757d;
}

.download-button-text {
    font-size: 12px;
}
