@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;800&display=swap');
:root {
    --black-color: #050608;
    --gray-color: #E2E5DE;
    /* iMart Group Ltd brand */
    --primary-color: #E31C23;
    --navy-color: #0B2C5F;
    --secondary-color: #FFBDB4;
    --red-color: #E31C23;
    --white-color: #FCFCFC;
    --main-font: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--main-font);
    font-size: 12px;
    min-height: 100%;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

input[type=checkbox] {
    margin: 5px;
    border: 1px solid red;
    display: inline;
}

header {
    background-color: var(--primary-color);
    color: var(--white-color);
    display: flex;
    justify-content: space-between;
    padding: 10px 20px;
}

header .logo {
    font-size: 1.5rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 12px;
}

header .header-brand-logo {
    height: 48px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    padding: 4px 8px;
}

header .header-brand-text {
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

header ul {
    display: flex;
}

header ul li {
    padding: 5px 20px;
    font-size: 1rem;
}

header .buy-button {
    background-color: var(--secondary-color);
    padding: 5px 8px;
    border-radius: 5px;
    font-weight: bold;
}

header ul li i {
    padding: 0px 5px;
}

.container {
    display: flex;
}

.menu {
    color: var(--black-color);
    width: 15%;
    min-height: 80vh;
    min-width: 220px;
    border-right: 1px solid var(--gray-color);
    background-color: whitesmoke;
}

.menu ul {
    padding: 20px 5px;
}


.menu ul li {
    padding: 10px 5px;
    margin: 2px 0px;
    border-radius: 3px;
    border:1px solid var(--secondary-color);
}

.menu ul li div{
    display:inline-block;
    text-align:center;
    margin:0px 10px;
}

.menu ul li a {
    display: block;
    font-size: 1rem;
}

.menu ul li:hover {
    background-color: var(--secondary-color);
}

.menu ul li:hover i {
    color: var(--primary-color);
}

.menu ul li i {
    width: 40px;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.content-wrapper {
    width: 85%;
    padding: 20px 40px;
}

.page-title {
    font-size: 1.4rem;
    color: var(--black-color);
    font-weight: bold;
    padding: 5px 0px;
}

.page-header {
    color: var(--black-color);
    padding: 20px 0px;
    display: flex;
    justify-content: space-between;
    width: 100%;
    background-color: whitesmoke;
    border: 1px solid var(--gray-color);
}

.page-menu {
    display: flex;
    padding: 0px 5px;
}

.page-menu li {
    border: 1px solid var(--gray-color);
    display: block;
    cursor:pointer;
    padding: 0px 10px;
}

.page-menu label{
    font-size: 0.9rem;
    cursor:pointer;
    padding:5px 0px;
    display:inline-block;
}
.page-menu li a {
    display: block;
    padding: 5px 10px;
    font-size: 0.9rem;
}

.page-menu li i {
    margin: 0px 5px;
}

.page-options {
    display: flex;
}

.page-options label {
    font-size: 0.9rem;
    padding: 5px 10px;
}

.page-options select {
    border: 1px solid var(--gray-color);
    padding: 3px 5px;
}

.page-options label .flat-button {
    font-weight: bold;
    cursor: pointer;
}

.page-options ul {
    display: flex;
}

.page-options ul li {
    margin: 0px 5px;
    font-size: 0.9rem;
}

.page-options ul li i {
    padding: 5px 10px;
    border: 1px solid var(--gray-color);
    border-radius: 3px;
}

.page-options ul li #keyword {
    border: 1px solid var(--gray-color);
    padding: 4px 5px;
    width: 150px;
    outline: none;
}

.page-options ul li .date-field {
    border: 1px solid var(--gray-color);
    padding: 4px 5px;
    width: 100px;
    outline: none;
}

.pagination {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 20px 0px;
    font-size: 0.85rem;
    background-color: whitesmoke;
    border: 1px solid var(--gray-color);
}

.pagination .page-nav {
    display: flex;
}

.pagination .page-nav i {
    cursor: pointer;
    margin: 0px 10px;
    font-size: 1rem;
}

.pagination .page-nav .page-records li {
    margin: 0px 3px;
}

.pagination .page-rows {
    display: flex;
    padding: 0px 5px;
}

.pagination .page-rows li label {
    display: inline-block;
    padding: 5px 10px;
}

.pagination .page-rows li select {
    border: 1px solid var(--gray-color);
    border-radius: 3px;
    padding: 3px 0px;
    width: 100px;
}

.login-form {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0 auto;
    border-style: none;
    border-radius: 12px;
    width: 400px;
    max-width: 92vw;
    background: #fff;
    box-shadow: 0 12px 40px rgba(11, 44, 95, 0.12);
    padding: 28px 28px 24px;
}

.login-brand {
    text-align: center;
    margin-bottom: 8px;
}

.login-brand-logo {
    width: min(220px, 70%);
    height: auto;
    object-fit: contain;
}

.form-title {
    margin: 10px 0px;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--navy-color);
    text-align: center;
}

