:root{
    --bg:#f5f7fb;
    --card:#fff;
    --text:#14213d;
    --muted:#6b7280;
    --line:#e5e7eb;
    --accent:#175cd3;
}

html,body{min-height:100%}
body{
    background:var(--bg);
    color:var(--text);
    font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}
.container{max-width:1240px}
.letter-spacing-1{letter-spacing:.08em}

.navbar{min-height:58px}
.navbar-brand{letter-spacing:-.02em}
a{text-underline-offset:3px}

.page-head{margin:26px 0}
.muted,.text-secondary{color:var(--muted)!important}

.auth-card,.form-card{
    max-width:520px;
    margin:40px auto;
    background:var(--card);
    border:1px solid var(--line);
    border-radius:16px;
    padding:28px;
    box-shadow:0 6px 24px rgba(20,33,61,.05);
}
.form-card-wide{max-width:900px}
.portal-news-table-card{max-width:1180px}

.customer-header{
    background:
        radial-gradient(circle at 100% 0%, rgba(23,92,211,.08), transparent 32%),
        #fff;
}
.customer-avatar{
    width:76px;
    height:76px;
    border-radius:20px;
    display:grid;
    place-items:center;
    background:#eaf2ff;
    color:var(--accent);
    font-size:24px;
    font-weight:700;
    letter-spacing:.03em;
}

.card{
    border-radius:16px!important;
}
.card-header{
    border-radius:16px 16px 0 0!important;
}

.section-kicker{
    color:var(--accent);
    text-transform:uppercase;
    font-weight:700;
    font-size:11px;
    letter-spacing:.09em;
    margin-bottom:5px;
}

.info-grid{margin-top:-1px}
.info-field{
    padding:16px 0;
    border-bottom:1px solid var(--line);
}
.info-field span,
.mini-field span{
    display:block;
    color:var(--muted);
    font-size:12px;
    margin-bottom:5px;
}
.info-field strong,
.mini-field strong{font-size:15px}

.contact-row{
    display:flex;
    align-items:center;
    gap:14px;
    padding:16px 0;
    border-bottom:1px solid var(--line);
}
.contact-row:last-child{border-bottom:0}
.contact-icon{
    width:28px;
    height:28px;
    border-radius:8px;
    display:grid;
    place-items:center;
    background:#f1f5f9;
    flex:0 0 28px;
    font-weight:400;
}
.contact-icon svg{
    width:15px;
    height:15px;
    display:block;
    stroke-width:1.5;
}

.address-box{
    height:100%;
    padding:20px;
    border:1px solid var(--line);
    border-radius:14px;
    background:#fbfcfe;
}
.address-value{
    font-size:15px;
    line-height:1.55;
    font-weight:500;
}
.contract-number{
    font-size:23px;
    line-height:1.2;
    font-weight:700;
    letter-spacing:-.02em;
}
.mini-field{
    height:100%;
    padding:14px 15px;
    border:1px solid var(--line);
    border-radius:12px;
    background:#fbfcfe;
}
.empty-state{
    min-height:150px;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:flex-start;
    color:var(--muted);
}
.empty-state-title{
    color:var(--text);
    font-weight:600;
    margin-bottom:4px;
}
.credentials-icon{
    width:38px;
    height:38px;
    border-radius:50%;
    display:grid;
    place-items:center;
    background:rgba(25,135,84,.12);
    color:#198754;
    font-weight:800;
}

.table{
    background:#fff;
    border-radius:12px;
    overflow:hidden;
}

.contract-paper{
    max-width:900px;
    margin:24px auto;
    background:#fff;
    border:1px solid #dfe3e8;
    padding:56px 64px;
    box-shadow:0 8px 30px rgba(20,33,61,.06);
    line-height:1.55;
}
.contract-paper h3{font-size:18px;margin:28px 0 12px}
.contract-paper table th{font-weight:600}

@media (max-width:767.98px){
    .customer-header .card-body{padding:24px!important}
    .customer-avatar{width:62px;height:62px;border-radius:16px;font-size:20px}
    .contract-paper{padding:28px 20px}
}

