@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Manrope:wght@400;500;600;700;800&display=swap');
:root {
    /* iMart Group Ltd brand (unchanged hexes) */
    --primary-color: #E31C23;
    --navy-color: #0B2C5F;
    --red-color: #E31C23;
    --secondary-red: #C41E3A;
    --white-color: #FFFFFF;
    --black-color: #E8EEF6;
    --gray-color: rgba(255, 255, 255, 0.12);
    --main-font: 'Manrope', system-ui, sans-serif;
    --display-font: 'Instrument Serif', Georgia, serif;

    /* Dark SaaS shell (derived from navy/red) */
    --surface-0: #071829;
    --surface-1: #0B2C5F;
    --surface-2: rgba(255, 255, 255, 0.06);
    --surface-3: rgba(255, 255, 255, 0.1);
    --surface-glass: rgba(11, 44, 95, 0.72);
    --text: #F4F7FB;
    --text-muted: rgba(232, 238, 246, 0.72);
    --accent: #E31C23;
    --accent-soft: rgba(227, 28, 35, 0.22);
    --success: #34D399;
    --line: rgba(255, 255, 255, 0.12);
    --radius: 14px;
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
}

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

body {
    font-family: var(--main-font);
    font-size: 14px;
    min-height: 100%;
    color: var(--text);
    background:
        radial-gradient(ellipse 80% 50% at 10% -10%, rgba(227, 28, 35, 0.18), transparent 55%),
        radial-gradient(ellipse 70% 45% at 100% 0%, rgba(11, 44, 95, 0.9), transparent 50%),
        linear-gradient(165deg, #061221 0%, var(--surface-0) 40%, #0a1f3d 100%);
    background-attachment: fixed;
}

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

ul {
    list-style: none;
}

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

header {
    background: rgba(7, 24, 41, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--text);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 22px;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 40;
}

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

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

header .header-brand-text {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--text);
}

header ul {
    display: flex;
    align-items: center;
}

header ul li {
    padding: 6px 14px;
    font-size: 0.92rem;
    font-weight: 600;
}

header ul li a {
    color: var(--text-muted);
    transition: color 0.15s ease;
}
header ul li a:hover {
    color: var(--text);
}

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

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

.container {
    display: flex;
    min-height: calc(100vh - 160px);
}

.menu {
    color: var(--text);
    width: 240px;
    min-height: calc(100vh - 72px);
    min-width: 220px;
    border-right: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(11, 44, 95, 0.92), rgba(7, 24, 41, 0.96));
    padding: 8px 10px 24px;
}

.menu ul {
    padding: 8px 4px;
}

.menu ul li {
    padding: 0;
    margin: 4px 0;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.menu ul li div{
    display:inline-flex;
    align-items: center;
    justify-content: center;
    text-align:center;
    margin:0 10px 0 0;
    width: 28px;
}

.menu ul li a {
    display: flex;
    align-items: center;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 11px 12px;
    border-radius: 12px;
}

.menu ul li:hover {
    background: var(--surface-2);
    border-color: var(--line);
}

.menu ul li:hover a,
.menu ul li:hover i {
    color: var(--text);
}

.menu ul li i {
    width: auto;
    color: var(--accent);
    font-size: 1.05rem !important;
}

.content-wrapper {
    width: calc(100% - 240px);
    flex: 1;
    padding: 24px 28px 40px;
    min-width: 0;
}

.page-title {
    font-family: var(--display-font);
    font-size: 1.75rem;
    color: var(--text);
    font-weight: 400;
    padding: 5px 0px;
}

.page-header {
    color: var(--text);
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.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: var(--surface-2);
    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: 18px;
    width: 400px;
    max-width: 92vw;
    background: rgba(11, 44, 95, 0.55);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    padding: 28px 28px 24px;
}

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

.login-brand-logo {
    width: min(220px, 70%);
    height: auto;
    object-fit: contain;
    background: #fff;
    border-radius: 12px;
    padding: 8px 12px;
}

.form-title {
    margin: 10px 0px;
    font-family: var(--display-font);
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--text);
    text-align: center;
}

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

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

.form-field input[type=text], .form-field input[type=password] {
    height: 44px;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--line);
    border-radius: 10px;
    width: 100%;
    font-size: 1rem;
    padding: 3px 15px;
    outline: none;
    color: var(--text);
}

