/* Modern Enterprise Design System */

/* Base Styles */
* {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-size: 14px;
    color: #111827;
    background: #FAFBFC;
    line-height: 1.5;
}

/* Utilities */
.container-custom {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 32px;
}

.card-modern {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.card-modern:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 150ms ease;
}

.btn-modern {
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    transition: all 150ms ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #4A6DD5;
    color: white;
    box-shadow: 0 1px 2px 0 rgba(74, 109, 213, 0.3);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 200ms ease;
}

.btn-primary:hover {
    background: #3B5BBF;
    box-shadow: 0 4px 6px -1px rgba(74, 109, 213, 0.4);
    text-decoration: none;
    color: white;
    transform: translateY(-1px);
}

.btn-primary i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 1px solid #E5E7EB;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: all 150ms ease;
}

.btn-secondary:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    text-decoration: none;
    color: #374151;
}

.btn-secondary i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Small Button Size */
.btn-sm {
    padding: 8px 12px !important;
    font-size: 13px !important;
}

.btn-sm i {
    width: 16px !important;
    height: 16px !important;
}

/* Icon Button - Compact size with only icon */
.btn-icon {
    padding: 0 !important;
    font-size: 0 !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 6px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative;
    flex-shrink: 0;
    gap: 0 !important;
    margin: 0 !important;
}

.btn-icon i {
    width: 16px !important;
    height: 16px !important;
    font-size: initial !important;
    flex-shrink: 0;
}

/* Tooltip on hover */
.btn-icon::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1F2937;
    color: white;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms ease;
    margin-bottom: 8px;
    z-index: 10;
}

.btn-icon::before {
    content: '';
    position: absolute;
    bottom: calc(100% - 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1F2937;
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms ease;
    pointer-events: none;
    z-index: 11;
}

.btn-icon:hover::after,
.btn-icon:focus::after {
    opacity: 1;
    visibility: visible;
}

.btn-icon:hover::before,
.btn-icon:focus::before {
    opacity: 1;
    visibility: visible;
}

.btn-ghost {
    background: transparent;
    color: #6B7280;
}

.btn-ghost:hover {
    background: #F3F4F6;
}

.btn-destructive {
    background: #EF4444;
    color: white;
}

.btn-destructive:hover {
    background: #DC2626;
}

/* Form Helper Text */
.form-helper {
    font-size: 12px;
    color: #6B7280;
    margin-top: 6px;
}

/* Form Container */
.form-container {
    width: 100%;
    box-sizing: border-box;
}

.form-container .card-modern {
    padding-top: 32px;
    padding-right: 32px;
    padding-bottom: 32px;
    padding-left: 32px;
    box-sizing: border-box;
}

.form-container .card-modern form {
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.form-container .card-modern form > div {
    width: 100%;
    max-width: none;
    margin-right: 0;
    box-sizing: border-box;
}

.form-container .card-modern .form-group {
    width: 100%;
    max-width: none;
    margin-right: 0;
    margin-left: 0;
    box-sizing: border-box;
}

.form-container .card-modern .form-input {
    width: 100%;
    max-width: 100%;
    margin-right: 0;
    margin-left: 0;
    box-sizing: border-box;
}

/* Button Alignment in Form */
.form-container .card-modern .flex {
    display: flex;
    align-items: center;
    gap: 16px !important;
}

.form-container .card-modern .flex .btn-form-primary,
.form-container .card-modern .flex .btn-form-secondary {
    margin: 0;
}

/* Add gap between buttons - margin-left on second button */
.form-container .card-modern .flex .btn-form-secondary + .btn-form-primary {
    margin-left: 16px;
}

/* Edit Agreement Form Buttons - Matching Login Page Design */
.form-container .card-modern .btn-form-primary {
    height: 44px;
    padding: 0 20px;
    background: #4A6DD5;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms ease;
    box-shadow: 0 4px 6px -1px rgba(74, 109, 213, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
    text-decoration: none;
}

.form-container .card-modern .btn-form-primary:hover {
    background: #3B5BBF;
    box-shadow: 0 4px 6px -1px rgba(74, 109, 213, 0.4);
    transform: translateY(-1px);
}

.form-container .card-modern .btn-form-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px -1px rgba(74, 109, 213, 0.3);
}

.form-container .card-modern .btn-form-primary:focus-visible {
    outline: 2px solid #4A6DD5;
    outline-offset: 2px;
}

.form-container .card-modern .btn-form-secondary {
    height: 44px;
    padding: 0 20px;
    background: white;
    color: #374151;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    text-decoration: none;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.form-container .card-modern .btn-form-secondary:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.form-container .card-modern .btn-form-secondary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.form-container .card-modern .btn-form-secondary:focus-visible {
    outline: 2px solid #4A6DD5;
    outline-offset: 2px;
}

.form-container .card-modern .btn-form-primary i,
.form-container .card-modern .btn-form-secondary i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Responsive Form Container Padding */
@media (max-width: 768px) {
    .form-container .card-modern {
        padding-top: 24px;
        padding-right: 24px;
        padding-bottom: 24px;
        padding-left: 24px;
    }
}

@media (max-width: 640px) {
    .form-container .card-modern {
        padding-top: 16px;
        padding-right: 16px;
        padding-bottom: 16px;
        padding-left: 16px;
    }
}

/* Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}

.badge-success {
    background: #D1FAE5;
    color: #065F46;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-error {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-neutral {
    background: #F3F4F6;
    color: #4B5563;
}

/* Table Styles */
.table-modern {
    width: 100%;
    min-width: 1000px;
    border-collapse: collapse;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    table-layout: fixed;
}

.table-modern thead {
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
}

.table-modern th {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B7280;
    padding: 12px 16px;
    text-align: left;
    white-space: nowrap;
}

.table-modern th.text-right {
    text-align: right;
}

.table-modern td {
    padding: 12px 16px;
    font-size: 14px;
    color: #111827;
    border-bottom: 1px solid #F3F4F6;
    overflow: hidden;
    text-overflow: ellipsis;
}

.table-modern td.text-right {
    text-align: right;
}

.table-modern th.amount-cell,
.table-modern td.amount-cell {
    text-align: right;
    white-space: nowrap;
    width: 12rem;
    min-width: 12rem;
    overflow: visible;
    text-overflow: clip;
}

/* Clients index — column widths tuned for typical client data */
.table-modern.clients-table {
    min-width: 1180px;
}

.table-modern.clients-table col.col-company { width: 14%; }
.table-modern.clients-table col.col-contact { width: 11%; }
.table-modern.clients-table col.col-email { width: 27%; }
.table-modern.clients-table col.col-phone { width: 9%; }
.table-modern.clients-table col.col-country { width: 5.75rem; }
.table-modern.clients-table col.col-invoices { width: 6.25rem; }
.table-modern.clients-table col.col-amount { width: 11rem; }
.table-modern.clients-table col.col-created { width: 8.75rem; }
.table-modern.clients-table col.col-actions { width: 8.25rem; }

.table-modern.clients-table th.actions-cell,
.table-modern.clients-table td.actions-cell {
    min-width: 8.25rem;
    width: 8.25rem;
}

.table-modern.clients-table td.col-phone,
.table-modern.clients-table td.col-invoices,
.table-modern.clients-table td.col-created {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

.table-modern.clients-table td.col-amount {
    white-space: nowrap;
    width: auto;
    min-width: 0;
}

.table-modern.clients-table td.col-email {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.table-modern.clients-table th.col-country,
.table-modern.clients-table td.col-country {
    text-align: center;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    min-width: 5.75rem;
    padding-left: 10px;
    padding-right: 10px;
}

.table-modern.clients-table th.col-invoices,
.table-modern.clients-table td.col-invoices {
    min-width: 6.25rem;
    overflow: visible;
    text-overflow: clip;
    padding-left: 10px;
    padding-right: 12px;
}

.table-modern.clients-table .client-country-flag {
    font-size: 1.35rem;
    line-height: 1;
    cursor: default;
}

.table-modern.clients-table td.col-company {
    font-weight: 500;
}

.table-modern tbody tr:last-child td {
    border-bottom: none;
}

.table-modern tbody tr {
    position: relative;
    z-index: 0;
}

.table-modern tbody tr:hover {
    background: #F9FAFB;
    transition: background 150ms ease;
    z-index: 2;
}

/* Actions column: ensure all buttons are visible and tooltips not clipped */
.table-modern th.actions-cell,
.table-modern td.actions-cell {
    min-width: 280px;
    width: 280px;
    overflow: visible;
}

.table-modern .table-actions {
    justify-content: flex-end;
}

/* Navigation Styles */
.nav-sidebar {
    width: 240px;
    background: #FAFBFC;
    border-right: 1px solid #E5E7EB;
    position: fixed;
    top: 64px;
    left: 0;
    height: calc(100vh - 64px);
    padding: 16px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 40;
    transition: width 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 1024px) {
    .nav-sidebar.sidebar-collapsed {
        width: 64px;
        padding: 16px 8px;
    }
}

@media (max-width: 1023px) {
    .nav-sidebar {
        width: 280px;
        transform: translateX(-100%);
    }
    
    .nav-sidebar.translate-x-0 {
        transform: translateX(0);
    }
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
    margin-bottom: 4px;
    transition: all 150ms ease;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
}

@media (min-width: 1024px) {
    .sidebar-collapsed .nav-item {
        padding: 10px;
        justify-content: center;
    }
    
    .sidebar-collapsed .nav-item:hover::after {
        content: attr(title);
        position: absolute;
        left: calc(100% + 8px);
        background: #1F2937;
        color: white;
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 13px;
        white-space: nowrap;
        z-index: 100;
        pointer-events: none;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }
    
    .sidebar-collapsed .nav-item:hover::before {
        content: '';
        position: absolute;
        left: calc(100% + 4px);
        border: 4px solid transparent;
        border-right-color: #1F2937;
        z-index: 101;
        pointer-events: none;
    }
}

.nav-item:hover {
    background: #F9FAFB;
    color: #374151;
}

.nav-item.active {
    background: #F3F4F6;
    color: #4A6DD5;
    border-left: 3px solid #4A6DD5;
    padding-left: 9px;
}

.nav-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    color: #9CA3AF;
    flex-shrink: 0;
}

.nav-item-text {
    transition: opacity 200ms ease;
}

@media (min-width: 1024px) {
    .sidebar-collapsed .nav-icon {
        margin-right: 0;
    }
    
    .sidebar-collapsed .nav-item-text {
        opacity: 0;
        width: 0;
        overflow: hidden;
    }
}

.nav-item.active .nav-icon {
    color: #4A6DD5;
}

.nav-section-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9CA3AF;
    padding: 16px 12px 8px;
    margin-top: 16px;
    transition: opacity 200ms ease;
}

@media (min-width: 1024px) {
    .sidebar-collapsed .nav-section-header {
        opacity: 0;
        height: 0;
        padding: 0;
        margin: 0;
        overflow: hidden;
    }
}

.nav-section-header:first-child {
    margin-top: 0;
}

/* Top Navbar */
.navbar-top {
    height: 64px;
    background: #FFFFFF;
    border-bottom: 1px solid #E5E7EB;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

/* Navbar Left Section (Hamburger + Logo) */
.navbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 64px;
    margin-left: 0;
}

/* Hamburger Menu Button */
.hamburger-button {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 150ms ease;
    padding: 0;
    margin-right: 0;
}

.hamburger-button:hover {
    background: #F3F4F6;
}

.hamburger-button:active {
    background: #E5E7EB;
    transform: scale(0.95);
    transition: transform 100ms ease;
}

.hamburger-icon {
    width: 20px;
    height: 20px;
    color: #374151;
    stroke-width: 2;
}

/* Navbar Logo */
.navbar-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    padding: 8px;
    margin-left: 12px;
}

.navbar-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    display: block;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* User Menu Button */
.user-menu-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 150ms ease;
    height: 40px;
}

