﻿/* =======================
   FONT & ROOT VARIABLES
======================= */
@font-face {
    font-family: "DM Sans";
    src: url("../Fonts/dm-sans-semibold.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: "DM Sans";
    src: url("../Fonts/dm-sans-latin-400-normal.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
}

:root {
    --main-color-logo: #2b8ff2;
    --main-color-dark: #011427;
    --main-color-hover: #09549e;
    --main-radius: 40px;
    --tab-radius: 20px;
    --background: #ebebeb;
    --max-width: 1230px;
    --font-dm-sans: "DM Sans", sans-serif;
    --dark: #011427;
    --font-awesome: "Font Awesome 7 Free";
    --linear-gradient: linear-gradient(135deg, #7b5cff, #5fe0d4);
    --text-grey: #666;
    --input-border: #e0e0e0;
    --input-focus: #667eea;
    --input-text: #333;
}

/* =======================
   GLOBAL RESETS & BASE
======================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-dm-sans);
    color: var(--main-color-dark);
    background-color: #fff;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

.h2 {
    font-size: 4.5rem;
    margin: 2rem 0;
}

/* =======================
   LAYOUT STRUCTURE
======================= */
.container {
    max-width: var(--max-width);
    width: 100%;
    margin: 0 auto;
    position: relative;
    padding: 40px 20px;
    min-width: 0;
}

.container-full {
    width: 100%;
}

section {
    display: grid;
    min-width: 0;
}

    section + section {
        margin-top: 5rem;
    }

header {
    background-color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

footer {
    background-color: var(--dark);
    color: #fff;
    text-align: center;
    padding: 2rem 0;
    font-size: 0.9rem;
}

    footer ul li {
        list-style: none;
    }

.bottom-underline-full {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.link-standard {
    color: var(--main-color-logo);
    text-decoration: none;
    transition: all .3s ease;
}

    .link-standard:hover {
        color: var(--main-color-hover);
    }
.legal-section {
    margin-top: 0!important;
}
/* =======================
   NAVIGATION
======================= */
.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /*margin: 30px 0;*/
}

.brand-logo img {
    max-width: 200px;
    height: auto;
}

.navigation ul {
    display: flex;
    align-items: center;
    gap: 40px;
    list-style: none;
}

.nav-item a {
    text-decoration: none;
    color: var(--main-color-dark);
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.2s;
}

    .nav-item a:hover {
        color: var(--main-color-logo);
    }

/* =======================
   BUTTONS & TABS
======================= */
.btn, .tab {
    border: 1px solid var(--main-color-logo);
    border-radius: var(--main-radius);
    display: inline-block;
}

.tab {
    border-radius: 0;
    border-top-left-radius: var(--tab-radius);
    border-top-right-radius: var(--tab-radius);
    display: block;
    width: fit-content;
}

    .btn a, .tab a {
        padding: 10px 30px;
        text-decoration: none;
        display: block;
    }

.btn-full {
    background: var(--linear-gradient);
}

    .btn-full a {
        color: #fff;
    }

.btn-border-only a {
    color: var(--main-color-logo);
}

/* === BASE BUTTON (Module-specific) === */
.btn-main {
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    white-space: nowrap;
    display: flex;
    padding: 7px;
    align-items: center;
    text-decoration: none;
    color: #ffffff;
    font-size: 0.8rem;
    background: var(--main-color-logo);
}

    .btn-main i {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

/* === BUTTON VARIANTS === */
.btn-main-secondary {
    color: var(--main-color-logo);
    background: #ffffff;
    border: 2px solid var(--main-color-logo);
}

    .btn-main-secondary:hover {
        background: #f0f7ff;
    }

.btn-main-danger {
    color: #c62828;
    background: #ffebee;
}

    .btn-main-danger:hover {
        background: #ffcdd2;
    }

.btn-main-sm {
    padding: 8px 16px;
    font-size: 13px;
    width: fit-content;
}

/* =======================
   COMMON MODULE STYLES
======================= */

/* === Page Header (used in all modules) === */
.page-header {
    margin-bottom: 36px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}

.page-breadcrumb {
    font-size: 14px;
    color: #6b7280;
}

/* === Module Headers === */
.clients-header,
.services-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

    .clients-header h1,
    .services-header h1 {
        font-size: 32px;
        font-weight: 600;
        color: #1a1a1a;
        margin-bottom: 10px;
    }

    .clients-header p,
    .services-header p {
        font-size: 16px;
        color: #666;
    }

/* === Messages === */
.message-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.message-error {
    display: block;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 24px;
}
.message-error.field-validation-valid { display: none; }

/* === Table Wrappers (common for all modules) === */
.clients-table-wrapper,
.services-table-wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

/* === Tables (common structure) === */
.clients-table,
.services-table {
    width: 100%;
    border-collapse: collapse;
}

    .clients-table thead,
    .services-table thead {
        background: #f8f9fa;
        border-bottom: 2px solid #e9ecef;
    }

    .clients-table th,
    .services-table th {
        padding: 16px;
        text-align: left;
        font-weight: 600;
        color: #495057;
    }

        .clients-table th.text-center,
        .services-table th.text-center {
            text-align: center;
        }

    .clients-table tbody tr,
    .services-table tbody tr {
        border-bottom: 1px solid #e9ecef;
    }

    .clients-table td,
    .services-table td {
        padding: 16px;
        color: #495057;
    }

        .clients-table td.text-center,
        .services-table td.text-center {
            text-align: center;
        }

/* === Action Buttons (common for all modules) === */
.actions-group {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    text-decoration: none;
}

.btn-view {
    background: #e3f2fd;
    color: #1976d2;
}

    .btn-view:hover {
        background: #bbdefb;
        transform: translateY(-2px);
    }

.btn-edit {
    background: #fff3e0;
    color: #f57c00;
}

    .btn-edit:hover {
        background: #ffe0b2;
        transform: translateY(-2px);
    }

.btn-delete,
.btn-deactivate {
    background: #ffebee;
    color: #c62828;
}

    .btn-delete:hover,
    .btn-deactivate:hover {
        background: #ffcdd2;
        transform: translateY(-2px);
    }

.btn-activate {
    background: #e8f5e9;
    color: #2e7d32;
}

    .btn-activate:hover {
        background: #c8e6c9;
        transform: translateY(-2px);
    }

/* === Status Badges === */
.badge-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    width:100px;
    justify-content: center;
}

.badge-active {
    background: #d4edda;
    color: #155724;
}

.badge-inactive {
    background: #f8d7da;
    color: #721c24;
}

/* === Empty State (common for all modules) === */
.empty-state {
    background: white;
    border-radius: 12px;
    padding: 60px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.empty-state-icon {
    font-size: 64px;
    color: #ddd;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
}

/* === Form Container === */
.form-container {
    background: white;
    border-radius: 12px;
    padding: 40px 48px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    border: 1px solid #e9ecef;
    margin-bottom: 24px;
}

.form-section {
    margin-bottom: 36px;
    padding-bottom: 36px;
    border-bottom: 1px solid #f0f0f0;
}

.form-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.section-header {
    font-size: 15px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* === Form Actions === */
.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 8px;
}

/* === Required Indicator === */
.required {
    color: #e74c3c;
}

/* === Details View === */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px 40px;
    margin-bottom: 28px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-label {
    font-weight: 600;
    color: #666;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-value {
    color: #1a1a1a;
    font-size: 15px;
}

/* =======================
   FORMS - STANDARDIZED
======================= */

/* Form Container */
.login-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 4rem;
    margin: 4rem auto;
    width: 100%;
    max-width: 500px;
}

.login-header {
    margin-bottom: 1rem;
}

    .login-header h1 {
        color: var(--input-text);
        font-size: 28px;
        margin-bottom: 1rem;
    }

    .login-header p {
        color: var(--main-color-logo);
        font-size: 1.2rem;
        font-weight: 500;
    }

/* Form Layout */
.form-group {
    margin-bottom: 24px;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 0;
}

.form-group.half {
    flex: 1;
    margin-bottom: 24px;
}

.form-group.third {
    flex: 1;
    min-width: 0;
    margin-bottom: 24px;
}

/* Labels */
label {
    display: block;
    margin-bottom: 8px;
    color: var(--input-text);
    font-weight: 500;
    font-size: 14px;
}

/* All Form Inputs - STANDARDIZED */
.form-input,
input.form-input,
select.form-input,
textarea.form-input,
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--input-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font-dm-sans);
    color: var(--input-text);
    background-color: #fff;
    transition: border-color 0.3s;
}

    .form-input:focus,
    input.form-input:focus,
    select.form-input:focus,
    textarea.form-input:focus,
    input[type="text"]:focus,
    input[type="password"]:focus,
    input[type="email"]:focus,
    input[type="tel"]:focus,
    input[type="number"]:focus {
        outline: none;
        border-color: var(--input-focus);
    }

    /* Select Dropdown Arrow */
    .form-input select,
    select.form-input,
    select {
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 35px;
    }

/* Textarea Specific */
textarea.form-input,
textarea {
    resize: vertical;
    min-height: 100px;
    font-family: var(--font-dm-sans);
}
.form-input:hover{
    cursor:pointer;
}
/* Checkboxes & Radio */
input[type="checkbox"],
input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Form Options (Remember me, etc) */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
}

    .remember-me label {
        margin: 0;
        font-weight: normal;
        cursor: pointer;
        color: var(--text-grey);
    }

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 14px;
    background: var(--linear-gradient);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin: 1rem 0;
}

    .submit-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    }

    .submit-btn:active {
        transform: translateY(0);
    }

    .submit-btn:disabled {
        opacity: 0.7;
        cursor: not-allowed;
    }

    .submit-btn .fa-spinner {
        margin-right: 8px;
    }

