body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    font-size: 17px;
    color: #161846;
    font-weight: 400;
    letter-spacing: -0.4px;
    max-width: 100%;
    overflow-x: hidden;
}

button, .btn {
    border: none;
    outline: none;
}

h3 {
    font-weight: 800;
    font-size: 26px;
    line-height: 32px;
    letter-spacing: -0.4px;
}

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

/* Login Page Styles */
#login-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background: linear-gradient(180deg, #FAFCFF 0%, #DAE6FF 100%);
    overflow: hidden;
}

#login-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../img/backlogin.png") center center no-repeat;
    background-size: cover;
    z-index: 0;
}

.h2-big {
    font-size: 4rem;
    font-weight: 700;
    line-height: 80px;
    margin-bottom: 3rem;
}

.subtitle {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 34px;
}

.description {
    font-weight: 400;
    font-size: 17px;
    line-height: 22px;
    letter-spacing: -0.4px;
    margin-bottom: 2.5rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper .content-left {
    position: absolute;
    top: 8%;
    left: 24px;
    transform: translateY(50%);
    z-index: 2;
}

.input-wrapper .toggle-password {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.toggle-password:hover {
    opacity: 1;
}

#messages-table {
    table-layout: auto;
    color: #161846;
}

#messages-table td {
    white-space: pre-wrap;
}

.page {
    display: none;
}

.page.active-page {
    display: block;
}

.login-card {
    width: 100%;
    max-width: 560px;
    padding: 3.2rem;
    border-radius: 2.5rem;
    background-color: rgba(10, 132, 255, 0.2);
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    margin: 0 15px;
    animation: fadeIn 0.5s ease;
}

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

#show-register {
    color: #4F46E5;
    text-decoration: none;
}

#show-register:hover {
    text-decoration: underline;
}

.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    background: #F2F2F7;
    max-width: 860px;
    min-width: 620px;
    width: 100%;
}

.modal-header,
.modal-footer {
    border: none;
}

.modal-footer {
    justify-content: center;
}

.modal-footer > .btn {
    width: 100%;
    justify-content: center;
}

.input-tooltip {
    font-size: 15px;
    line-height: 20px;
    margin: 9px 0 0 24px;
}

/* Sidebar styles */
#sidebar {
    min-height: 100vh;
    z-index: 100;
    padding: 0;
    background: linear-gradient(180deg, #FAFCFF 0%, #DAE6FF 100%);
}

#sidebar .nav-link {
    font-size: 15px;
    line-height: 25px;
    letter-spacing: -0.4px;
    padding: 0.75rem 1rem;
    color: #A3A8C7;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease-in-out;
}

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 10px;
    background: transparent;
    transition: all 0.2s ease-in-out;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    background: #0A84FF33;
}

.nav-link svg path {
    fill: #A3A8C7; /* неактивная */
    transition: all 0.2s ease;
}

.nav-link:hover svg path,
.nav-link.active svg path {
    fill: #007AFF;
}


.badge-active {
    background: #34C75929;
    color: #34C759;
    font-size: 17px;
    line-height: 25px;
    border-radius: 100px;
    padding: 0 12px 3px 12px;
}

.badge-inactive {
    background: #FF3B3029;
    color: #FF3B30;
    font-size: 20px;
    line-height: 25px;
    border-radius: 100px;
    padding: 0 12px 3px 12px;
}

.gray-text {
    color: #A3A8C7;
}

.logout {
    font-size: 16px;
    line-height: 21px;
    letter-spacing: -0.4px;
}

#sidebar .nav-link.active {
    color: #007AFF;
}

#sidebar .nav-link:hover {
    color: #007AFF;
}

/* Main content */
.main-content {
    padding: 2.5rem;
    border-top-left-radius: 40px;
    background: white;
    box-shadow: 2px 2px 16px 0 #0000000F;
}

.main-title {
    font-weight: 700;
    font-size: 34px;
    line-height: 41px;
    letter-spacing: -0.4px;
    margin-bottom: 1.5rem;
}

.header {
    padding: 32px 34px 32px 24px !important;
    background: #f9fbff;
}

.navbar .navbar-toggler {
    top: 0.25rem;
    right: 1rem;
}

/* Cards */
.card {
    max-width: 498px;
    border-radius: 40px;
    background: #F7FAFF;
    border: 0.5px solid #E5E5EA;
    box-shadow: 2px 2px 16px 0 #0000000F;
}

.sidebar, .main-content {
    transition: all 0.3s ease;
}

/* Когда сайдбар скрыт */
.sidebar-collapsed #sidebar {
    display: none !important;
}

/* Основной контент занимает всё */
.sidebar-collapsed .main-content {
    margin-left: 0 !important;
    width: 100% !important;
}

.card-body {
    padding: 1.6rem 2rem;
}

.card-title {
    font-weight: 700;
    font-size: 21px;
    line-height: 34px;
    margin-bottom: 8px;
}