.user-menu-button:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.user-menu-button:active,
.user-menu-button[aria-expanded="true"] {
    background: #F3F4F6;
    border-color: #4A6DD5;
    box-shadow: 0 0 0 3px rgba(74, 109, 213, 0.1);
}

/* User Avatar with Gradient */
.user-avatar-gradient {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A6DD5 0%, #3B5BBF 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    box-shadow: 0 0 0 2px rgba(74, 109, 213, 0.15);
    flex-shrink: 0;
}

.user-name-text {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
}

.user-chevron {
    width: 16px;
    height: 16px;
    color: #9CA3AF;
    transition: transform 200ms ease;
    flex-shrink: 0;
}

.user-chevron.rotate-180 {
    transform: rotate(180deg);
}

/* User Dropdown Menu */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 8px;
    min-width: 200px;
    z-index: 100;
    animation: fadeInDown 200ms ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Dropdown User Info Section */
.dropdown-user-info {
    padding: 12px;
    border-bottom: 1px solid #F3F4F6;
    margin-bottom: 8px;
}

.dropdown-user-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}

.dropdown-user-email {
    font-size: 12px;
    color: #6B7280;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    transition: background 150ms ease;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
}

.dropdown-item i {
    width: 16px;
    height: 16px;
    color: #6B7280;
}

.dropdown-item:hover {
    background: #F3F4F6;
}

.dropdown-item-danger {
    color: #EF4444;
}

.dropdown-item-danger i {
    color: #EF4444;
}

.dropdown-item-danger:hover {
    background: #FEE2E2;
}

.dropdown-divider {
    height: 1px;
    background: #E5E7EB;
    margin: 8px 0;
}

.user-menu {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 150ms ease;
}

.user-menu:hover {
    background: #F9FAFB;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #4A6DD5;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    margin-right: 8px;
}

/* Main Content */
.main-content {
    margin-left: 240px;
    margin-top: 64px;
    padding: 32px;
    background: #FAFBFC;
    min-height: calc(100vh - 64px);
    transition: margin-left 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 1024px) {
    .main-content {
        margin-left: 240px;
    }
    
    .main-content-collapsed {
        margin-left: 64px;
    }
}

@media (max-width: 1023px) {
    .main-content {
        margin-left: 0;
    }
}

/* Page Header */
.page-header {
    margin-bottom: 32px;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Header Action Button */
.header-action-button {
    background: #4A6DD5;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 200ms ease;
    box-shadow: 0 1px 2px 0 rgba(74, 109, 213, 0.3);
    border: none;
    cursor: pointer;
    letter-spacing: normal;
}

.header-action-button:hover {
    background: #3B5BBF;
    box-shadow: 0 4px 6px -1px rgba(74, 109, 213, 0.4);
    transform: translateY(-1px);
    text-decoration: none;
    color: white;
}

.header-action-button i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.page-title {
    font-size: 28px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.page-description {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.5;
    margin-bottom: 0;
}

.page-welcome {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 4px;
    font-weight: 400;
}

.page-quick-stats {
    font-size: 13px;
    color: #9CA3AF;
    margin-top: 4px;
    margin-bottom: 0;
}

.page-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.page-date-time {
    font-size: 13px;
    color: #9CA3AF;
    margin: 0;
}

.page-description {
    font-size: 14px;
    color: #6B7280;
    margin-top: 4px;
}

/* Animations */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slide-in-right {
    0% { transform: translateX(100%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes fade-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* Table Skeleton Loader */
.agreements-table tbody tr .skeleton {
    margin: 0;
    display: inline-block;
}

.agreements-table tbody tr td {
    padding: 16px 20px;
    vertical-align: middle;
}

.agreements-table tbody tr .agreements-actions .skeleton {
    display: inline-block;
    margin-right: 8px;
}

.spinner {
    border: 3px solid #F3F4F6;
    border-top-color: #4A6DD5;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 600ms linear infinite;
}

/* Empty State */
.empty-state {
    padding: 80px 24px;
    text-align: center;
    background: #FAFBFC;
    border: 2px dashed #E5E7EB;
    border-radius: 12px;
    margin-top: 20px;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    color: #D1D5DB;
    margin: 0 auto 20px;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.empty-state-description {
    font-size: 14px;
    color: #6B7280;
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state-button {
    background: #4A6DD5;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 2px 0 rgba(74, 109, 213, 0.3);
    transition: all 200ms ease;
}

.empty-state-button:hover {
    background: #3B5BBF;
    box-shadow: 0 4px 6px -1px rgba(74, 109, 213, 0.4);
    transform: translateY(-1px);
}

/* Dashboard Statistics Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 200ms ease;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.stat-card:hover {
    box-shadow: 0 8px 12px -2px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.stat-icon::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.1;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
    pointer-events: none;
}

.stat-icon-svg {
    width: 24px;
    height: 24px;
}

.stat-icon-indigo {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
}

.stat-icon-indigo .stat-icon-svg {
    color: #4A6DD5;
}

.stat-icon-amber {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
}

.stat-icon-amber .stat-icon-svg {
    color: #F59E0B;
}

.stat-icon-green {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
}

.stat-icon-green .stat-icon-svg {
    color: #10B981;
}

.stat-icon-blue {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
}

.stat-icon-blue .stat-icon-svg {
    color: #3B82F6;
}

.stat-label {
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
    margin-bottom: 8px;
    text-transform: none;
}

.stat-number {
    font-size: 36px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    margin-bottom: 4px;
    display: block;
}

.stat-number-amber {
    color: #F59E0B;
}

.stat-number-green {
    color: #10B981;
}

.stat-number-blue {
    color: #3B82F6;
}

/* Stat Trend Indicators */
.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 12px;
}

.stat-trend-icon {
    width: 14px;
    height: 14px;
}

.stat-trend-text {
    color: #6B7280;
    font-weight: 400;
}

.stat-trend-up {
    color: #10B981;
}

.stat-trend-up .stat-trend-text {
    color: #10B981;
}

.stat-trend-down {
    color: #EF4444;
}

.stat-trend-down .stat-trend-text {
    color: #EF4444;
}

.stat-trend-neutral {
    color: #6B7280;
}

/* Section Card */
.section-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    margin-top: 32px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Table Scroll Container */
.overflow-x-auto {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 #F3F4F6;
}

.overflow-x-auto::-webkit-scrollbar {
    height: 8px;
}

.overflow-x-auto::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 4px;
}

.overflow-x-auto::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

.overflow-x-auto::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #F3F4F6;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.section-link {
    font-size: 14px;
    font-weight: 500;
    color: #4A6DD5;
    text-decoration: none;
    transition: color 150ms ease;
}

.section-link:hover {
    color: #3B5BBF;
}

/* Dashboard – compact layout */
.dashboard-page .stats-grid {
    gap: 14px;
    margin-bottom: 20px;
}
.dashboard-page .stat-card {
    padding: 14px 16px;
    min-height: unset;
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.dashboard-page .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
}
.dashboard-page .stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    margin-bottom: 10px;
}
.dashboard-page .stat-icon-svg {
    width: 20px;
    height: 20px;
}
.dashboard-page .stat-label {
    font-size: 12px;
    font-weight: 500;
    color: #6B7280;
    margin-bottom: 4px;
}
.dashboard-page .stat-number {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 0;
}
.dashboard-page .stat-trend {
    margin-top: 4px;
    font-size: 11px;
}
.dashboard-page .section-card {
    padding: 16px 18px;
    margin-top: 20px;
    border-radius: 10px;
}
.dashboard-page .section-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
}
.dashboard-page .section-title {
    font-size: 15px;
    font-weight: 600;
}
.dashboard-page .dashboard-chart-wrap {
    height: 240px;
    margin-top: 14px;
}
.dashboard-page .dashboard-insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin-top: 12px;
}
.dashboard-page .dashboard-insight-card {
    padding: 14px 16px;
    border-radius: 10px;
    border-left-width: 3px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dashboard-page .dashboard-insight-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.dashboard-page .dashboard-mom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.dashboard-page .dashboard-mom-card {
    padding: 14px 16px;
}
.dashboard-page .dashboard-mom-card .stat-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 0;
    border-radius: 8px;
}
.dashboard-page .dashboard-mom-card .stat-icon-svg {
    width: 18px;
    height: 18px;
}

/* Toast Notification System - Beautiful Modern Design */

/* Toast Container */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    max-width: 420px;
    width: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Toast Base Styles */
.toast {
    background: white;
    border-radius: 12px;
    padding: 0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: flex-start;
    gap: 0;
    min-height: 72px;
    pointer-events: auto;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Toast Icon Section */
.toast-icon-section {
    width: 72px;
    min-width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.toast-icon-section::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.1;
}

.toast-icon-section svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
    position: relative;
    z-index: 1;
}

/* Toast Content Section */
.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 20px 12px 20px;
    gap: 8px;
    min-height: 72px;
    justify-content: center;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    line-height: 1.5;
    margin: 0;
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.toast-progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: left;
    transform: scaleX(1);
}