.form-field {
    padding: 5px 0px;
}

.form-field label {
    display: block;
    margin: 5px 0px;
    font-size: 1rem;
    color: var(--black-color);
}

.form-field input[type=text], .form-field input[type=password] {
    height: 40px;
    width: 100%;
    background-color: var(--gray-color);
    border-style: none;
    border-radius: 5px;
    width: 100%;
    font-size: 1rem;
    padding: 3px 15px;
    outline: none;
}

.login-form a {
    font-weight: bold;
}

.form-field input[type=submit],.login-form input[type=button] {
    border: none;
    border-radius: 5px;
    margin: 10px 0px;
    padding: 10px 0px;
    font-family: var(--main-font);
    font-size: 1rem;
    min-width: 150px;
    background-color: var(--primary-color);
    color: var(--white-color);
    cursor: pointer;
}

.login-form input[type=submit],.login-form input[type=button] {
    width: 100%;
}

.error-message {
    color: var(--red-color);
    font-size: 0.9rem;
}

.login-help-box {
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--black-color);
    background-color: #f0f4f8;
    border-radius: 6px;
    padding: 10px 12px;
    border: 1px solid #d8e0e8;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    border: 1px solid var(--gray-color);
}

tr:nth-child(even) {
    background-color: #f2f2f2;
}

.table-header {
    font-weight: bold;
    background-color: var(--gray-color);
}

td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--gray-color);
}

.row-options{
    display:flex;
    justify-content: space-between;
    
}
.row-options i{
    
    margin:0px 10px;    
    cursor:pointer;
    font-size: 1rem;
}

.fa-edit{
    color:orange;
}

.fa-plus{
    color: var(--primary-color);
}

.fa-upload{
    color: olive;
}

.fa-trash{
    color:brown;
}
.page-form {
    width: 100%;
    border: 1px solid var(--gray-color);
    border-radius: 5px;
    padding: 20px 10px;
}

.page-form .form-field {
    width: 100%;
    display: flex;
}

.page-form .form-field .field-label {
    width: 15%;
    text-align: right;
    font-size: 1rem;
    font-weight: bold;
    padding: 3px 10px;
}

.page-form .form-field .custom-input-wrapper {
    width: 60%;
    ;
}

.page-form .form-field .custom-input {
    height: 150px;
    border: 1px solid var(--gray-color);
    border-radius: 5px;
    width: 100%;
    background-color: var(--white-color);
    overflow: auto;
}

.page-form .form-field select {
    height: 35px;
    border: 1px solid var(--gray-color);
    border-radius: 3px;
    padding: 3px 5px;
    outline: none;
    background: var(--white-color);
}

.page-form .form-field textarea {
    width: 100%;
    height: 100px;
    border: 1px solid var(--gray-color);
    border-radius: 3px;
    padding: 3px 5px;
}

.page-form .form-field .custom-input #recipient_list {
    background-color: var(--white-color);
    border-radius:0px;
}