@media print{
    nav,.container.py-2,.page-head,.contract-toolbar,.btn{display:none!important}
    body{background:#fff!important}
    .container{max-width:none!important}
    .contract-paper{box-shadow:none;border:0;margin:0;padding:0;max-width:none}
}

.customer-form-page{padding-bottom:40px}
.customer-form-page .display-6{font-size:2.25rem;letter-spacing:-.035em}
.customer-form{
    padding:0;
}
.customer-form .form-section{
    padding:30px 34px;
    border-bottom:1px solid var(--line);
}
.customer-form .form-section:last-of-type{border-bottom:0}
.form-section-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:20px;
    margin-bottom:24px;
}
.section-kicker{
    color:var(--accent);
    text-transform:uppercase;
    font-weight:700;
    font-size:11px;
    letter-spacing:.09em;
    margin-bottom:5px;
}
.customer-form .form-label{
    color:#334155;
    font-size:13px;
    font-weight:600;
    margin-bottom:7px;
}
.customer-form .form-control,
.customer-form .form-select{
    min-height:44px;
    border-color:#d8dee8;
    border-radius:10px;
    padding:.6rem .75rem;
    box-shadow:none;
}
.customer-form textarea.form-control{min-height:84px}
.customer-form .form-control:focus{
    border-color:#86aef3;
    box-shadow:0 0 0 .2rem rgba(23,92,211,.10);
}
.customer-form .form-control[readonly]{
    background:#f8fafc;
}
.customer-form .invalid-feedback{
    font-size:12px;
}
.address-search-wrap{position:relative}
.address-suggestions{
    position:absolute;
    z-index:30;
    left:0;
    right:0;
    top:calc(100% - 16px);
    max-height:280px;
    overflow-y:auto;
    background:#fff;
    border:1px solid #d8dee8;
    border-radius:10px;
    box-shadow:0 10px 28px rgba(20,33,61,.12);
}
.address-suggestions:empty{display:none}
.address-suggestions .list-group-item{
    border:0;
    border-bottom:1px solid #eef1f5;
    padding:11px 13px;
    font-size:13px;
}
.address-suggestions .list-group-item:last-child{border-bottom:0}
.address-same-switch{
    padding-top:22px;
}
.address-same-switch .form-check{
    margin:0;
}
.address-same-switch label{
    font-size:13px;
    color:#475569;
    cursor:pointer;
}
.form-footer{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:20px;
    padding:20px 34px;
    background:#fbfcfe;
    border-top:1px solid var(--line);
    border-radius:0 0 16px 16px;
    position:sticky;
    bottom:0;
    z-index:10;
    box-shadow:0 -8px 20px rgba(20,33,61,.04);
}
.form-side-panel{
    position:sticky;
    top:20px;
}
.form-step{
    display:flex;
    align-items:flex-start;
    gap:12px;
    padding:13px 0;
    border-bottom:1px solid var(--line);
}
.form-step:last-of-type{border-bottom:0}
.form-step-number{
    width:30px;
    height:30px;
    flex:0 0 30px;
    display:grid;
    place-items:center;
    border-radius:9px;
    background:#eef4ff;
    color:var(--accent);
    font-size:12px;
    font-weight:700;
}
.form-step strong{
    display:block;
    font-size:13px;
    margin-bottom:2px;
}
.form-step div{
    color:var(--muted);
    font-size:12px;
    line-height:1.4;
}
.customer-form-page .card{
    border-radius:16px!important;
}


.service-address-suggestions{
    z-index:1080;
    max-height:280px;
    overflow-y:auto;
}
.service-address-suggestions:empty{
    display:none;
}
.service-address-suggestions .list-group-item{
    border-left:0;
    border-right:0;
}

/* Nested RBAC menu */
.navbar .dropdown-menu .dropend > .dropdown-menu{
    top:0;
    left:100%;
    margin-top:0;
    margin-left:.125rem;
}