.card-subtitle {
    line-height: 22px;
    font-size: 13px !important;
}

.card-header {
    padding: 0;
}

/* Tables */
.table {
    margin-bottom: 0;
}

.table-body {
    padding: 25px 32px;
    border-radius: 24px;
    background: #F7FAFF;
    border: 0.5px solid #E5E5EA;
    box-shadow: 2px 2px 16px 0 #0000000F;
    overflow-x: auto;
    width: 100%;
}

.table th {
    border-top: none;
    padding: 0 10px 12px 0;
    font-weight: 700;
    font-size: 17px;
    line-height: 28px;
    color: #007AFF;
}

.table td {
    padding: 22px 8px 22px 0;
    font-size: 15px;
    line-height: 28px;
    letter-spacing: -0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

/* Pages */
.page {
    display: none;
}

.active-page {
    display: block;
}

/* Icons in cards */
.card .bi {
    color: #6c757d;
}

/* Dashboard stats */
.card h2 {
    font-size: 2rem;
    margin-bottom: 0;
    font-weight: 500;
}

/* Form controls */
.form-control {
    border-radius: 6.25rem;
    height: 56px;
    padding: 16px;
    border: 0.5px solid #E5E5EA;
    box-shadow: 2px 2px 16px 0 #0000000F;
}

.form-control.login {
    padding: 16px 24px 14px 56px;
}

.form-control::placeholder {
    color: #3C3C434D;
    font-size: 14px;
    font-weight: 400;
    line-height: 22px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.form-text {
    font-size: 15px;
    line-height: 20px;
    color: #161846;
    display: flex;
    justify-content: right;
}

.select-account {
    padding: 13px 10px;
    border-radius: 6.25rem;
    background: #F2F2F7;
    line-height: 22px;
    border: none;
    outline: none;
    height: 56px;
    min-width: 180px;
    width: 100%;
    font-size: 14px;
    appearance: none;
    background-image: url("../img/arrow.png") !important;
    background-repeat: no-repeat !important;
    background-position: right .3rem center !important;
}

.large-textarea {
    border-radius: 1rem;
    resize: none;
    height: 200px;
}

.bg-white {
    background: white;
    box-shadow: 2px 2px 16px 0 #0000000F;
}

.bi {
    color: #3C3C434D;
    cursor: pointer;
}

.sms-status .bi {
    color: white;
}

#direction-filters {
    border-radius: 100px;
    background: #F2F2F7;
    color: #161846;
}

.switch-btn {
    padding: 13px 13px;
}

#direction-filters .bi {
    color: #161846;
}

#direction-filters .active {
    background: #0A84FF33;
    border-radius: 100px;
}

.alert-danger {
    background: #FF3B3029;
    border-radius: 14px;
    padding: 16px;
    border: none;
    max-width: 310px;
    width: 100%;
    margin: 0 auto;
}

.alert-info {
    background: #0A84FF33;
    border: none;
    border-radius: 14px;
    padding: 16px;
    color: #161846;
    line-height: 22px;
}

.modal-link {
    font-weight: 600;
    line-height: 22px;
    text-decoration: underline;
    color: #007AFF;
}

.form-label {
    font-weight: 700;
    font-size: 15px;
    line-height: 20px;
    color: #161846;
}

.search-numbers-form {
    background: #0A84FF33;
    padding: 24px;
    border-radius: 24px;
}

.form-control:focus,
.form-select:focus {
    border-color: #E5E5EA;
    outline: none;
    box-shadow: none;
}

/* Button styles */
.btn-primary {
    background-color: #007AFF;
    border: none;
    padding: 14px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 17px;
    line-height: 22px;
    letter-spacing: -0.4px;
}

.btn-primary:hover,
.btn-secondary:hover {
    background-color: #0A84FF;
}

.btn-secondary {
    height: 50px;
    padding: 12px 20px;
    min-width: 180px;
    border-radius: 100px;
    font-weight: 500;
    font-size: 15px;
    line-height: 22px;
    background: #007AFF;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0 4px;
    transition: background 0.2s, opacity 0.2s;
}

.btn-secondary:disabled {
    background: #D1D1D6;
    color: #161846;
    cursor: not-allowed;
    opacity: 0.8;
}

#search-results-container {
    margin-top: 32px;
}

.modal-title {
    font-weight: 700;
    font-size: 28px;
    line-height: 34px;
}

/* Phone number capabilities */
.badge {
    font-size: 0.93rem;
    margin-right: 0.25rem;
    border-radius: 100px;
    font-weight: 400;
}

.bg-blue {
    background: #007AFF;
}

.badge-voice {
    background-color: #5856D6;
}

.badge-sms {
    background-color: #34C759;
}

.badge-mms {
    background-color: #FF9500;
}

.badge-secondary {
    font-size: 0.93rem;
    background: #FF3B3029;
    padding: 4px 12px 6px;
    line-height: 25px;
    border-radius: 10px;
    color: #FF3B30;
}