/* Form Messages & Errors */
.error-message,
.error {
    color: darkred;
    display: none;
    padding-top: 10px;
    font-size: 13px;
}

.form-message {
    display: none;
    padding: 12px;
    border-radius: 6px;
    margin: 1rem 0;
}

    .form-message.success {
        background: #d4edda;
        color: #155724;
        border: 1px solid #c3e6cb;
    }

    .form-message.error {
        background: #f8d7da;
        color: #721c24;
        border: 1px solid #f5c6cb;
    }

.password-strength {
    padding-top: 10px;
    display: none;
    align-items: center;
    gap: 3px;
}

    .password-strength i {
        font-size: 1.3rem;
    }

/* Validation States */
.form-input.invalid,
input.invalid,
select.invalid,
textarea.invalid {
    border-color: darkred;
}

.form-input.valid,
input.valid,
select.valid,
textarea.valid {
    border-color: #27ae60;
}

/* Form Bottom Links */
.form-bottom p {
    margin: 1rem auto;
    font-size: 14px;
    color: var(--text-grey);
}

    .form-bottom p a,
    .signup-link a,
    .forgot-password {
        color: var(--main-color-logo);
        font-weight: 500;
        text-decoration: none;
    }

        .forgot-password:hover,
        .signup-link a:hover,
        .form-bottom p a:hover {
            text-decoration: underline;
        }