.page-form .form-field .custom-input #recipient {
    background-color: var(--white-color);
    border: 1px solid var(--gray-color);
    border-radius: 0px;
    border-collapse: collapse;
}

.spaces{
    width:100px;
    height:20px;
    background:red;
}
#message, .form-field textarea{
    outline:none;
    font-size:1rem;
    font-family:var(--main-font);
    overflow:auto;
    width: 100%;
    height: 100px;
    border: 1px solid var(--gray-color);
    border-radius: 3px;
    padding: 3px 5px;
}

.page-form .form-field .custom-counter {
    text-align: right;
    font-size: 0.8rem;
    color: gray;
}

.page-form .form-field .custom-counter span {
    padding-left: 10px;
    font-weight: bold;
}

.page-form .form-field .field-list {
    width: 30%;
    padding: 5px 10px;
}

.page-form .form-field .field-list li {
    padding: 5px 0px;
    width: 100%;
    font-size: 0.9rem;
}

.page-form .form-field .field-list label {
    font-size: 0.9rem;
    cursor: pointer;
}

#insert_contacts {
    display: none;
}

#insert_groups {
    display: none;
}

#insert_templates {
    display: none;
}

#create_sender {
    display: none;
}


#create_template {
    display: none;
}


#edit_template {
    display: none;
}

#change_password {
    display: none;
}


#buy_credits {
    display: none;
}


/* Contacts modals: not display:none so <label for> reliably toggles the checkbox */
#create_contact.modal-checkbox,
#edit_contact.modal-checkbox,
#create_group.modal-checkbox,
#import_contacts.modal-checkbox {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}

.page-menu .page-menu-item {
    font-size: 0.9rem;
    cursor: pointer;
    padding: 5px 0;
    display: inline-block;
}




#buy_credits_modal {
    display: none;
    min-width: 100%;
    min-height: 100%;
}

#contacts_modal {
    display: none;
    min-width: 100%;
    min-height: 100%;
}

#edit_contact_modal {
    display: none;
    min-width: 100%;
    min-height: 100%;
}

#groups_modal {
    display: none;
    min-width: 100%;
    min-height: 100%;
}


#templates_modal {
    display: none;
    min-width: 100%;
    min-height: 100%;
}


#edit_templates_modal {
    display: none;
    min-width: 100%;
    min-height: 100%;
}

#change_password_modal {
    display: none;
    min-width: 100%;
    min-height: 100%;
}


#create_sender_modal {
    display: none;
    min-width: 100%;
    min-height: 100%;
}


#create_template_modal {
    display: none;
    min-width: 100%;
    min-height: 100%;
}

#edit_template_modal {
    display: none;
    min-width: 100%;
    min-height: 100%;
}


#create_contact_modal {
    display: none;
    min-width: 100%;
    min-height: 100%;
}


#create_group_modal {
    display: none;
    min-width: 100%;
    min-height: 100%;
}

#import_contacts_modal {
    display: none;
    min-width: 100%;
    min-height: 100%;
}


#create_sender_modal .modal-wrapper{
    max-width:50%;
}


#buy_credits_modal .modal-wrapper{
    max-width:50%;
}



#change_password_modal .modal-wrapper{
    max-width:50%;
}


#create_template_modal .modal-wrapper{
    max-width:50%;
}


#edit_template_modal .modal-wrapper{
    max-width:50%;
}

#create_contact_modal .modal-wrapper{
    max-width:50%;
}

#edit_contact_modal .modal-wrapper{
    max-width:50%;
}


#create_group_modal .modal-wrapper{
    max-width:50%;
}

#import_contacts_modal .modal-wrapper{
    max-width:50%;
}


#buy_credits_modal .modal-content{
    padding: 0px 20px;
}

#create_contact_modal .modal-content{
    padding: 0px 20px;
}


#change_password_modal .modal-content{
    padding: 0px 20px;
}


#create_sender_modal .modal-content{
    padding: 0px 20px;
}

#create_template_modal .modal-content{
    padding: 0px 20px;
}