.form-field input[type=text]:focus,
.form-field input[type=password]:focus {
    border-color: rgba(227, 28, 35, 0.55);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.login-form a {
    font-weight: 700;
    color: #fff;
}

.form-field input[type=submit],.login-form input[type=button] {
    border: none;
    border-radius: 10px;
    margin: 10px 0px;
    padding: 12px 0px;
    font-family: var(--main-font);
    font-size: 1rem;
    font-weight: 700;
    min-width: 150px;
    background-color: var(--primary-color);
    color: var(--white-color);
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(227, 28, 35, 0.28);
}

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

.error-message {
    color: #ff8a8f;
    font-size: 0.9rem;
}

.login-help-box {
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text-muted);
    background-color: var(--surface-2);
    border-radius: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
}

tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.03);
}

.table-header {
    font-weight: bold;
    background-color: rgba(11, 44, 95, 0.65);
    color: var(--text);
}

td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
}

.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(--line);
    border-radius: var(--radius);
    padding: 20px 16px;
    background: var(--surface-2);
}

.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: var(--surface-2);
    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: auto;
    width: 100%;
    max-width: 220px;
    text-align: center;
    padding: 14px 12px;
    margin: 8px auto 16px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.reseller-logo img{
    width:100%;
    max-height: 72px;
    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: rgba(7, 24, 41, 0.92);
    min-height:50px;
    display:flex;
    padding: 18px 24px;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--line);
}

.footer .reseller-name{
    font-size: 1.05rem;
    font-weight:800;
    color:var(--text);
    margin:6px 0px;
}


.footer .reseller-address{
    font-size: 0.88rem;
    color:var(--text-muted);
    padding:4px 0px;
}

.footer .reseller-address i{
    margin-right: 8px;
    color: var(--accent);
}

.footer a {
    color: #fff;
    font-weight: 600;
}

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

.copyright{
    font-size: .82rem;
    color: var(--text-muted);
}


#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 22px;
    color: var(--text-muted);
    max-width: 52rem;
    line-height: 1.55;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.dash-card {
    display: block;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 16px;
    color: var(--text);
    box-shadow: 0 8px 28px rgba(0,0,0,0.18);
    transition: transform 0.18s ease, border-color 0.15s ease, box-shadow 0.18s ease;
    backdrop-filter: blur(8px);
}
.dash-card:hover {
    border-color: rgba(227, 28, 35, 0.55);
    box-shadow: 0 14px 36px rgba(0,0,0,0.28);
    transform: translateY(-2px);
}
.dash-icon {
    font-size: 1.25rem;
    color: var(--accent);
    margin-bottom: 8px;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
}
.dash-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
}
.dash-value {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text);
    margin: 6px 0;
}
.dash-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.35;
}
.dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.dash-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 10px;
    background: var(--primary-color);
    color: var(--white-color);
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 8px 20px rgba(227, 28, 35, 0.25);
}
.dash-action-btn i {
    color: var(--white-color);
}
.dash-action-btn--neutral {
    background: rgba(255,255,255,0.1);
    box-shadow: none;
    border: 1px solid var(--line);
}
.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(--text);
    margin-bottom: 12px;
}
.dash-android-card {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: linear-gradient(135deg, rgba(227,28,35,0.16), rgba(11,44,95,0.55));
    margin: 8px 0 22px;
}
.dash-android-card h3 {
    margin: 0 0 6px;
    font-family: var(--display-font);
    font-weight: 400;
    font-size: 1.35rem;
    color: var(--text);
}
.dash-android-card p {
    margin: 0;
    color: var(--text-muted);
    max-width: 36rem;
    line-height: 1.5;
}
.dash-quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 8px;
}
.dash-quick-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--text);
    font-weight: 700;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.dash-quick-link:hover {
    transform: translateY(-2px);
    border-color: rgba(227, 28, 35, 0.45);
}
.dash-quick-link i {
    color: var(--accent);
}