.signup-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-grey);
}

/* === Checkbox Label (common) === */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s;
}

    .checkbox-label:hover {
        background: #f8f9fa;
        border-color: #dee2e6;
    }

    .checkbox-label input[type="checkbox"] {
        width: 20px;
        height: 20px;
        cursor: pointer;
    }

    .checkbox-label span {
        font-size: 14px;
        color: #495057;
    }

/* =======================
   FOOTER
======================= */
.site-footer .container {
    padding-top: 0;
    padding-bottom: 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: start;
    margin-top: 2rem;
    gap: 2rem;
}

.footer-item h2 {
    justify-content: left;
    display: flex;
    margin-bottom: 1rem;
}

.footer-item ul {
    text-align: left;
}

    .footer-item ul li {
        list-style: none;
        line-height: 2;
    }

        .footer-item ul li a {
            text-decoration: none;
            color: #ffffff;
        }

/* =======================
   UTILITIES
======================= */
.grecaptcha-badge {
    display: none !important;
}
/* =======================
   AUTOCOMPLETE SUGGESTIONS
======================= */
.autocomplete-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--input-focus);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-suggestion {
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
    color: var(--input-text);
}

    .autocomplete-suggestion:hover,
    .autocomplete-suggestion.selected {
        background-color: #f0f7ff;
        color: var(--input-focus);
    }

    .autocomplete-suggestion:not(:last-child) {
        border-bottom: 1px solid #e9ecef;
    }