#edit_template_modal .modal-content{
    padding: 0px 20px;
}



#edit_contact_modal .modal-content{
    padding: 0px 20px;
}


#create_group_modal .modal-content{
    padding: 0px 20px;
}

#import_contacts_modal .modal-content{
    padding: 0px 20px;
}



#buy_credits:checked~#buy_credits_modal {
    display: block;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 40%);
}


#change_password:checked~#change_password_modal {
    display: block;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 40%);
}


#edit_contact:checked~#edit_contact_modal {
    display: block;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 40%);
}


#create_sender:checked~#create_sender_modal {
    display: block;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 40%);
}



#create_template:checked~#create_template_modal {
    display: block;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 40%);
}


#edit_template:checked~#edit_template_modal {
    display: block;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 40%);
}


#create_contact:checked~#create_contact_modal {
    display: block;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 40%);
}


#create_group:checked~#create_group_modal {
    display: block;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 40%);
}

#import_contacts:checked~#import_contacts_modal {
    display: block;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 40%);
}

#insert_contacts:checked~#contacts_modal {
    display: block;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 40%);
}

#insert_groups:checked~#groups_modal {
    display: block;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 40%);
}

#insert_templates:checked~#templates_modal {
    display: block;
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 40%);
}

.modal-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    border: 1px solid var(--gray-color);
    border-radius: 5px;
    background-color: white;
    overflow: scroll;
}

.modal-header {
    display: flex;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: bold;
    padding: 15px 10px;
}

.modal-close {
    margin: 10px 0px;    
}

.modal-close i{
    cursor:pointer;
}

.modal-submit-button {
    display: inline-block;
    text-align: center;
    border: 1px solid var(--white-color);
    border-radius: 5px;
    margin: 10px 0px;
    padding: 5px 10px;
    cursor: pointer;
    font-family: var(--main-font);
    font-size: 0.9rem;
    min-width: 150px;
    background-color: var(--primary-color);
    color: var(--white-color);
    cursor: pointer;
}

.modal-content {
    padding: 5px 10px;
}

.page-form .form-field .field-list li i {
    margin: 0px 8px;
    width: 20px;
}

.date-time-wrapper {
    display: flex;
}

.date-time-wrapper input {
    max-width: 150px;
}

.date-time-wrapper select {
    margin: 0px 10px;
    max-width: 80px;
}

.page-form button {
    border: none;
    border-radius: 5px;
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 5px 10px;
    margin: 10px 0px;
    font-size: 1rem;
    width: 200px;
}

.page-form button i {
    margin: 0px 5px;
}

.parsed-contact {
    display: inline-block;
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    padding: 3px 5px;
    margin: 3px 5px;
    color: var(--primary-color);
    font-weight: 600;
}

.parsed-contact span {
    color: var(--primary-color);
    font-weight: bold;
}

.parsed-contact i {
    color: var(--primary-color);
    margin: 0px 5px;
    cursor: pointer;
}

.send-button {
    display: inline-block;
    text-align: center;
    border-style: none;
    border-radius: 3px;
    margin: 10px 0px;
    padding: 5px 0px;
    font-family: var(--main-font);
    font-size: 1rem;
    min-width: 150px;
    background-color: var(--primary-color);
    color: var(--white-color);
    cursor: pointer;
}

.send-button i {
    margin: 0px 5px;
}

.form-errors{
    color:orangered;
    font-size:0.9rem;
}

.account-name{
    font-size:1.2rem;
    margin:0px 20px;
    display:flex;
}

.account-name i{
    margin: 2px 10px;
    color: var(--primary-color);
}

.profile-info{
    display:grid;
    grid-template-columns: 1fr 4fr;
    border-bottom: 1px solid var(--gray-color);
    padding:15px 10px;
    font-size:0.90rem;
}

.profile-info label{
    font-weight:bold;
}

.change-password{
    border:1px solid var(--gray-color);
    border-radius:5px;
    padding:5px 8px;
    font-size: 0.9rem;
    cursor:pointer;    
}