.badge-secondary:hover {
    background: #FF3B30;
    color: white;
}

/* Message status colors */
.status-delivered {
    color: #10B981;
}

.status-sent {
    color: #6366F1;
}

.status-queued {
    color: #F59E0B;
}

.status-failed {
    color: #EF4444;
}

/* Truncate long text in tables */
.truncate {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-received, .status-failed {
    padding: 2px 8px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 100px;
    font-size: 15px;
    color: white;
    line-height: 20px;
    width: fit-content;
    margin-top: 8px;
}

.status-received {
    background: #34C759;
}

.status-failed {
    background: #FF3B30;
}

.search-wrapper input {
    padding-right: 2rem;
    min-width: 200px;
    height: 49px;
    border-radius: 100px;
}

.search-wrapper i {
    pointer-events: none;
    color: #161846 !important;
}

.search-wrapper #phone-search {
    min-width: 270px;
    height: 56px;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1050;
}

.table-loader-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px 0;
}

.bi-pencil, .bi-trash, .bi-box-arrow-right {
    color: #161846;
}

#mobileMenu {
    transition: all 0.3s ease;
}

@media screen and (max-width: 767px) {
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        z-index: 1000;
        padding: 0;
    }

    .header {
        padding: 15px !important;
    }

    #sidebar .nav-link {
        font-size: 20px;
    }

    h3 {
        font-size: 25px;
    }

    .main-content {
        padding: 20px 13px;
    }

    .main-title {
        margin-bottom: 10px;
        font-size: 22px;
        padding: 0 5px;
        line-height: 33px;
    }

    .table th {
        font-size: 12px;
        line-height: 16px;
    }

    .table td {
        font-size: 12px;
        padding-right: 10px;
        line-height: 24px;
    }

    .table-body {
        padding: 15px;
    }

    .badge-active, .switch-btn, .status-received, .select-account, .alert-info, .input-tooltip, .badge, .badge-secondary, .form-label {
        font-size: 12px;
    }

    .select-account, .search-wrapper #phone-search, .form-control {
        height: 50px;
    }

    .btn-secondary {
        font-size: 13px;
        padding: 12px;
        line-height: 16px;
    }

    .status-received, .status-failed {
        padding: 2px 6px 2px;
        line-height: 16px;
    }

    .filters-wrapper {
        margin-top: 20px;
    }

    .modal-content {
        min-width: auto;
        max-width: none;
    }
}

@media screen and (max-width: 1070px) {
    .filters-wrapper {
        margin-top: 20px;
    }
}

@media screen and (max-width: 1400px) {
    .login-card {
        padding: 1.6rem 1.8rem;
        max-width: 460px;
    }

    .h2-big {
        font-size: 40px;
        line-height: 50px;
        margin-bottom: 30px;
    }

    .subtitle {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }

    .description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
}

@media screen and (max-width: 465px) {
    .main-content {
        border-radius: 0;
    }

    .main-title {
        font-size: 20px;
    }

    .burgerMenu {
        padding: 0 !important;
    }

    .header h3 {
        margin-bottom: 0;
    }

    #numbers-page > h1 {
        margin-bottom: 0;
    }

    .logout {
        margin-top: 5px;
        display: block;
    }

    .input-tooltip {
        margin-left: 8px;
    }

    .col-12, .col-md-4 {
        padding: 0;
    }

    .card {
        border-radius: 20px;
    }

    .card-body {
        padding: 15px;
    }

    .card-header .search-wrapper {
        margin-top: 15px;
    }

    .container-fluid {
        padding: 0;
    }

    .filters-wrapper {
        margin-top: 0;
        width: 100%;
    }

    .search-wrapper {
        width: 100%;
    }

    .row {
        margin: 0;
    }

    #direction-filters {
        display: none;
    }

    .select-account {
        margin: 15px 0 8px;
    }

    #send-sms-form .select-account, .search-numbers-form .select-account {
        margin-top: 0;
    }

    .search-numbers-form {
        padding: 15px;
    }

    .card-header {
        margin-bottom: 25px !important;
    }
}

.dot-loader {
    display: flex;
    justify-content: center;
    width: 100%;
    align-items: center;
    gap: 6px;
    height: 40px;
}

.dot-loader span {
    width: 10px;
    height: 10px;
    background-color: #3B82F6;
    border-radius: 50%;
    animation: dotBounce 1.4s infinite ease-in-out both;
}

.dot-loader span:nth-child(1) {
    animation-delay: -0.32s;
}

.dot-loader span:nth-child(2) {
    animation-delay: -0.16s;
}

.dot-loader span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.3;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.highlight-row {
    animation: highlightFade 7s forwards;
}

@keyframes highlightFade {
    0% {
        background-color: #fff9c4;
    }
    50% {
        background-color: #fff9c4aa;
    }
    100% {
        background-color: transparent;
    }
}