/* Toast Close Button */
.toast-close {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    margin: 8px 8px 8px 0;
    transition: all 150ms ease;
    color: #9CA3AF;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #6B7280;
}

.toast-close:active {
    transform: scale(0.95);
}

.toast-close:focus {
    outline: 2px solid #4A6DD5;
    outline-offset: 2px;
}

.toast-close svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2.5;
}

/* Success Toast */
.toast-success {
    border-left: 4px solid #10B981;
}

.toast-success .toast-icon-section {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
}

.toast-success .toast-icon-section::before {
    background: #10B981;
}

.toast-success .toast-icon-section svg {
    stroke: #059669;
    color: #059669;
}

.toast-success .toast-progress-bar {
    background: linear-gradient(90deg, #10B981 0%, #059669 100%);
    animation: toast-progress 5000ms linear forwards;
}

/* Error Toast */
.toast-error {
    border-left: 4px solid #EF4444;
}

.toast-error .toast-icon-section {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
}

.toast-error .toast-icon-section::before {
    background: #EF4444;
}

.toast-error .toast-icon-section svg {
    stroke: #DC2626;
    color: #DC2626;
}

.toast-error .toast-progress-bar {
    background: linear-gradient(90deg, #EF4444 0%, #DC2626 100%);
    animation: toast-progress 5000ms linear forwards;
}

/* Warning Toast */
.toast-warning {
    border-left: 4px solid #F59E0B;
}

.toast-warning .toast-icon-section {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
}

.toast-warning .toast-icon-section::before {
    background: #F59E0B;
}

.toast-warning .toast-icon-section svg {
    stroke: #D97706;
    color: #D97706;
}

.toast-warning .toast-progress-bar {
    background: linear-gradient(90deg, #F59E0B 0%, #D97706 100%);
    animation: toast-progress 5000ms linear forwards;
}

/* Info Toast */
.toast-info {
    border-left: 4px solid #4A6DD5;
}

.toast-info .toast-icon-section {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
}

.toast-info .toast-icon-section::before {
    background: #4A6DD5;
}

.toast-info .toast-icon-section svg {
    stroke: #3B5BBF;
    color: #3B5BBF;
}

.toast-info .toast-progress-bar {
    background: linear-gradient(90deg, #4A6DD5 0%, #3B5BBF 100%);
    animation: toast-progress 5000ms linear forwards;
}

/* Toast Progress Animation */
@keyframes toast-progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .toast-container {
        top: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
        width: calc(100% - 32px);
    }

    .toast {
        min-height: 64px;
    }

    .toast-icon-section {
        width: 64px;
        min-width: 64px;
        height: 64px;
    }

    .toast-icon-section svg {
        width: 22px;
        height: 22px;
    }

    .toast-content {
        padding: 14px 16px 10px 16px;
        min-height: 64px;
    }

    .toast-message {
        font-size: 13px;
    }
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 40;
    display: none;
}

.sidebar-overlay.open {
    display: block;
}

/* Responsive */
@media (max-width: 1024px) {
    .nav-sidebar {
        transform: translateX(-100%);
        transition: transform 300ms ease-in-out;
        z-index: 50;
    }
    
    .nav-sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

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

@media (max-width: 768px) {
    .user-name-text {
        display: none;
    }

    .navbar-logo {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 16px;
    }

    .page-title {
        font-size: 24px;
    }

    .page-header {
        margin-bottom: 24px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .section-card {
        padding: 16px;
    }

    .stat-card {
        min-height: 120px;
        padding: 20px;
    }

    .stat-number {
        font-size: 28px;
    }

    .user-chevron {
        display: none;
    }
}

/* Pagination Styles */
.pagination-wrapper {
    margin-top: 24px;
    padding: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

#agreements-table-container .pagination-wrapper {
    margin-top: 24px;
    padding-top: 24px;
}

.pagination-info {
    display: flex;
    align-items: center;
}

.pagination-text {
    font-size: 14px;
    color: #6B7280;
}

.pagination-text strong {
    color: #111827;
    font-weight: 600;
}

.pagination-text-full {
    display: inline;
}

.pagination-text-short {
    display: none !important;
}

@media (max-width: 640px) {
    .pagination-text-full {
        display: none !important;
    }
    
    .pagination-text-short {
        display: inline !important;
    }
}

.pagination-controls {
    display: flex;
    align-items: center;
}

/* Mobile Responsive Pagination */
@media (max-width: 640px) {
    .pagination-wrapper {
        flex-wrap: nowrap;
        gap: 12px;
        align-items: center;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .pagination-wrapper::-webkit-scrollbar {
        height: 4px;
    }
    
    .pagination-wrapper::-webkit-scrollbar-track {
        background: #F3F4F6;
        border-radius: 2px;
    }
    
    .pagination-wrapper::-webkit-scrollbar-thumb {
        background: #D1D5DB;
        border-radius: 2px;
    }
    
    .pagination-info {
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .pagination-text {
        font-size: 12px;
        white-space: nowrap;
    }
    
    .pagination-controls {
        flex-shrink: 0;
    }
    
    nav.pagination,
    .pagination {
        justify-content: flex-end !important;
        width: auto !important;
        flex-shrink: 0 !important;
    }
    
    nav.pagination > a,
    nav.pagination > span,
    .pagination > a,
    .pagination > span {
        min-width: 32px !important;
        height: 32px !important;
        font-size: 13px !important;
        padding: 0 6px !important;
    }
}

nav.pagination,
.pagination {
    display: flex !important;
    gap: 8px !important;
    align-items: center !important;
    justify-content: flex-end !important;
    padding: 0 !important;
    margin: 0 !important;
    flex-wrap: wrap !important;
    list-style: none !important;
    width: auto !important;
    max-width: 100% !important;
}

nav.pagination > *,
.pagination > * {
    flex-shrink: 0;
}

nav.pagination > a,
nav.pagination > span,
.pagination > a,
.pagination > span {
    min-width: 36px !important;
    width: auto !important;
    height: 36px !important;
    padding: 0 8px !important;
    margin: 0 !important;
    border: 1px solid #E5E7EB !important;
    border-radius: 6px !important;
    background: white !important;
    color: #6B7280 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    transition: all 150ms ease !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    cursor: pointer;
    white-space: nowrap;
}

nav.pagination > a:hover,
.pagination > a:hover {
    background: #F9FAFB !important;
    border-color: #D1D5DB !important;
    color: #374151 !important;
    text-decoration: none !important;
}

nav.pagination > span.active,
.pagination > span.active {
    background: #4A6DD5 !important;
    color: white !important;
    border-color: #4A6DD5 !important;
    font-weight: 600 !important;
}

nav.pagination > span.disabled,
.pagination > span.disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background: #F9FAFB !important;
    pointer-events: none !important;
}

nav.pagination > a i,
nav.pagination > span i,
.pagination > a i,
.pagination > span i {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
    display: block !important;
    margin: 0 !important;
}

/* Textarea */
/* Textarea and Select styles are now in the consolidated form section above */

@media (max-width: 640px) {
    .main-content {
        padding: 16px;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .container-custom {
        padding: 0 16px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}

/* ============================================
   LOGIN PAGE STYLES - Modern Enterprise Design
   ============================================ */

/* Page Container */
body.login-page-body {
    background: #FAFBFC;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.login-container {
    min-height: 100vh;
    display: flex;
    position: relative;
    overflow-x: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* Left Panel (Desktop Only) */
.login-left-panel {
    display: none;
    width: 50%;
    background: linear-gradient(135deg, #4A6DD5 0%, #3B5BBF 100%);
    position: relative;
    overflow: hidden;
}

@media (min-width: 1024px) {
    .login-left-panel {
        display: block;
    }
}

.login-left-content {
    padding: 60px 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    overflow-y: auto;
    max-width: 500px;
}

.login-left-heading {
    font-size: 36px;
    font-weight: 700;
    color: white;
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.login-left-description {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
    margin-bottom: 0;
}

.login-left-features {
    margin-top: 40px;
    list-style: none;
    padding: 0;
}

.login-left-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.95);
}

.login-left-feature-item:last-child {
    margin-bottom: 0;
}

.login-left-feature-icon {
    width: 20px;
    height: 20px;
    color: white;
    flex-shrink: 0;
}

/* Right Panel (Login Card) */
.login-right-panel {
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: #FFFFFF;
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    box-sizing: border-box;
}

@media (min-width: 1024px) {
    .login-right-panel {
        width: 50%;
        background: #FFFFFF;
    }
}

/* Login Card */
.login-card {
    width: 100%;
    max-width: 440px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(74, 109, 213, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 48px 40px;
    animation: loginCardFadeIn 400ms ease 100ms both;
    max-height: calc(100vh - 48px);
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    body.login-page-body {
        overflow-x: hidden;
        position: relative;
    }
    
    .login-container {
        min-height: 100vh;
        overflow-x: hidden;
    }
    
    .login-card {
        padding: 24px 20px;
        max-width: 100%;
        max-height: none;
        width: 100%;
        box-sizing: border-box;
    }
    
    .login-right-panel {
        padding: 16px;
        align-items: flex-start;
        padding-top: 20px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .login-card-content {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .login-form-group {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .login-options-row {
        flex-wrap: wrap;
        gap: 12px;
    }
}

@keyframes loginCardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card-content {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Logo Section */
.login-logo-section {
    margin-bottom: 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.login-logo-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(74, 109, 213, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.login-logo-img {
    width: 96px;
    height: 96px;
    display: block;
    margin: 0 auto 20px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    object-fit: contain;
    position: relative;
    z-index: 1;
    animation: loginLogoFadeIn 600ms ease 200ms both;
}

@media (min-width: 769px) and (max-width: 1024px) {
    .login-logo-img {
        width: 88px;
        height: 88px;
    }
}

@media (max-width: 768px) {
    .login-logo-img {
        width: 80px;
        height: 80px;
    }
}

@keyframes loginLogoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.login-company-name {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    text-align: center;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
}

@media (min-width: 769px) and (max-width: 1024px) {
    .login-company-name {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .login-company-name {
        font-size: 19px;
    }
}

.login-tagline {
    font-size: 15px;
    color: #6B7280;
    text-align: center;
    margin: 0;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .login-tagline {
        font-size: 14px;
    }
}

/* Header Section */
.login-header {
    margin-bottom: 32px;
    text-align: center;
}

.login-welcome-text {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

@media (max-width: 768px) {
    .login-welcome-text {
        font-size: 24px;
    }
}

.login-subtitle {
    font-size: 15px;
    color: #6B7280;
    line-height: 1.5;
    margin: 0;
}

/* Form Styles */
.login-form-group {
    margin-bottom: 20px;
}

.login-form-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    display: block;
}

.login-form-input {
    height: 44px;
    padding: 0 14px;
    background: white;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    font-size: 15px;
    color: #111827;
    transition: all 200ms ease;
    width: 100%;
    max-width: 100%;
    font-family: inherit;
    box-sizing: border-box;
}

.login-form-input::placeholder {
    color: #9CA3AF;
    font-size: 15px;
}

.login-form-input:focus {
    outline: none;
    border: 2px solid #4A6DD5;
    box-shadow: 0 0 0 3px rgba(74, 109, 213, 0.15);
    background: #FAFBFC;
}

/* Avoid double ring: we already style focus with border+box-shadow above */
.login-form-input:focus-visible {
    outline: none;
}

.login-form-input-error {
    border: 2px solid #EF4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.login-form-input-success {
    border: 2px solid #10B981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
}

.login-form-error {
    font-size: 13px;
    color: #EF4444;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.login-error-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Password Field */
.login-password-wrapper {
    position: relative;
}

.login-password-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9CA3AF;
    transition: color 150ms ease;
}

.login-password-toggle:hover {
    color: #6B7280;
}

.login-password-icon {
    width: 18px;
    height: 18px;
}

/* Remember Me & Forgot Password Row */
.login-options-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 24px 0;
}

.login-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.login-checkbox {
    width: 18px;
    height: 18px;
    border: 1.5px solid #D1D5DB;
    border-radius: 4px;
    background: white;
    transition: all 150ms ease;
    cursor: pointer;
    appearance: none;
    position: relative;
    flex-shrink: 0;
}

.login-checkbox:checked {
    background: #4A6DD5;
    border-color: #4A6DD5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-size: 12px 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.login-checkbox:focus {
    outline: 2px solid #4A6DD5;
    outline-offset: 2px;
}

.login-checkbox-label-text {
    font-size: 14px;
    color: #374151;
    font-weight: 400;
}

.login-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #6B7280;
    text-decoration: none;
    transition: color 150ms ease;
    margin-bottom: 16px;
}

.login-back-link:hover {
    color: #4A6DD5;
}

.login-back-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.login-forgot-link {
    font-size: 14px;
    font-weight: 500;
    color: #4A6DD5;
    text-decoration: none;
    transition: color 150ms ease;
}

.login-forgot-link:hover {
    color: #3B5BBF;
    text-decoration: underline;
}

/* Sign In Button */
.login-submit-btn {
    width: 100%;
    height: 44px;
    background: #4A6DD5;
    color: white !important;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms ease;
    box-shadow: 0 4px 6px -1px rgba(74, 109, 213, 0.3);
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.login-submit-btn,
.login-submit-btn span,
.login-submit-btn * {
    color: white !important;
}

.login-submit-btn:hover:not(:disabled) {
    background: #3B5BBF;
    box-shadow: 0 4px 6px -1px rgba(74, 109, 213, 0.4);
    transform: translateY(-1px);
}

.login-submit-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px -1px rgba(74, 109, 213, 0.3);
}

.login-submit-btn:disabled,
.login-submit-btn-disabled {
    background: #E5E7EB !important;
    color: #9CA3AF !important;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.6;
}

.login-submit-btn-disabled span,
.login-submit-btn-disabled * {
    color: #9CA3AF !important;
}

.login-submit-btn-loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.login-submit-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-submit-spinner {
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Footer */
.login-footer {
    margin-top: 32px;
    text-align: center;
}

.login-footer-text {
    font-size: 13px;
    color: #9CA3AF;
    margin: 0;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .login-container {
        background: linear-gradient(to bottom, #FAFBFC, #F3F4F6);
    }
    
    .login-right-panel {
        padding: 16px;
    }
    
    .login-card {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    }
}

/* Accessibility - Focus States (login-form-input has its own focus style above) */
.login-checkbox:focus-visible,
.login-submit-btn:focus-visible,
.login-forgot-link:focus-visible {
    outline: 2px solid #4A6DD5;
    outline-offset: 2px;
}

/* Keyboard Navigation */
.login-submit-btn:focus-visible {
    outline: 2px solid #4A6DD5;
    outline-offset: 2px;
}

/* ============================================
   AGREEMENT DETAILS PAGE STYLES
   ============================================ */

/* Page Header Actions */
.page-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Month filter tabs (invoices index) */
.month-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #F3F4F6;
    padding: 3px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
}

.month-tab {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #6B7280;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
}

.month-tab:hover {
    color: #374151;
    background: rgba(255, 255, 255, 0.8);
}

.month-tab.active {
    color: #fff;
    background: #4A6DD5;
}

.month-tab.active:hover {
    background: #3d5bc4;
}

/* Client status tabs (Active / Inactive) */
.status-tabs {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: #F3F4F6;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    flex-shrink: 0;
}

.status-tab {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    line-height: 1.25;
    color: #6B7280;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
    white-space: nowrap;
}

.status-tab:hover {
    color: #374151;
    background: rgba(255, 255, 255, 0.8);
}

.status-tab.active {
    color: #fff;
    background: #4A6DD5;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.status-tab.active:hover {
    background: #3d5bc4;
}

/* Back Button */
.btn-back {
    background: white;
    border: 1px solid #E5E7EB;
    color: #374151;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 150ms ease;
    cursor: pointer;
}

.btn-back:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

/* Edit Button */
.btn-edit {
    background: #4A6DD5;
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 150ms ease;
    box-shadow: 0 1px 2px 0 rgba(74, 109, 213, 0.3);
}

.btn-edit:hover {
    background: #3B5BBF;
    box-shadow: 0 4px 6px -1px rgba(74, 109, 213, 0.4);
}

/* Success Alert */
.agreement-success-alert {
    background: #D1FAE5;
    border: 1px solid #A7F3D0;
    border-left: 4px solid #10B981;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-icon {
    width: 20px;
    height: 20px;
    color: #10B981;
    flex-shrink: 0;
}

.alert-title {
    font-size: 14px;
    font-weight: 600;
    color: #065F46;
    margin-bottom: 2px;
}

.alert-message {
    font-size: 14px;
    color: #047857;
}

.alert-close {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: transparent;
    border: none;
    color: #6B7280;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 150ms ease;
    flex-shrink: 0;
}

.alert-close:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Agreement Details Grid */
.agreement-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 1200px;
}

@media (max-width: 1024px) {
    .agreement-details-grid {
        grid-template-columns: 1fr;
    }
}

/* Agreement Detail Card */
.agreement-detail-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.agreement-card-full-width {
    grid-column: span 2;
}

@media (max-width: 1024px) {
    .agreement-card-full-width {
        grid-column: span 1;
    }
}

/* Card Section Header */
.card-section-header {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #F3F4F6;
}

/* Data Rows */
.data-rows {
    display: grid;
    gap: 16px;
}

/* Data Item */
.data-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Data Label */
.data-label {
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Data Value */
.data-value {
    font-size: 15px;
    font-weight: 400;
    color: #111827;
    word-break: break-word;
}

/* Email Value */
.data-value-email {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4A6DD5;
}

.email-link {
    color: #4A6DD5;
    text-decoration: none;
    transition: color 150ms ease;
}

.email-link:hover {
    color: #3B5BBF;
    text-decoration: underline;
}

/* Phone Value */
.data-value-phone {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Payment Value */
.data-value-payment {
    font-size: 18px;
    font-weight: 600;
}

.payment-amount {
    color: #111827;
}

/* Date Value */
.data-value-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6B7280;
    font-size: 14px;
}

/* Status Badge */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge-pending {
    background: #FEF3C7;
    color: #92400E;
}

.status-badge-completed {
    background: #D1FAE5;
    color: #065F46;
}

.status-badge-expired {
    background: #FEE2E2;
    color: #991B1B;
}

.status-badge-neutral {
    background: #F3F4F6;
    color: #4B5563;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #F59E0B;
    display: inline-block;
}

/* Action Buttons Layout */
.action-buttons-layout {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Primary Action Button */
.btn-action-primary {
    background: #4A6DD5;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: none;
    cursor: pointer;
    transition: all 200ms ease;
    box-shadow: 0 1px 2px 0 rgba(74, 109, 213, 0.3);
    text-decoration: none;
    box-sizing: border-box;
    white-space: nowrap;
}

.btn-action-primary:hover {
    background: #3B5BBF;
    box-shadow: 0 4px 6px -1px rgba(74, 109, 213, 0.4);
}

/* Secondary Action Button */
.btn-action-secondary {
    background: white;
    border: 1px solid #E5E7EB;
    color: #374151;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 200ms ease;
    text-decoration: none;
    box-sizing: border-box;
    white-space: nowrap;
}

.btn-action-secondary:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

/* Link Container */
.link-container {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Link Text */
.link-text {
    font-size: 14px;
    color: #4A6DD5;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    flex: 1;
    word-break: break-all;
    user-select: all;
}

/* Link Copy Button */
.link-copy-button {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: white;
    border: 1px solid #E5E7EB;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 150ms ease;
    flex-shrink: 0;
}

.link-copy-button:hover {
    background: #F3F4F6;
}

.link-copy-button:active {
    transform: scale(0.95);
}

.link-copy-icon {
    width: 16px;
    height: 16px;
    color: #6B7280;
    transition: color 200ms ease;
}

/* Documents List */
.documents-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.document-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: #F9FAFB;
}

.document-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.document-icon {
    color: #9CA3AF;
    flex-shrink: 0;
}

.document-name {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 2px;
}

.document-filename {
    font-size: 12px;
    color: #6B7280;
}

.document-size {
    font-size: 12px;
    color: #6B7280;
    flex-shrink: 0;
}

/* ============================================
   AGREEMENTS LIST PAGE STYLES
   ============================================ */

/* New Agreement Button */
.btn-new-agreement {
    background: #4A6DD5;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: all 200ms ease;
    box-shadow: 0 1px 2px 0 rgba(74, 109, 213, 0.3);
    border: none;
    cursor: pointer;
    letter-spacing: normal;
}

.btn-new-agreement:hover {
    background: #3B5BBF;
    box-shadow: 0 4px 6px -1px rgba(74, 109, 213, 0.4);
    transform: translateY(-1px);
    text-decoration: none;
    color: white;
}

.btn-new-agreement i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Search and Filter Container */
.agreements-search-container {
    margin-bottom: 24px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.agreements-search-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
}

.agreements-search-input-wrapper {
    flex: 1;
    position: relative;
}

.agreements-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #9CA3AF;
    pointer-events: none;
    z-index: 1;
}

.agreements-search-input {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 40px;
    background: white;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    transition: all 150ms ease;
    box-sizing: border-box;
}

.agreements-search-input:focus {
    outline: none;
    border: 2px solid #4A6DD5;
    box-shadow: 0 0 0 3px rgba(74, 109, 213, 0.1);
}

.agreements-search-input:focus-visible {
    outline: none;
}

.agreements-status-select {
    width: 180px;
    height: 44px;
    padding: 0 40px 0 16px;
    background: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    transition: all 150ms ease;
    cursor: pointer;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.agreements-status-select:focus {
    outline: none;
    border: 2px solid #4A6DD5;
    box-shadow: 0 0 0 3px rgba(74, 109, 213, 0.1);
}

.agreements-status-select:focus-visible {
    outline: none;
}

/* Agreements Table */
.agreements-table {
    width: 100%;
    border-collapse: collapse;
}

.agreements-table thead {
    background: #F9FAFB;
    border-bottom: 1px solid #E5E7EB;
}

.agreements-th {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6B7280;
    padding: 12px 16px;
    text-align: left;
}

.agreements-th.text-right {
    text-align: right;
}

.agreements-table tbody tr {
    border-bottom: 1px solid #E5E7EB;
    transition: background-color 150ms ease;
}

.agreements-table tbody tr:hover {
    background-color: #F9FAFB;
}

.agreements-table tbody td {
    padding: 16px;
    font-size: 14px;
    vertical-align: middle;
}

.agreements-table tbody td.text-right {
    text-align: right;
    padding-right: 16px;
}

/* Action Buttons */
.agreements-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    justify-content: flex-end;
}

.btn-action-view,
.btn-action-edit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    color: #4A6DD5;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 150ms ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.btn-action-view:hover,
.btn-action-edit:hover {
    background: #F3F4F6;
    text-decoration: none;
    color: #4A6DD5;
}

.btn-action-view i,
.btn-action-edit i {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Loading Spinner */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .agreements-search-container {
        display: flex;
        justify-content: flex-start;
        align-items: flex-start;
    }
    
    .agreements-search-wrapper {
        flex-direction: column;
        width: 100%;
        align-items: flex-start;
        justify-content: flex-start;
    }
    
    .agreements-search-input-wrapper {
        width: 100%;
    }
    
    .agreements-status-select {
        width: 100%;
    }
    
    .agreements-actions {
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
    }
    
    .btn-action-view,
    .btn-action-edit {
        width: 100%;
        justify-content: center;
    }
    
    .agreement-details-grid {
        padding: 16px;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .page-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .btn-back,
    .btn-edit {
        flex: 1;
        min-width: 120px;
    }
    
    .action-buttons-layout {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        gap: 8px;
    }
    
    .action-buttons-layout form.inline-block,
    .action-buttons-layout .inline-block {
        width: 100%;
        max-width: 100%;
        display: block;
    }
    
    .btn-action-primary,
    .btn-action-secondary {
        width: 100%;
        max-width: 100%;
        justify-content: center;
        box-sizing: border-box;
    }
    
    .link-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .link-copy-button {
        width: 100%;
        height: 40px;
    }
}

/* Settings Page Styles */
.settings-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color, #E5E7EB);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-label label {
    font-weight: 500;
    color: var(--text-primary, #111827);
    display: block;
    margin-bottom: 0.25rem;
}

.settings-hint {
    font-size: 0.875rem;
    color: var(--text-secondary, #6B7280);
    margin: 0;
}

.settings-value {
    text-align: right;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin-bottom: 1.5rem;
}

/* Settings – compact tab bar */
.settings-tabs {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 20px;
    padding: 4px;
    background: #F1F5F9;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
}
.settings-tab {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #64748B;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.settings-tab:hover {
    color: #334155;
    background: rgba(255, 255, 255, 0.8);
}
.settings-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #4A6DD5 0%, #3B5BBF 100%);
    box-shadow: 0 1px 3px rgba(74, 109, 213, 0.2);
}
.settings-tab.active:hover {
    background: linear-gradient(135deg, #3B5BBF 0%, #2D4AA3 100%);
    box-shadow: 0 2px 6px rgba(74, 109, 213, 0.25);
}
.settings-tab.active i {
    color: inherit;
}
.settings-form-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 14px;
    margin-top: 8px;
    border-top: 1px solid #E2E8F0;
}
.settings-tab-content {
    display: none;
}
.settings-tab-content.active {
    display: block;
}

.settings-panel {
    padding: 0;
}

/* Settings summary – compact tiles */
.settings-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.settings-summary-item {
    padding: 12px 14px;
    background: #FAFBFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    transition: border-color 0.15s ease;
}
.settings-summary-item:hover {
    border-color: #CBD5E1;
}
.settings-summary-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748B;
    margin-bottom: 4px;
}
.settings-summary-value {
    font-size: 14px;
    font-weight: 600;
    color: #0F172A;
}

/* Account tab – clean list layout */
.settings-account-panel {
    padding: 0;
}
.settings-account-header {
    margin-bottom: 28px;
}
.settings-account-title {
    font-size: 18px;
    font-weight: 600;
    color: #0F172A;
    letter-spacing: -0.02em;
    margin: 0 0 4px 0;
}
.settings-account-description {
    font-size: 14px;
    color: #64748B;
    margin: 0;
    line-height: 1.45;
}
.settings-account-list {
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}
.settings-account-row {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 18px 24px;
    border-bottom: 1px solid #F3F4F6;
    min-height: 56px;
    box-sizing: border-box;
}
.settings-account-row:last-child {
    border-bottom: none;
}
.settings-account-row--editable {
    align-items: flex-start;
    flex-wrap: wrap;
}
.settings-account-row--editable form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
}
.settings-account-row--editable .settings-account-value--form {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.settings-account-label {
    font-size: 13px;
    color: #6B7280;
    flex: 0 0 120px;
    font-weight: 500;
}
.settings-account-value {
    font-size: 15px;
    font-weight: 500;
    color: #111827;
    flex: 1;
    min-width: 0;
}
.settings-account-input {
    max-width: 320px;
    min-width: 200px;
}
.settings-account-error {
    flex: 1 1 100%;
    margin-left: 144px;
    margin-top: 6px;
}
@media (max-width: 640px) {
    .settings-account-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 16px 20px;
    }
    .settings-account-label {
        flex: none;
    }
    .settings-account-row--editable .settings-account-value--form {
        flex-direction: column;
        align-items: stretch;
    }
    .settings-account-input {
        max-width: none;
        min-width: 0;
    }
    .settings-account-error {
        margin-left: 0;
    }
}

/* Settings info card */
.settings-info-card {
    margin-bottom: 16px;
    padding: 12px 14px;
    background: #FAFBFC;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    border-left: 3px solid #4A6DD5;
}
.settings-info-card .settings-info-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748B;
    margin-bottom: 2px;
}
.settings-info-card .settings-info-value {
    font-size: 14px;
    font-weight: 600;
    color: #0F172A;
}
.settings-info-card .settings-info-meta {
    font-size: 11px;
    color: #94A3B8;
    margin: 2px 0 0 0;
}

/* Settings block (logo) */
.settings-block {
    margin-bottom: 18px;
    padding: 14px 16px;
    background: #FAFBFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
}
.settings-block-title {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.settings-block-hint {
    font-size: 11px;
    color: #64748B;
    margin: 6px 0 0 0;
}
.settings-logo-preview {
    max-width: 120px;
    max-height: 48px;
    object-fit: contain;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 6px;
    background: #fff;
}
.settings-logo-placeholder {
    width: 120px;
    height: 48px;
    border: 1px dashed #CBD5E1;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F8FAFC;
    color: #94A3B8;
    font-size: 11px;
    font-weight: 500;
}
.settings-logo-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Collapsible – slim */
.settings-collapse {
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
    background: #fff;
}
.settings-collapse:hover {
    border-color: #CBD5E1;
}
.settings-collapse[open] {
    border-color: #CBD5E1;
}
.settings-collapse summary {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #FAFBFC;
    user-select: none;
    border-left: 3px solid transparent;
    transition: border-left-color 0.15s ease, background 0.15s ease;
}
.settings-collapse summary:hover {
    background: #F8FAFC;
}
.settings-collapse[open] summary {
    border-left-color: #4A6DD5;
    background: #F8FAFC;
}
.settings-collapse summary::-webkit-details-marker {
    display: none;
}
.settings-collapse summary::after {
    content: '';
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-left: 8px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748B' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") no-repeat center;
    background-size: 16px 16px;
    transition: transform 0.2s ease;
}
.settings-collapse[open] summary::after {
    transform: rotate(180deg);
}
.settings-collapse-content {
    padding: 14px 14px 14px 18px;
    border-top: 1px solid #E2E8F0;
    background: #fff;
}

/* Security action row */
.settings-action-card {
    padding: 14px 16px;
    background: #FAFBFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.settings-action-card .settings-action-label {
    font-size: 14px;
    font-weight: 600;
    color: #0F172A;
    margin-bottom: 2px;
}
.settings-action-card .settings-action-hint {
    font-size: 12px;
    color: #64748B;
    margin: 0;
}
.settings-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #0F172A;
    margin-bottom: 14px;
    letter-spacing: -0.01em;
}

/* Form Styles - Consolidated and matching Design System */
.form-container {
    max-width: 800px;
}

/* Override max-width for invoice form to accommodate line items */
#invoice-form.form-container {
    max-width: 100%;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #E5E7EB;
}

.form-section:last-of-type {
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.form-section-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 24px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-label .required {
    color: #EF4444;
}

/* Text Input, Number Input */
.form-input {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    color: #111827;
    background: white;
    transition: all 150ms ease;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: #9CA3AF;
}

/* Completely hide placeholder for number inputs in line items */
.line-item-row .form-input[type="number"]::placeholder {
    opacity: 0 !important;
    color: transparent !important;
    visibility: hidden !important;
}

/* Also hide any default browser placeholder behavior for number inputs */
.line-item-row .form-input[type="number"]::-webkit-input-placeholder {
    opacity: 0 !important;
    color: transparent !important;
}

.line-item-row .form-input[type="number"]::-moz-placeholder {
    opacity: 0 !important;
    color: transparent !important;
}

.line-item-row .form-input[type="number"]:-ms-input-placeholder {
    opacity: 0 !important;
    color: transparent !important;
}

.form-input:focus {
    outline: none;
    border: 2px solid #4A6DD5;
    box-shadow: 0 0 0 3px rgba(74, 109, 213, 0.1);
    padding: 0 11px; /* Compensate for 1px border increase */
}

.form-input:focus-visible {
    outline: none;
}

.form-input.error {
    border: 2px solid #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    padding: 0 11px; /* Compensate for 1px border increase */
}

/* Only show invalid state after user interaction */
.form-input:user-invalid:not(:placeholder-shown),
.form-input:invalid:not(:placeholder-shown):focus,
.form-input.touched:invalid:not(:placeholder-shown) {
    border: 2px solid #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
    padding: 0 11px;
}

/* Textarea */
textarea.form-input {
    height: auto;
    min-height: 120px;
    padding: 12px;
    resize: vertical;
    line-height: 1.5;
}

textarea.form-input:focus {
    padding: 11px; /* Compensate for 1px border increase */
}

/* Select Dropdown */
select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 36px;
    appearance: none;
    cursor: pointer;
}

select.form-input:focus {
    padding-right: 35px; /* Compensate for 1px border increase */
}

/* Checkbox */
.form-input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    margin-right: 8px;
    margin-top: 0;
    margin-bottom: 0;
    padding: 0;
    border: 1.5px solid #D1D5DB;
    border-radius: 4px;
    appearance: none;
    background-color: white;
    cursor: pointer;
    position: relative;
    vertical-align: middle;
    flex-shrink: 0;
}

.form-input[type="checkbox"]:checked {
    background-color: #4A6DD5;
    border-color: #4A6DD5;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='white'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-size: 12px 12px;
    background-position: center;
    background-repeat: no-repeat;
}

.form-input[type="checkbox"]:focus {
    outline: 2px solid #4A6DD5;
    outline-offset: 2px;
    border: 1.5px solid #4A6DD5;
    box-shadow: none;
    padding: 0;
}

/* Checkbox label styling - when label contains checkbox */
.form-label input[type="checkbox"] {
    margin-bottom: 0;
}

/* Ensure checkbox labels display properly */
.form-label:has(> input[type="checkbox"]),
.form-label input[type="checkbox"] + span {
    display: flex;
    align-items: center;
}

.form-error {
    color: #EF4444;
    font-size: 12px;
    margin-top: 6px;
    display: block;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 2rem;
    border-top: none;
    margin-top: 2rem;
}

/* Remove border and adjust margin when form-actions follows last form-section */
.form-section:last-of-type + .form-actions {
    border-top: none;
    margin-top: 0;
}

/* Form Value Display (for show pages) */
.form-value {
    font-size: 14px;
    color: #111827;
    padding: 8px 0;
    line-height: 1.5;
    min-height: 24px;
}

#line-items-container {
    width: 100%;
    box-sizing: border-box;
}

.line-item-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: end;
    width: 100%;
    box-sizing: border-box;
}

/* Unit Price container with delete button - divide 10:2 */
.unit-price-with-delete .unit-price-container {
    display: grid;
    grid-template-columns: 10fr 2fr;
    gap: 0.5rem;
    align-items: end;
    width: 100%;
}

.unit-price-with-delete .form-input {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0;
    box-sizing: border-box;
}

.unit-price-with-delete .delete-icon-btn {
    height: 40px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 150ms ease;
    padding: 0;
    color: #EF4444;
}

.unit-price-with-delete .delete-icon-btn:hover {
    background: #FEF2F2;
    color: #DC2626;
}

.unit-price-with-delete .delete-icon-btn i {
    width: 18px;
    height: 18px;
}

.line-item-row .form-group {
    min-width: 0 !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
}

.line-item-row .form-group .form-label {
    display: block !important;
    margin-bottom: 8px;
    flex-shrink: 0;
    width: 100%;
    position: relative;
    z-index: 1;
}

.line-item-row .form-group .form-input {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box;
    position: relative;
    z-index: 0;
}

.line-item-row .form-group:last-child {
    display: flex;
    align-items: flex-end;
    margin-bottom: 0;
}

/* Deduction Row Styles */
.deduction-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: end;
    width: 100%;
    box-sizing: border-box;
}

.deduction-row .form-group {
    min-width: 0 !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
}

.deduction-row .form-group:last-child {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.deduction-row .delete-icon-btn {
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 150ms ease;
    padding: 0;
    color: #EF4444;
}

.deduction-row .delete-icon-btn:hover {
    background: #FEF2F2;
    color: #DC2626;
}

.deduction-row .delete-icon-btn i {
    width: 18px;
    height: 18px;
}

/* Pending Row Styles */
.pending-row {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: end;
    width: 100%;
    box-sizing: border-box;
}

.pending-row .form-group {
    min-width: 0 !important;
    margin-bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: hidden;
}

.pending-row .form-group:last-child {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.pending-row .delete-icon-btn {
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 150ms ease;
    padding: 0;
    color: #EF4444;
}

.pending-row .delete-icon-btn:hover {
    background: #FEF2F2;
    color: #DC2626;
}

.pending-row .delete-icon-btn i {
    width: 18px;
    height: 18px;
}

/* General delete icon button (used across line item rows) */
.delete-icon-btn {
    height: 40px;
    width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 150ms ease;
    padding: 0;
    color: #6B7280;
}

.delete-icon-btn:hover {
    background: #FEF2F2;
    color: #DC2626;
}

.delete-icon-btn i {
    width: 18px;
    height: 18px;
}

/* Spinner Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@media (max-width: 768px) {
    .line-item-row {
        grid-template-columns: 1fr;
    }
    
    .line-item-row.line-item-required {
        grid-template-columns: 1fr;
    }
    
    .deduction-row {
        grid-template-columns: 1fr;
    }
    
    .pending-row {
        grid-template-columns: 1fr;
    }
}

/* Table Styles */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background-color: var(--bg-secondary, #F9FAFB);
}

.data-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary, #6B7280);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    padding: 1rem;
    border-top: 1px solid var(--border-color, #E5E7EB);
}

.data-table tbody tr:hover {
    background-color: var(--bg-secondary, #F9FAFB);
}

.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.action-btn {
    padding: 5px;
    border: 1px solid #E5E7EB;
    background: white;
    color: #374151;
    cursor: pointer;
    border-radius: 6px;
    transition: all 150ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    min-width: 28px;
    width: 28px;
    height: 28px;
    box-sizing: border-box;
    margin: 0;
    line-height: 1;
}

.action-btn:hover:not(:disabled):not(.disabled) {
    background-color: #F9FAFB;
    border-color: #D1D5DB;
    color: #111827;
}

.action-btn:active:not(:disabled):not(.disabled) {
    background-color: #F3F4F6;
    transform: translateY(0.5px);
}

.action-btn i {
    width: 15px !important;
    height: 15px !important;
    color: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-btn i svg {
    width: 15px !important;
    height: 15px !important;
    min-width: 15px !important;
    min-height: 15px !important;
    max-width: 15px !important;
    max-height: 15px !important;
}

/* Action button variants */
.action-btn.action-edit {
    color: #374151;
}

.action-btn.action-edit:hover:not(:disabled):not(.disabled) {
    color: #4A6DD5;
    border-color: #4A6DD5;
}

.action-btn.action-block {
    color: #374151;
}

.action-btn.action-block:hover:not(:disabled):not(.disabled) {
    color: #F59E0B;
    border-color: #F59E0B;
}

.action-btn.action-unblock {
    color: #374151;
}

.action-btn.action-unblock:hover:not(:disabled):not(.disabled) {
    color: #10B981;
    border-color: #10B981;
}

.action-btn.action-delete {
    color: #374151;
}

.action-btn.action-delete:hover:not(:disabled):not(.disabled) {
    color: #EF4444;
    border-color: #EF4444;
}

.action-btn.action-view {
    color: #374151;
}

.action-btn.action-view:hover:not(:disabled):not(.disabled) {
    color: #6B7280;
    border-color: #9CA3AF;
}

.action-btn:disabled,
.action-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: #F9FAFB;
    border-color: #E5E7EB;
}

.action-btn:disabled:hover,
.action-btn.disabled:hover {
    background: #F9FAFB;
    border-color: #E5E7EB;
    color: #374151;
    transform: none;
}

/* Tooltip for action buttons */
.action-btn {
    position: relative;
}

.action-btn::after {
    content: attr(title);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #1F2937;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms ease, transform 200ms ease;
    z-index: 10000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.action-btn::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1F2937;
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms ease, visibility 200ms ease;
    pointer-events: none;
    z-index: 10001;
}

/* Position tooltip to the right for the delete button to prevent clipping */
.action-btn.action-delete::after {
    left: auto;
    right: 0;
    transform: none;
}

.action-btn.action-delete::before {
    left: auto;
    right: 12px;
    transform: none;
}

.action-btn.action-delete:hover:not(:disabled):not(.disabled)::after {
    transform: translateY(-2px);
}

/* Tooltips only on hover so they hide when mouse leaves or after click (no :focus) */
.action-btn:hover:not(:disabled):not(.disabled)::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-2px);
}

.action-btn:hover:not(:disabled):not(.disabled)::before {
    opacity: 1;
    visibility: visible;
}

/* Position tooltip to the left for resend button (last button in actions) to prevent clipping */
.table-actions form:last-child .action-btn::after,
.action-btn[title="Resend Invoice"]::after {
    left: auto;
    right: 0;
    transform: none;
}

.table-actions form:last-child .action-btn::before,
.action-btn[title="Resend Invoice"]::before {
    left: auto;
    right: 12px;
    transform: none;
}

.table-actions form:last-child .action-btn:hover:not(:disabled):not(.disabled)::after,
.action-btn[title="Resend Invoice"]:hover:not(:disabled):not(.disabled)::after {
    transform: translateY(-2px);
}

/* Hide tooltips when modals are open */
body[style*="overflow: hidden"] .action-btn::after,
body[style*="overflow: hidden"] .action-btn::before {
    opacity: 0 !important;
    visibility: hidden !important;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-draft {
    background-color: #e5e7eb;
    color: #374151;
}

.status-sent {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-viewed {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-paid {
    background-color: #d1fae5;
    color: #065f46;
}

.status-partial {
    background-color: #fef3c7;
    color: #92400e;
}

.status-overdue {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-cancelled {
    background-color: #e5e7eb;
    color: #6b7280;
}

.status-active {
    background-color: #d1fae5;
    color: #065f46;
}

.status-inactive {
    background-color: #e5e7eb;
    color: #6b7280;
}

.pagination-wrapper {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

.btn-danger {
    background: #EF4444;
    color: white;
    box-shadow: 0 1px 2px 0 rgba(239, 68, 68, 0.3);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 200ms ease;
}

.btn-danger:hover {
    background: #DC2626;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.4);
    text-decoration: none;
    color: white;
    transform: translateY(-1px);
}

.btn-danger i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Phone Input with Flag Selector */
.phone-input-wrapper {
    position: relative;
}

.phone-input-container {
    display: flex;
    align-items: center;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    background: white;
    transition: all 150ms ease;
    height: 40px;
}

.phone-input-container:focus-within {
    border: 2px solid #4A6DD5;
    box-shadow: 0 0 0 3px rgba(74, 109, 213, 0.1);
}

.phone-flag-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    background: transparent;
    border: none;
    border-right: 1px solid #E5E7EB;
    cursor: pointer;
    transition: background 150ms ease;
    height: 40px;
    flex-shrink: 0;
}

.phone-flag-selector:hover {
    background: #F9FAFB;
}

.phone-flag-icon {
    font-size: 20px;
    line-height: 1;
    width: 24px;
    text-align: center;
    display: inline-block;
}

.phone-country-code {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    min-width: 32px;
}

.phone-flag-chevron {
    width: 16px;
    height: 16px;
    color: #6B7280;
    transition: transform 150ms ease;
    flex-shrink: 0;
}

.phone-flag-selector.active .phone-flag-chevron {
    transform: rotate(180deg);
}

.phone-number-input {
    flex: 1;
    border: none;
    padding: 0 12px;
    height: 40px;
    border-radius: 0;
    background: transparent;
}

.phone-number-input:focus {
    outline: none;
    box-shadow: none;
    border: none;
}

.phone-input-container:focus-within .phone-number-input {
    border: none;
}

/* Flag Dropdown */
.phone-flag-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    max-height: 300px;
    overflow: hidden;
    display: none;
}

.phone-flag-dropdown.show {
    display: flex;
    flex-direction: column;
}

.phone-flag-search {
    padding: 12px;
    border-bottom: 1px solid #E5E7EB;
    background: #FAFBFC;
}

.phone-flag-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    box-sizing: border-box;
}

.phone-flag-search-input:focus {
    outline: none;
    border-color: #4A6DD5;
    box-shadow: 0 0 0 3px rgba(74, 109, 213, 0.1);
}

.phone-flag-search-input:focus-visible {
    outline: none;
}

.phone-flag-list {
    overflow-y: auto;
    max-height: 240px;
}

.phone-flag-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 150ms ease;
    border-bottom: 1px solid #F3F4F6;
}

.phone-flag-item:last-child {
    border-bottom: none;
}

.phone-flag-item:hover {
    background: #F9FAFB;
}

.phone-flag-item.selected {
    background: #EEF2FF;
    color: #4A6DD5;
}

.phone-flag-item-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
}

.phone-flag-item-name {
    flex: 1;
    font-size: 14px;
    color: #111827;
    font-weight: 500;
}

.phone-flag-item-code {
    font-size: 13px;
    color: #6B7280;
    font-weight: 500;
    min-width: 50px;
    text-align: right;
}

.phone-flag-item.selected .phone-flag-item-name {
    color: #4A6DD5;
    font-weight: 600;
}

.phone-flag-item.selected .phone-flag-item-code {
    color: #4A6DD5;
}

/* Confirmation Modal Styles */
[x-cloak] {
    display: none !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.3s ease-out;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

.modal-overlay-enter {
    animation: modal-overlay-in 320ms cubic-bezier(0.22, 1, 0.36, 1);
    animation-fill-mode: forwards;
}

.modal-overlay-leave {
    animation: modal-overlay-out 220ms cubic-bezier(0.4, 0, 1, 1);
    animation-fill-mode: forwards;
}

@keyframes modal-overlay-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modal-overlay-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.modal-container {
    position: relative;
    width: 100%;
    max-width: 32rem;
    z-index: 10000;
}

.modal-container-enter {
    animation: modal-container-in 320ms cubic-bezier(0.22, 1, 0.36, 1);
    animation-fill-mode: forwards;
}

.modal-container-leave {
    animation: modal-container-out 220ms cubic-bezier(0.4, 0, 1, 1);
    animation-fill-mode: forwards;
}

@keyframes modal-container-in {
    from {
        opacity: 0;
        transform: translateY(0);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modal-container-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(0);
    }
}

.modal-content {
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.modal-show .modal-content,
.modal-content {
    animation: modal-appear 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modal-appear {
    from {
        opacity: 0;
        transform: translateY(0);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(74, 109, 213, 0.1), rgba(59, 91, 191, 0.05));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 32px 20px 32px;
    background: linear-gradient(to bottom, #FAFBFC 0%, #FFFFFF 100%);
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4A6DD5 0%, #3B5BBF 50%, #4A6DD5 100%);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 16px;
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.15), 0 4px 8px -2px rgba(0, 0, 0, 0.1);
    position: relative;
    border: 3px solid rgba(255, 255, 255, 0.8);
}

.modal-icon::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    padding: 2px;
    background: linear-gradient(135deg, rgba(74, 109, 213, 0.2), rgba(59, 91, 191, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-icon:hover::before {
    opacity: 1;
}

.modal-icon i {
    width: 32px;
    height: 32px;
    position: relative;
    z-index: 1;
    stroke-width: 2.5;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0;
    width: 100%;
    letter-spacing: -0.03em;
    line-height: 1.3;
}

.modal-body {
    padding: 20px 32px;
    text-align: center;
    background: white;
    position: relative;
}

.modal-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #E5E7EB, transparent);
}

.modal-message {
    font-size: 15px;
    color: #4B5563;
    line-height: 1.7;
    margin: 0;
    font-weight: 400;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 32px 28px 32px;
    border-top: 1px solid #F3F4F6;
    background: linear-gradient(to bottom, #FFFFFF 0%, #FAFBFC 100%);
    position: relative;
}

.modal-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 32px;
    right: 32px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #E5E7EB, transparent);
}

.resend-spinner {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.resend-spinner span {
    width: 14px;
    height: 14px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: resend-spin 0.9s linear infinite;
    display: inline-block;
}

@keyframes resend-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Danger/Delete Modal Variant */
.modal-icon.danger {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2), 0 2px 4px -1px rgba(239, 68, 68, 0.1);
}

.modal-icon.danger i {
    color: #DC2626;
}

.modal-icon.danger::before {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.2));
}

.modal-icon.success {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2), 0 2px 4px -1px rgba(16, 185, 129, 0.1);
}

.modal-icon.success i {
    color: #059669;
}

.modal-icon.success::before {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.2));
}

.modal-icon.info {
    background: linear-gradient(135deg, #DBEAFE 0%, #BFDBFE 100%);
    box-shadow: 0 4px 6px -1px rgba(74, 109, 213, 0.2), 0 2px 4px -1px rgba(74, 109, 213, 0.1);
}

.modal-icon.info i {
    color: #2563EB;
}

.modal-icon.info::before {
    background: linear-gradient(135deg, rgba(74, 109, 213, 0.2), rgba(37, 99, 235, 0.2));
}

/* Alert System */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    animation: alertSlideIn 0.3s ease-out;
}

.alert-success {
    background: #D1FAE5;
    border-color: #10B981;
    color: #065F46;
}

.alert-error {
    background: #FEE2E2;
    border-color: #EF4444;
    color: #991B1B;
}

.mb-6 {
    margin-bottom: 24px;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