.change-password i{
    margin:0px 8px;
    color: orange;
}

.password-error{
    color:orangered;
    margin:0px 10px;
}

.password-changed{
    color:olivedrab;
    margin:0px 10px;
}


.cost-box{
    padding:10px;
    font-size:var(--medium-text);
}

.cost-box span{
    font-weight:900;
    margin-left:20px;
}


.order-summary{
    display:flex;
    justify-content: space-between;
    padding: 0px 20px;
    width:100%;    
}

.order-summary span{
    font-weight:bold;
    margin-right: 40px;
    margin-left:5px;
}

.payment-box{
    display:flex;
    width:100%;
    background-color:whitesmoke;
    padding:10px 5px;
    border:1px solid var(--gray-color);
}

.payment-method{
    font-size:1rem;
    font-weight:900;
    margin-bottom:20px;
}

.payment-instructions{
    width:33%;
    border: 1px solid var(--primary-color);
    border-radius:3px;
    margin:0px 5px;
    padding:10px 10px;
    font-size:0.95rem;
    background-color:var(--white-color);
}

.pay-now{
    border:1px solid var(--primary-color);
    border-radius:5px;
    padding:2px 5px;
    margin: 5px 0px;
    font-size: 0.9rem;
    cursor:pointer;    
}

.send-custom{
    background:var(--primary-color);
    color:var(--white-color);
    min-width:100px;
    text-align:center;
}

.required-balance{
    cursor:none;
    font-size:0.85rem;
    padding-top:5px;
    border-style:none;
    color: orangered;
}

.message-sent{
    color:olivedrab;
    font-weight:bold;
    font-size:1.2rem;
    padding:30px 10px;
    border:1px solid olivedrab;
    border-radius:5px;
    text-align:center;
}


.message-failed{
    color:orangered;
    font-weight:bold;
    font-size:1.2rem;
    padding:30px 10px;
    border:1px solid var(--gray-color);
    border-radius:5px;
    text-align:center;
}

.reseller-logo {
    min-height: 110px;
    width: 100%;
    max-width: 260px;
    text-align: center;
    padding: 16px 14px;
    margin: 8px auto 12px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(11, 44, 95, 0.08);
}
.reseller-logo img{
    width:100%;
    max-height: 96px;
    height:auto;
    object-fit: contain;
}

/* Faster, clearer listening inbox */
.incoming-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin: 8px 0 14px;
}
.incoming-toolbar select,
.incoming-toolbar input,
.incoming-toolbar button {
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #d8dce3;
    font: inherit;
}
.incoming-toolbar button,
.send-button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 700;
}
.content-wrapper {
    transition: opacity .15s ease;
}
.nav-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.18);
    color: #fff;
    font-size: 1.15rem;
    cursor: pointer;
    flex-shrink: 0;
}
.nav-backdrop {
    display: none;
}
@media (max-width: 768px) {
    header { flex-wrap: wrap; gap: 8px; }
    header .header-brand-text { font-size: 1rem; }
    header ul li { padding: 5px 10px; font-size: 0.9rem; }
    .menu { width: 100%; }
    .container { display: block; }
    .login-form { width: 92vw; padding: 20px; }
}


.footer{
    background:var(--primary-color);
    min-height:50px;
    display:flex;
    padding: 10px 20px;
    justify-content: space-between;
}

.footer .reseller-name{
    font-size: 1.2rem;
    font-weight:bold;
    color:var(--white-color);
    margin:10px 0px;
}


.footer .reseller-address{
    font-size: 0.95rem;
    color:var(--white-color);
    padding:5px 0px;
}

.footer .reseller-address i{
    margin-right: 8px;
}

.reseller-legal{
    margin:10px 0px;
}

.copyright{
    font-size: .85rem;
    color: var(--white-color);
}


#antispam-wrapper {
    border-style: solid;
    border-width: 1px;
    border-color: var(--primary-color);
    border-radius: 5px;
    display: flex;
    width: 90%;
    float: center;
    margin: 0 auto;
    margin-bottom: 10px;
    margin-top:10px;
    padding:5px 10px;
}