/* 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: var(--radius);
    background: var(--surface-2);
    border: 1px solid var(--line);
    padding: 12px;
}
.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;
    color: var(--text-muted);
}
.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 var(--line);
    border-radius: var(--radius);
    overflow: auto;
    background: var(--surface-2);
}
.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: rgba(11, 44, 95, 0.75);
    font-weight: 700;
    color: var(--text);
}
.incoming-row td {
    border-bottom: 1px solid var(--line);
}
.incoming-empty {
    padding: 16px;
    text-align: center;
    color: var(--text-muted);
    font-weight: 600;
}
.incoming-delete-btn {
    border: 1px solid rgba(227, 28, 35, 0.45);
    color: #ffb4b8;
    background: var(--accent-soft);
    border-radius: 8px;
    padding: 5px 10px;
    cursor: pointer;
    font-weight: 600;
}
.incoming-delete-btn:hover {
    background: rgba(227, 28, 35, 0.35);
}
.incoming-card {
    margin-top: 16px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}
.incoming-card-title {
    margin: 0 0 10px 0;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}

/* 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 var(--line); border-radius: var(--radius); overflow: auto; background: var(--surface-2); max-height: 78vh; }
.conv-item { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); color: inherit; }
.conv-item:hover, .conv-item.is-active { background: var(--accent-soft); }
.conv-item-top { display: flex; align-items: center; gap: 8px; color: var(--text); }
.conv-channel { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 999px; }
.conv-channel.sms { background: rgba(11, 44, 95, 0.85); color: #fff; border: 1px solid var(--line); }
.conv-channel.wa { background: rgba(18, 140, 126, 0.25); color: #6ee7b7; border: 1px solid rgba(110, 231, 183, 0.25); }
.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: var(--text-muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { display: flex; justify-content: space-between; gap: 8px; color: var(--text-muted); font-size: 11px; margin-top: 4px; }
.conv-thread { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, rgba(11,44,95,0.45), rgba(7,24,41,0.55)); display: flex; flex-direction: column; min-height: 70vh; }
.conv-thread-header { padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--text); }
.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: rgba(255,255,255,0.08); color: var(--text); border: 1px solid var(--line); }
.conv-bubble.out { align-self: flex-end; background: var(--accent-soft); border: 1px solid rgba(227,28,35,0.35); color: var(--text); }
.conv-bubble-body { white-space: pre-wrap; line-height: 1.4; }
.conv-bubble-meta { margin-top: 6px; font-size: 10px; color: var(--text-muted); }
.conv-reply-form { border-top: 1px solid var(--line); 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;
    }
}


/* === Dark SaaS polish (forms, status, panels) === */
.secondary-color { color: var(--accent); }
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
  margin-right: 6px;
}
.page-form input[type=text],
.page-form input[type=password],
.page-form input[type=email],
.page-form input[type=number],
.page-form input[type=url],
.page-form textarea,
.page-form select,
.content-wrapper input[type=text],
.content-wrapper input[type=password],
.content-wrapper input[type=email],
.content-wrapper input[type=number],
.content-wrapper input[type=url],
.content-wrapper input[type=date],
.content-wrapper textarea,
.content-wrapper select {
  background: rgba(255,255,255,0.07) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px;
}
.content-wrapper label,
.page-form label,
.content-wrapper p,
.content-wrapper strong {
  color: var(--text);
}
.content-wrapper .muted,
.page-hint {
  color: var(--text-muted) !important;
}
.api-key-value {
  background: rgba(255,255,255,0.08) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}
.supported-prefixes-banner .pfx {
  background: var(--surface-2) !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}
.supported-prefixes-note { color: var(--text-muted) !important; }
.badge-ok, .status-replied { background: rgba(52,211,153,0.18); color: #6ee7b7; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 700; }
.badge-pending, .status-pending, .status-awaiting { background: var(--accent-soft); color: #ffb4b8; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 700; }
.badge-new, .status-new { background: rgba(255,255,255,0.1); color: var(--text); border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 700; }
body.login-page {
  min-height: 100vh;
}
.login-back a { color: #fff !important; }

.menu ul li.nav-item.is-active {
  background: rgba(227, 28, 35, 0.18);
  border-color: rgba(227, 28, 35, 0.35);
}
.menu ul li.nav-item.is-active a,
.menu ul li.nav-item.is-active i {
  color: #fff !important;
}
.page-menu li {
  border-color: var(--line) !important;
  background: var(--surface-2);
  border-radius: 8px;
}
.page-menu li a { color: var(--text-muted); }
.page-menu li a:hover { color: #fff; }
.account-name { color: var(--text); font-weight: 700; }
.modal-wrapper {
  background: #0B2C5F !important;
  color: var(--text) !important;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.modal-title { color: #fff !important; }
