/* ==========================================================================
   1. FONTS & BASE (Шрифты и базовые настройки)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600&display=swap');

* {
    font-family: Montserrat, sans-serif;
}

body {
    margin: 0;
    padding: 0;
    font-size: 1.6vh;
}

a {
    text-decoration: none;
    color: #101010;
}

hr {
    margin: 0;
    width: 100%;
}

h3, h4 {
    margin: 2vh 0 1vh 0;
}

/* ==========================================================================
   2. UTILITIES & HELPERS (Утилиты, отступы, флексы)
   ========================================================================== */
/* Flexbox Helpers */
.col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.row {
    display: flex;
    flex-direction: row;
    gap: 1.5vh;
}

.wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 1vh;
}

.ai_center {
    align-items: center;
}

.spaceBetween {
    justify-content: space-between;
}

/* Margins */
.unmargin, .m0 {
    margin: 0 !important;
}

.m-top-1vh {
    margin-top: 1vh !important;
}

.m-top-2vh {
    margin-top: 2vh !important;
}

/* Text & Colors Utilities */
.bold, .fw500 {
    font-weight: 500;
}

.fw600 {
    font-weight: 600;
}

.blueLink {
    cursor: pointer;
    color: #679FCF;
}

/* Status Colors (Text) */
.success-text { color: #489928; }
.error-text   { color: #963030; }
.alert-text   { color: #e6af58 !important; }
.info-text    { color: #9d9d9d !important; }

/* Gradients */
.color_gradient {
    background: linear-gradient(180deg, #37BDE3 0%, #FE4193 49.48%, #E3C85F 99.99%, #294DD7 100%);
}

.stripe_gradient {
    background: linear-gradient(90deg, #37BDE3 0%, #FE4193 49.48%, #294DD7 100%);
}

/* ==========================================================================
   3. LAYOUT (Структура страницы)
   ========================================================================== */
.container-global {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    justify-content: space-between;
    overflow: hidden;
}

.container-main {
    width: 100%;
    position: relative;
    margin: 0 auto 0 0;
    max-width: unset;
    overflow: auto;
    background: #f9f9f9;
    padding-bottom: 3vh;
}

.container {
    width: calc(100% - 80px);
    padding: 0 40px;
    color: #101010;
}

@media (max-width: 768px) {
    .container {
        width: calc(100% - 10px);
        padding: 0 5px;
    }
}

/* ==========================================================================
   4. UI COMPONENTS (Кнопки, Инпуты, Аватары, Табы)
   ========================================================================== */

/* --- Buttons --- */
button {
    margin-top: 20px;
}

.buttonUnset {
    border: none;
    background: none;
    outline: none;
    cursor: pointer;
    margin: 0;
    min-height: unset;
}

.action_btn {
    width: 250px;
    height: 40px;
    background: #101010;
    color: #fff;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin: 0;
    cursor: pointer;
    transition: 0.4s;
    font-weight: 800;
    border: 1px solid #101010;
}

.action_btn:hover {
    background: transparent;
    color: #101010;
}

.wrap_btn {
    height: unset;
    width: unset;
    padding: 1.5vh;
}

.transparent_btn {
    border: 1px solid #101010;
    background: transparent;
    color: #101010;
}

.transparent_btn:hover {
    background: #101010;
    color: #fff;
}

.btn_alert {
    background: transparent !important;
    border: 1px solid #e6af58 !important;
    color: #000 !important;
}

.btn_alert:hover {
    background: #e6af58 !important;
}

.action_btn_checklist {
    margin: 0;
}

.content_box_save_btn {
    margin: 15px 0 0 auto;
    height: 3.5vh;
    min-width: 13vh;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    background: #489928;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    transition: 0.5s;
    border: 1px solid #489928;
    position: relative;
    flex-shrink: 0;
    padding: 0 1vh;
}

.content_box_save_btn:hover {
    background: transparent;
    color: #000;
}

/* Stripe Button Style */
.stripe_button {
    width: 160px;
    height: 40px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
}

.stripe_button p {
    display: block;
    font-weight: 700;
    font-size: 16px;
    border-radius: 60px;
    background: linear-gradient(180deg, #37BDE3 0%, #FE4193 49.48%, #E3C85F 99.99%, #294DD7 100%);
    background: -webkit-linear-gradient(-90deg, #37BDE3 0%, #FE4193 49.48%, #E3C85F 99.99%, #294DD7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    background-clip: text;
    margin-right: 7px;
}

.stripe_button span {
    width: 60px;
    height: 1px;
    display: block;
    transition: 0.5s;
}

.stripe_button:hover span {
    width: 0;
}

/* Custom File Upload Button */
.custom-file-upload-button {
    border: 2px solid #007bff;
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    display: inline-block;
    transition: background-color 0.2s, border-color 0.2s;
    font-weight: bold;
}

.custom-file-upload-button:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* --- Inputs & Forms --- */
input[type=text], 
input[type=number], 
input[type=date], 
input[type=password], 
textarea, 
select, 
button {
    display: block; 
    margin-bottom: 15px;
    font-size: 16px;
    outline: none;
    border-radius: 5px; 
    padding: 10px;
    /* border: 1px solid #4A4B59; */
}

#fileInput {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.file-name-display {
    margin-left: 15px;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    display: inline-block;
    vertical-align: middle;
    font-size: 0.9em;
    color: #666;
}

.custom-select {
    -moz-appearance: none; 
    -webkit-appearance: none;
    appearance: none;
}

.select-wrapper {
    position: relative;
}

.select-arrow {
    top: 25px;
    height: calc(100% - 25px);
}

.settings_form {
    width: 400px;
    position: relative;
}

/* --- Avatars --- */
.avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    color: #fff;
    text-transform: uppercase;
    font-weight: 700;
    flex-shrink: 0;
}

/* --- Tabs & Selectors --- */
.tab_selector {
    display: flex;
    margin-bottom: 1.5vh;
}

.tab_selector_item {
    padding: 1vh;
    border-radius: 5px;
}

.tab_selector_item.active {
    background: #000;
    color: #fff;
}

/* ==========================================================================
   5. MODALS & ALERTS (Попапы, Сообщения)
   ========================================================================== */

/* --- Popups --- */
#popup-bg {
    position: fixed;
    z-index: 9999;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background: #000;
    opacity: 0.3;
    display: none;
}

#popup-container {
    position: fixed;
    z-index: 10000;
    width: 35vw;
    height: auto;
    min-height: 15vh;
    max-height: 80vh;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: none;
    background: #fff;
    border-radius: 0.4vh;
    padding: 1.5vh;
    gap: 1.3vh;
    overflow-y: scroll;
    overflow-x: hidden;
}

.popup_large {
    width: 60vw !important;
}

.popup_small {
    width: 20vw !important;
}

@media (max-width: 590px) {
    #popup-container {
        width: 80%;
    }
}

/* --- Message Popups (Toast) --- */
.message-popup {
    position: fixed;
    top: 20px;
    right: 20px;
    border-radius: 10px;
    padding: 15px;
    z-index: 10000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    animation: fadeOut 3s ease-in-out 7s forwards;
}

.success-popup { background-color: #489928 !important; }
.error-popup   { background-color: #963030 !important; }
.alert-popup   { background-color: #e6af58 !important; }
.info-popup    { background-color: #d0d0d0 !important; color: #000 !important; }

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; visibility: hidden; }
}

/* --- Notices --- */
.notice {
    background: #4A4B59;
    padding: 15px;
    display: block;
    border-radius: 5px;
    margin: 10px 0;
    color: #fff;
}

.wrapItem {
    padding: 1.2vh;
    font-size: 1.5vh;
    margin: 0;
}

/* ==========================================================================
   6. MODULES (Специфические элементы приложения)
   ========================================================================== */

/* --- Content Boxes --- */
.content_box_title {
    font-size: 2vh;
    font-weight: 500;
    margin: 0 0 1vh 0;
    width: 100%;
}

.content_box_p {
    font-size: 1.5vh;
    margin: 0;
}

/* --- Hover Effects --- */
.hideHover {
    position: relative;
    filter: blur(0.6vh);
    cursor: pointer;
}

.active.hideHover {
    filter: none;
}

/* --- Projects --- */
.projects_box {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5vh;
}

.project_box {
    padding: 2vh;
    border-radius: 5px;
    max-width: 1200px;
    display: block;
    background: #fff;
    position: relative;
    box-shadow: 0 0 2px #c4c4c4;
}

.project_box h3 {
    margin: 0;
}

.project_box_balance {
    display: flex;
    row-gap: 0.4vh;
    flex-direction: column;
}

.project_box_balance p {
    margin: 0;
}

.project_title {
    margin: 20px 0;
}

.project_title h2 {
    margin: 0;
}

/* Project Alerts/Shadows */
.proj_alert_r { box-shadow: 0 0 2px #FE4193; }
.proj_alert_y { box-shadow: 0 0 2px #E3C85F; }
.proj_alert_b { box-shadow: 0 0 2px #294DD7; }

/* --- Tasks --- */
.task_item {
    border-radius: 5px;
    box-shadow: 0 0 3px #4A4B59;
    padding: 20px;
    cursor: pointer;
}

.task_item_title {
    margin: 0;
}

/* --- Expenses & Links --- */
.expense_box, 
.link_box {
    padding: 10px 25px;
    margin: 5px;
    box-shadow: 0 0 5px #4A4B59;
    border-radius: 5px;
    margin-bottom: 10px;
    display: block;
    background: #4A4B59;
    color: #fff;
}

.link_box p {
    margin: 0;
}

.add_expense_box {
    display: block;
    margin: 5px 0 0 auto;
    width: 60px;
    cursor: pointer;
}

.expense_delete_btn {
    max-width: 200px;
}

/* --- Comments --- */
.comment_form {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

button[name=comment_add] {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #294DD7;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    margin: 0;
    margin-top: 2px;
}

button[name=comment_add] svg path {
    fill: #fff;
    cursor: pointer;
}

.comment_form textarea {
    margin-right: 20px;
    border: none;
    height: 80px;
    font-size: 16px;
    border-radius: 15px;
    padding: 10px;
}

.comment_bar {
    text-align: right;
    margin: 0;
}

/* --- Tables (Leads) --- */
.leadsTable tr td {
    padding: 0.5vh 3vw;
    cursor: pointer;
    font-size: 1.5vh;
}

.leadsTable tr:hover {
    background: #eeeded;
}

.leadsTable tr td:first-child {
    padding: 0.5vh 3vw 0.5vh 0;
}

.leadsTable tr td:last-child {
    padding: 0.5vh 0 0.5vh 3vw;
}

.leadsTable_contacts {
    display: flex;
    gap: 2vh;
}

.leadsTable_contacts .wrap_btn {
    padding: 0.3vh 1.5vh;
}

.leadsTable_contacts img {
    height: 2vh;
}

.leadsTable_contacts p {
    margin: 0;
}

/* --- Collapsible Sections (Budget/Checklist) --- */
#budget, 
#checklist {
    height: 0;
    transition: 0.5s;
    overflow: hidden;
    display: block;
    color: #101010;
}

#budget.active,
#checklist.active {
    height: auto;
}

/* --- Other/Misc --- */
.tagSpan {
    padding: 0.5vh;
    border-radius: 10px;
    margin-left: 0.7vw;
}

.back_arrow_viewTheme {
    margin: 0 0 0 auto;
    align-items: center;
    display: flex;
}

/* TG Connect Widget */

.tg_connect_widget div:first-child {
    border-right: 1px dashed #4A4B59;
}

@media (max-width: 768px) {
    .tg_connect_widget {
        flex-direction: column;
        align-items: flex-start;
        width: calc(100% - 40px);
    }

    .tg_connect_widget div:first-child {
        border: none;
    }

    .tg_connect_widget a {
        width: 100%;
    }
}