/* --- Dashboard (SMS home) --- */
.dashboard-page {
    padding-bottom: 24px;
}
.dashboard-welcome {
    font-size: 1rem;
    margin: 10px 0 18px;
    color: var(--black-color);
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.dash-card {
    display: block;
    background: var(--white-color);
    border: 1px solid #d5d8d0;
    border-radius: 10px;
    padding: 14px 12px;
    color: var(--black-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.dash-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(194,39,39,0.15);
}
.dash-icon {
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 6px;
}
.dash-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
    font-weight: 600;
}
.dash-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--black-color);
    margin: 4px 0;
}
.dash-hint {
    font-size: 0.75rem;
    color: #666;
    line-height: 1.3;
}
.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.dash-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 6px;
    background: var(--primary-color);
    color: var(--white-color);
    font-weight: 600;
    font-size: 0.9rem;
}
.dash-action-btn i {
    color: var(--white-color);
}
.dash-action-btn--neutral {
    background: #3a3a3a;
}
.dash-action-btn--neutral:hover {
    filter: brightness(1.08);
}
.dash-card-link {
    color: inherit;
    text-decoration: none;
}
.dashboard-section {
    margin-top: 28px;
}
.dashboard-section-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--black-color);
    margin-bottom: 12px;
}

/* Compose: supported country codes */
.supported-prefixes-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 4px;
}
.supported-prefixes-banner .pfx {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    background: #f4f6f8;
    border: 1px solid #dde2e8;
}
.supported-prefixes-banner .pfx i {
    color: var(--primary-color);
}
.supported-prefixes-banner .pfx strong {
    font-weight: 800;
    font-size: 1rem;
    color: var(--primary-color);
}
.supported-prefixes-note {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: #444;
    line-height: 1.4;
}

/* --- Incoming page polish --- */
.incoming-filters {
    margin-bottom: 14px;
    border-radius: 10px;
    background: #fbfbfc;
}
.incoming-actions-bar {
    margin-bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.incoming-report-label {
    opacity: 0.85;
    font-size: 0.9rem;
    font-weight: 600;
}
.incoming-action-btn {
    display: inline-block;
    text-decoration: none;
    min-width: 132px;
    padding: 7px 12px;
    font-size: 0.85rem;
}
.incoming-table-wrap {
    border: 1px solid #e4e7ec;
    border-radius: 10px;
    overflow: auto;
    background: #fff;
}
.incoming-table {
    border: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.86rem;
}
.incoming-table td {
    vertical-align: top;
    line-height: 1.45;
}
.incoming-table-header {
    background: #f8fafc;
    font-weight: 700;
    color: #1f2937;
}
.incoming-row td {
    border-bottom: 1px solid #eef2f7;
}
.incoming-empty {
    padding: 16px;
    text-align: center;
    color: #4b5563;
    font-weight: 600;
}
.incoming-delete-btn {
    border: 1px solid #e5c4c4;
    color: #9b1c1c;
    background: #fff7f7;
    border-radius: 6px;
    padding: 5px 10px;
    cursor: pointer;
    font-weight: 600;
}
.incoming-delete-btn:hover {
    background: #ffe9e9;
}
.incoming-card {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.incoming-card-title {
    margin: 0 0 10px 0;
    font-size: 1rem;
    font-weight: 800;
    color: #111827;
}

/* My Account — API key */
.api-key-row .api-key-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    max-width: 100%;
}
.api-key-value {
    display: inline-block;
    max-width: 100%;
    word-break: break-all;
    overflow-wrap: anywhere;
    padding: 8px 10px;
    background: #f4f6f8;
    border: 1px solid #dde2e8;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.4;
}
.api-key-copy-btn,
.api-key-generate,
.api-key-regen {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    font-family: var(--main-font);
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--primary-color);
    color: var(--white-color);
    text-decoration: none;
}
.api-key-regen {
    background: #444;
}
.api-key-missing {
    font-size: 0.9rem;
    color: #555;
}
.account-flash {
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 14px;
    font-size: 0.9rem;
}
.account-flash-success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #1b5e20;
}
.account-flash-error {
    background: #ffebee;
    border: 1px solid #ef9a9a;
    color: #b71c1c;
}