/* =======================
   DROPDOWN INPUT ICON (shared: services + onboarding)
======================= */
.category-dropdown-icon,
.industry-dropdown-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #666;
    font-size: 12px;
    transition: all 0.2s;
    pointer-events: auto;
    user-select: none;
    z-index: 10;
}

    .category-dropdown-icon:hover,
    .industry-dropdown-icon:hover {
        color: var(--main-color-logo);
    }

    .category-dropdown-icon.open,
    .industry-dropdown-icon.open {
        transform: translateY(-50%) rotate(180deg);
        color: var(--main-color-logo);
    }

/* Input wrapper — must be position:relative so the absolute icon anchors correctly */
.category-input-wrapper,
.industry-input-wrapper {
    position: relative;
}

/* Input padding for dropdown icon */
.category-input-wrapper .form-input,
.industry-input-wrapper .form-input {
    padding-right: 40px !important;
}

/* =======================
   REMOVE NUMBER ARROWS
======================= */
/* Chrome, Safari, Edge, Opera */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type="number"] {
    -moz-appearance: textfield;
}
/* =======================
   RESPONSIVE - MODULE HEADERS
======================= */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

        .form-actions .btn,
        .form-actions .btn-main,
        .form-actions .btn-border-only {
            width: 100%;
            justify-content: center;
        }

    .clients-header,
    .services-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .clients-table-wrapper,
    .services-table-wrapper {
        overflow-x: auto;
    }

    .clients-table,
    .services-table {
        min-width: 800px;
    }

    /* Page section padding */
    .container {
        padding: 24px 16px;
    }

    /* Header buttons — wrap on mobile */
    .clients-header > div:last-child,
    .services-header > div:last-child {
        flex-wrap: wrap;
    }

    /* Filter tabs */
    .filter-tabs {
        flex-wrap: wrap;
    }

    /* Form container padding */
    .form-container {
        padding: 24px 20px;
    }

    /* Public nav — stack buttons on small screens */
    .nav-wrapper {
        padding: 12px 0;
    }

    .navigation ul {
        gap: 12px;
    }

    .brand-logo img {
        max-width: 150px;
    }

    .btn a, .tab a {
        padding: 8px 18px;
        font-size: 0.9rem;
    }

    /* Login form */
    .login-container {
        padding: 2rem 1.25rem;
        margin: 1.5rem auto;
        box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    }

    .login-header h1 {
        font-size: 22px;
    }

    /* Container inner padding */
    .container {
        padding: 24px 16px;
    }

    /* Footer grid */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
}

/* =======================
   RESPONSIVE — SMALL MOBILE (max 480px)
======================= */
@media (max-width: 480px) {
    .navigation ul {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* =======================
   GLOBAL SEARCH SUGGESTIONS
   Shared by Invoices, Expenses, Contracts, Clients
======================= */
.inv-search-suggestions {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    z-index: 300;
    overflow: hidden;
}

.inv-suggestion-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    color: #333;
    border-bottom: 1px solid #f5f5f5;
    transition: background 0.1s;
}

.inv-suggestion-item:last-child { border-bottom: none; }
.inv-suggestion-item:hover { background: #f5f7ff; }

.inv-suggestion-item i {
    font-size: 12px;
    color: #aaa;
    width: 14px;
    flex-shrink: 0;
}

/* =======================
   GLOBAL SEARCH BAR (filter bar shared pattern)
======================= */
.inv-filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.inv-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
    max-width: 340px;
}

.inv-search-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.inv-search-inner:focus-within {
    border-color: var(--input-focus, #667eea);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.inv-search-icon {
    color: #aaa;
    font-size: 13px;
    flex-shrink: 0;
    pointer-events: none;
}

.inv-search-input {
    flex: 1;
    min-width: 0;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 8px 0 !important;
    font-size: 14px;
    font-family: var(--font-dm-sans);
    color: var(--input-text, #1a1a1a);
    outline: none;
}

.inv-clear-btn {
    flex-shrink: 0;
    color: #c62828;
    border-color: #e0e0e0;
}

.inv-clear-btn:hover {
    background: #ffebee;
    border-color: #c62828;
}