/* Breadcrumb navigation */
.breadcrumb-wrap{
    padding:0 2px;
}
.breadcrumb{
    --bs-breadcrumb-divider: "/";
    font-size:13px;
    color:var(--muted);
}
.breadcrumb a{
    color:var(--muted);
    text-decoration:none;
}
.breadcrumb a:hover{
    color:var(--accent);
}
.breadcrumb-item.active{
    color:var(--text);
    font-weight:500;
}


/* Tariff billing and status controls */
.tariff-billing-options,
.tariff-status-control{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:10px;
}
.tariff-billing-text,
.tariff-status-label{
    font-size:13px;
    font-weight:500;
    line-height:20px;
    white-space:nowrap;
    color:#475569;
}
.tariff-billing-toggle,
.tariff-status-toggle{
    position:relative;
    display:inline-flex;
    align-items:center;
    width:32px;
    height:20px;
    padding:0;
    border:0;
    border-radius:999px;
    flex:0 0 32px;
    cursor:pointer;
    transition:background-color .18s ease, box-shadow .18s ease;
}
.tariff-billing-toggle.is-monthly{
    background:#0d6efd;
}
.tariff-billing-toggle.is-daily{
    background:#198754;
}
.tariff-status-toggle.is-active{
    background:#198754;
}
.tariff-status-toggle.is-inactive{
    background:#dc3545;
}
.tariff-billing-toggle:hover,
.tariff-status-toggle:hover{
    box-shadow:0 0 0 3px rgba(23,92,211,.08);
}
.tariff-billing-knob,
.tariff-status-knob{
    position:absolute;
    top:2px;
    left:2px;
    width:16px;
    height:16px;
    border-radius:50%;
    background:#fff;
    box-shadow:0 1px 3px rgba(20,33,61,.20);
    transition:transform .18s ease;
}
.tariff-billing-toggle.is-daily .tariff-billing-knob,
.tariff-status-toggle.is-active .tariff-status-knob{
    transform:translateX(12px);
}
.tariff-billing-toggle:focus-visible,
.tariff-status-toggle:focus-visible{
    outline:0;
    box-shadow:0 0 0 3px rgba(23,92,211,.18);
}


/* Bootstrap switches: green when enabled, red when disabled */
.form-switch .form-check-input{
    background-color:#dc3545;
    border-color:#dc3545;
}

.form-switch .form-check-input:checked{
    background-color:#198754;
    border-color:#198754;
}

.form-switch .form-check-input:focus{
    border-color:#dc3545;
    box-shadow:0 0 0 .2rem rgba(220,53,69,.15);
}

.form-switch .form-check-input:checked:focus{
    border-color:#198754;
    box-shadow:0 0 0 .2rem rgba(25,135,84,.15);
}


/* Group settings switches */
.group-toggle-row{
    display:flex;
    align-items:center;
    gap:10px;
}
.group-toggle{
    position:relative;
    display:inline-flex;
    align-items:center;
    width:32px;
    height:20px;
    padding:0;
    border:0;
    border-radius:999px;
    flex:0 0 32px;
    cursor:pointer;
    transition:background-color .18s ease, box-shadow .18s ease;
}
.group-toggle.is-on{ background:#198754; }
.group-toggle.is-off{ background:#dc3545; }
.group-toggle:hover{ box-shadow:0 0 0 3px rgba(23,92,211,.08); }
.group-toggle-knob{
    position:absolute;
    top:2px;
    left:2px;
    width:16px;
    height:16px;
    border-radius:50%;
    background:#fff;
    box-shadow:0 1px 3px rgba(20,33,61,.20);
    transition:transform .18s ease;
}
.group-toggle.is-on .group-toggle-knob{ transform:translateX(12px); }
.group-toggle:focus-visible{
    outline:0;
    box-shadow:0 0 0 3px rgba(23,92,211,.18);
}
.group-toggle-label{
    font-size:13px;
    font-weight:500;
    line-height:20px;
    color:#475569;
}