/* --- Responsive layout (phones / small tablets) --- */
@media (max-width: 960px) {
    .container {
        flex-direction: row;
        align-items: flex-start;
    }
    .menu {
        width: 200px;
        min-width: 160px;
        max-width: 40%;
        flex-shrink: 0;
        min-height: 80vh;
        border-right: 1px solid var(--gray-color);
        border-bottom: none;
    }
    .menu ul {
        display: block;
        padding: 12px 6px;
    }
    .menu ul li {
        flex: none;
        min-width: 0;
        text-align: left;
    }
    .content-wrapper {
        flex: 1;
        min-width: 0;
        width: auto;
        padding: 12px 14px;
    }
    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .login-form {
        width: 92%;
        max-width: 420px;
    }
    .modal-wrapper {
        width: 94% !important;
        max-width: 94% !important;
        max-height: 88vh;
    }
    #contacts_modal .modal-wrapper,
    #groups_modal .modal-wrapper,
    #templates_modal .modal-wrapper {
        max-width: 96% !important;
    }
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    .dashboard-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* Narrow phones: stack menu above content, full-width tables scroll */
@media (max-width: 640px) {
    header {
        flex-wrap: wrap;
        gap: 8px;
    }
    header ul {
        flex-wrap: wrap;
        justify-content: flex-end;
        width: 100%;
    }
    header ul li {
        padding: 4px 10px;
        font-size: 0.9rem;
    }
    .container {
        flex-direction: column;
    }
    .menu {
        width: 100%;
        max-width: none;
        min-width: 0;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--gray-color);
    }
    .menu ul {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
    }
    .content-wrapper {
        width: 100%;
        padding: 10px 12px;
    }
    .page-title {
        font-size: 1.15rem;
        line-height: 1.3;
    }
}

/* Conversation desk */
.conv-layout { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 16px; min-height: 70vh; }
.conv-list { border: 1px solid #e6e8ed; border-radius: 12px; overflow: auto; background: #fff; max-height: 78vh; }
.conv-item { display: block; padding: 12px 14px; border-bottom: 1px solid #f0f1f4; color: inherit; }
.conv-item:hover, .conv-item.is-active { background: #fff5f5; }
.conv-item-top { display: flex; align-items: center; gap: 8px; }
.conv-channel { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 999px; }
.conv-channel.sms { background: #e8f0fe; color: #0B2C5F; }
.conv-channel.wa { background: #e8f8ef; color: #128C7E; }
.conv-badge { margin-left: auto; background: #E31C23; color: #fff; border-radius: 999px; min-width: 18px; text-align: center; font-size: 11px; padding: 1px 6px; }
.conv-preview { color: #555; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { display: flex; justify-content: space-between; gap: 8px; color: #888; font-size: 11px; margin-top: 4px; }
.conv-thread { border: 1px solid #e6e8ed; border-radius: 12px; background: linear-gradient(180deg, #fafbfc, #fff); display: flex; flex-direction: column; min-height: 70vh; }
.conv-thread-header { padding: 14px 16px; border-bottom: 1px solid #eee; }
.conv-bubbles { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.conv-bubble { max-width: 82%; padding: 10px 12px; border-radius: 14px; }
.conv-bubble.in { align-self: flex-start; background: #f3f4f6; }
.conv-bubble.out { align-self: flex-end; background: #ffe8e8; border: 1px solid #ffd0d0; }
.conv-bubble-body { white-space: pre-wrap; line-height: 1.4; }
.conv-bubble-meta { margin-top: 6px; font-size: 10px; color: #777; }
.conv-reply-form { border-top: 1px solid #eee; padding: 14px 16px; display: grid; gap: 10px; }
@media (max-width: 900px) {
  .conv-layout { grid-template-columns: 1fr; }
  .conv-list { max-height: 40vh; }
}

/* Role pills */
.role-pill { display:inline-block; margin-left:10px; padding:3px 10px; border-radius:999px; font-size:11px; font-weight:800; letter-spacing:.03em; vertical-align:middle; }
.role-pill.role-admin { background:#0B2C5F; color:#fff; }
.role-pill.role-client { background:#E31C23; color:#fff; }
header .role-pill { margin-left:8px; }
@media (max-width: 720px) {
  header { flex-wrap: wrap; gap: 8px; }
  header ul { flex-wrap: wrap; }
  .dashboard-grid { grid-template-columns: 1fr !important; }
}

/* === Cross-device responsive (phone / tablet / iPad / desktop) === */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}
body {
    overflow-x: hidden;
}
img, video, svg {
    max-width: 100%;
    height: auto;
}
.content-wrapper,
.page-form,
.incoming-toolbar,
table {
    max-width: 100%;
}
.table-scroll,
.content-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
input, select, textarea, button, .send-button, .dash-action-btn, .submit-button {
    font-size: 16px; /* avoid iOS zoom on focus */
}
.form-field input[type=text],
.form-field input[type=password],
.form-field input[type=email],
.form-field textarea,
.form-field select {
    max-width: 100%;
}

@media (max-width: 1024px) {
    .menu {
        width: 200px;
        min-width: 180px;
    }
    .dashboard-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 900px) {
    .nav-toggle { display: inline-flex; }
    header {
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        position: sticky;
        top: 0;
        z-index: 40;
    }
    header .logo {
        flex: 1;
        min-width: 0;
        gap: 8px;
    }
    header .header-brand-logo {
        height: 36px;
        max-width: 110px;
    }
    header .header-brand-text {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    header .header-nav {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 4px;
        padding-top: 4px;
    }
    header .header-nav li {
        padding: 6px 10px;
    }
    .container {
        display: block;
        position: relative;
    }
    .menu {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(300px, 86vw);
        min-width: 0;
        z-index: 50;
        transform: translateX(-105%);
        transition: transform .22s ease;
        overflow-y: auto;
        box-shadow: 8px 0 24px rgba(0,0,0,.18);
        border-right: none;
    }
    body.nav-open .menu {
        transform: translateX(0);
    }
    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(5, 6, 8, 0.45);
        z-index: 45;
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }
    body.nav-open .nav-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
    body.nav-open .nav-backdrop[hidden] {
        display: block;
    }
    .content-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        padding: 12px !important;
        min-width: 0;
    }
    .login-form {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: min(420px, 94vw);
        margin: 8vh auto 24px;
        padding: 22px 18px;
    }
    .footer {
        flex-direction: column;
        gap: 8px;
    }
    .incoming-toolbar {
        flex-wrap: wrap;
    }
    .incoming-toolbar > * {
        flex: 1 1 140px;
    }
    table {
        font-size: 0.92rem;
    }
    .dash-action-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body { font-size: 13px; }
    header .header-brand-text { display: none; }
    .role-pill { display: none; }
    .login-brand-logo { width: min(180px, 75%); }
    .form-title { font-size: 1.2rem; }
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .menu ul li a {
        font-size: 0.95rem;
        padding: 4px 0;
    }
    .menu ul li {
        padding: 12px 8px;
    }
}

@media (min-width: 901px) and (max-width: 1200px) {
    .menu {
        width: 18%;
        min-width: 200px;
    }
}

@media (min-width: 1280px) {
    .content-wrapper {
        max-width: 1200px;
    }
    .login-form {
        width: 440px;
    }
}

@media (hover: none) and (pointer: coarse) {
    header ul li a,
    .menu ul li a,
    .dash-card,
    .send-button,
    .dash-action-btn {
        min-height: 44px;
    }
    .menu ul li {
        padding: 12px 8px;
    }
}

