:root {
    --navy: #0d2138;
    --navy-2: #18334e;
    --teal: #18b797;
    --teal-dark: #0c9076;
    --teal-soft: #e7f8f4;
    --amber: #f6a928;
    --amber-soft: #fff5df;
    --red: #e25757;
    --red-soft: #ffeded;
    --blue-soft: #eaf2ff;
    --ink: #172536;
    --muted: #6f7c8b;
    --line: #dfe6eb;
    --surface: #ffffff;
    --canvas: #f4f7f8;
    --shadow: 0 16px 45px rgba(24, 51, 78, .08);
    --radius: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font: 14px/1.5 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, strong { font-family: 'Manrope', 'DM Sans', sans-serif; }

.topbar {
    min-height: 72px;
    padding: 0 max(24px, calc((100vw - 1440px) / 2));
    display: grid;
    grid-template-columns: minmax(250px, 1fr) auto minmax(250px, 1fr);
    align-items: center;
    background: var(--navy);
    color: white;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .12);
    position: sticky;
    top: 0;
    z-index: 20;
}
.logo { display: inline-flex; align-items: center; gap: 12px; width: max-content; }
.logo > span:last-child { display: flex; flex-direction: column; line-height: 1.2; }
.logo strong { font-size: 15px; letter-spacing: -.02em; }
.logo small { color: #9bb0c3; font-size: 10px; text-transform: uppercase; letter-spacing: .09em; margin-top: 4px; }
.brand-mark {
    width: 64px; height: 64px; border-radius: 18px; padding: 15px;
    background: var(--teal); display: flex; align-items: flex-end; gap: 5px;
    box-shadow: 0 15px 30px rgba(24, 183, 151, .25);
}
.brand-mark span { display: block; flex: 1; background: white; border-radius: 4px 4px 2px 2px; }
.brand-mark span:nth-child(1) { height: 36%; opacity: .72; }
.brand-mark span:nth-child(2) { height: 66%; opacity: .86; }
.brand-mark span:nth-child(3) { height: 100%; }
.brand-mark.small { width: 38px; height: 38px; border-radius: 10px; padding: 9px; gap: 3px; box-shadow: none; }
.topbar nav { align-self: stretch; display: flex; align-items: stretch; gap: 16px; }
.topbar nav a { display: flex; align-items: center; padding: 0 16px; color: #aebdca; font-weight: 600; border-bottom: 3px solid transparent; }
.topbar nav a:hover, .topbar nav a.active { color: white; border-color: var(--teal); }
.account-menu { justify-self: end; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--teal-soft); color: var(--teal-dark); display: grid; place-items: center; font-weight: 800; }
.account-name { color: #dfe8ef; font-weight: 600; }
.account-menu form { border-left: 1px solid #36506a; margin-left: 4px; padding-left: 12px; }
.text-button { border: 0; background: none; padding: 5px; color: #9bb0c3; cursor: pointer; }
.text-button:hover { color: white; }

.page-shell { max-width: 1440px; margin: 0 auto; padding: 38px 24px 54px; min-height: calc(100vh - 130px); }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-heading h1 { margin: 2px 0 5px; font-size: 30px; letter-spacing: -.045em; }
.page-heading p:last-child { color: var(--muted); margin: 0; }
.eyebrow { margin-bottom: 8px; color: var(--teal-dark); font-size: 10px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.button {
    border: 1px solid transparent; border-radius: 9px; min-height: 42px; padding: 10px 15px;
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    font-weight: 700; cursor: pointer; transition: .18s ease; white-space: nowrap;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--teal); color: white; box-shadow: 0 7px 18px rgba(24, 183, 151, .2); }
.button.primary:hover { background: var(--teal-dark); }
.button.secondary { background: white; color: var(--navy-2); border-color: var(--line); }
.button.secondary:hover { border-color: #b9c6d0; box-shadow: 0 5px 13px rgba(24, 51, 78, .07); }
.button.wide { width: 100%; }
.button.renew { background: var(--teal-soft); color: var(--teal-dark); border-color: #c7ebe3; }
.button.danger-text { background: transparent; color: var(--red); }
.button.danger-text:hover { background: var(--red-soft); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { min-height: 126px; background: white; border: 1px solid #e5eaee; border-radius: var(--radius); padding: 22px; display: flex; align-items: center; gap: 18px; box-shadow: 0 8px 24px rgba(24, 51, 78, .045); position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.stat-card.critical::after { background: var(--amber); }
.stat-card.expired::after { background: var(--red); }
.stat-icon { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 19px; font-weight: 800; flex: 0 0 auto; }
.stat-icon.customers { background: var(--blue-soft); color: #3477d4; }
.stat-icon.sims { background: var(--teal-soft); color: var(--teal-dark); }
.stat-icon.critical { background: var(--amber-soft); color: #d58a10; }
.stat-icon.expired { background: var(--red-soft); color: var(--red); }
.stat-card > div:last-child { display: grid; grid-template-columns: auto auto; align-items: center; column-gap: 10px; }
.stat-card span { grid-column: 1 / -1; color: var(--muted); font-weight: 600; font-size: 12px; }
.stat-card strong { font-size: 29px; line-height: 1.25; letter-spacing: -.04em; }
.stat-card small { color: #9ba5af; font-size: 10px; }

.dashboard-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 22px; align-items: start; }
.panel { background: white; border: 1px solid #e3e9ed; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.add-panel { position: sticky; top: 96px; }
.panel-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 21px; }
.panel-heading h2 { font-size: 16px; margin: 0 0 2px; letter-spacing: -.025em; }
.panel-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.icon-tile { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 18px; }
.icon-tile.mint { background: var(--teal-soft); color: var(--teal-dark); }
.icon-tile.amber { background: var(--amber-soft); color: #d58a10; }
.icon-tile.blue { background: var(--blue-soft); color: #3477d4; }
.date-preview { background: #f5faf9; border: 1px solid #dcece8; border-radius: 11px; padding: 13px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; margin-bottom: 19px; position: relative; }
.date-preview div { display: flex; flex-direction: column; }
.date-preview span { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.date-preview strong { font-size: 12px; margin-top: 2px; }
.date-preview .date-arrow { color: var(--teal-dark); font-size: 15px; }
.date-preview b { position: absolute; right: 9px; top: -9px; background: var(--teal); color: white; font-size: 9px; border-radius: 10px; padding: 2px 7px; }

.stack-form { display: flex; flex-direction: column; gap: 15px; }
label { color: #3e4c5a; font-size: 11px; font-weight: 700; }
input, textarea, select {
    width: 100%; margin-top: 6px; border: 1px solid #d7e0e6; background: #fbfcfd; color: var(--ink);
    border-radius: 9px; padding: 11px 12px; outline: 0; transition: .16s; resize: vertical;
}
input:focus, textarea:focus, select:focus { background: white; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(24, 183, 151, .11); }
textarea { min-height: 74px; }
select { min-height: 43px; cursor: pointer; }
label small { display: block; color: #929da8; font-size: 9px; margin-top: 5px; font-weight: 500; }
.optional { float: right; color: #9ba5af; font-weight: 500; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-note { color: #9ba5af; font-size: 10px; text-align: center; margin: 17px 0 0; }
.inline-form { display: inline-flex; }
.top-gap { margin-top: 12px; }

.records-section { min-width: 0; }
.list-toolbar { min-height: 49px; margin: 0 1px 10px; display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.list-toolbar > div { display: flex; align-items: baseline; gap: 8px; padding-top: 8px; }
.list-toolbar h2 { font-size: 18px; margin: 0; letter-spacing: -.025em; }
.list-toolbar > div span { color: var(--muted); font-size: 10px; }
.search-form { display: flex; gap: 7px; }
.search-input { width: min(280px, 24vw); position: relative; }
.search-input span { position: absolute; left: 12px; top: 14px; color: #8592a0; font-size: 17px; }
.search-input input { margin: 0; padding-left: 35px; background: white; }
.filter-tabs { display: flex; gap: 5px; padding: 5px; border-radius: 11px; background: #eaf0f2; width: max-content; max-width: 100%; margin-bottom: 13px; overflow-x: auto; }
.filter-tabs a { padding: 6px 12px; border-radius: 7px; color: #667585; font-size: 11px; font-weight: 700; white-space: nowrap; }
.filter-tabs a.active { background: white; color: var(--navy); box-shadow: 0 2px 7px rgba(24, 51, 78, .1); }

.records-list { display: flex; flex-direction: column; gap: 9px; }
.customer-record { background: white; border: 1px solid #e1e8ec; border-left: 3px solid transparent; border-radius: 13px; overflow: hidden; transition: .18s; box-shadow: 0 5px 16px rgba(24, 51, 78, .035); }
.customer-record:hover { border-color: #cbd6dd; box-shadow: 0 8px 24px rgba(24, 51, 78, .07); }
.customer-record.warning { border-left-color: #e9c367; }
.customer-record.critical { border-left-color: var(--amber); }
.customer-record.expired { border-left-color: var(--red); }
.customer-record summary { min-height: 88px; list-style: none; display: grid; grid-template-columns: minmax(170px, 1.1fr) minmax(150px, 1.1fr) 105px 150px 22px; gap: 14px; align-items: center; padding: 16px 17px; cursor: pointer; }
.customer-record summary::-webkit-details-marker { display: none; }
.customer-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.customer-avatar { width: 38px; height: 38px; border-radius: 11px; background: var(--navy); color: white; display: grid; place-items: center; font-weight: 800; flex: 0 0 auto; }
.customer-identity div, .date-column, .countdown, .sim-preview { min-width: 0; display: flex; flex-direction: column; }
.customer-identity strong { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.customer-identity small, .date-column span, .sim-preview span { color: #8a96a2; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.sim-preview strong { font: 500 11px/1.45 'DM Sans', sans-serif; color: #5e6c79; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.expiry-choice { width: max-content; max-width: 100%; padding: 3px 8px; border-radius: 9px; font-size: 8px; font-weight: 800; line-height: 1.4; white-space: nowrap; }
.sim-preview .expiry-choice { margin-top: 4px; }
.expiry-choice.continue { color: var(--teal-dark); background: var(--teal-soft); }
.expiry-choice.cancel { color: var(--red); background: var(--red-soft); }
.expiry-choice.undecided { color: #687684; background: #edf1f3; }
.date-column strong { font-size: 12px; margin-top: 3px; }
.countdown { align-items: flex-start; gap: 4px; }
.countdown > strong { font-size: 11px; }
.status-badge { display: inline-flex; border-radius: 10px; padding: 2px 7px; font-size: 8px; line-height: 1.4; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.status-badge.active { background: var(--teal-soft); color: var(--teal-dark); }
.status-badge.warning { background: #fff7e7; color: #b17a18; }
.status-badge.critical { background: var(--amber-soft); color: #c57b07; }
.status-badge.expired { background: var(--red-soft); color: var(--red); }
.progress-track { width: 100%; height: 3px; border-radius: 4px; background: #e8edf0; overflow: hidden; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: var(--teal); }
.critical .progress-track i, .warning .progress-track i { background: var(--amber); }
.expired .progress-track i { background: var(--red); }
.chevron { font-size: 17px; color: #8694a0; transition: transform .2s; }
.customer-record[open] .chevron { transform: rotate(180deg); }
.customer-record[open] { border-color: #cbd7dd; }

.record-details { border-top: 1px solid #e8edf0; background: #fbfcfd; padding: 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.detail-block { background: white; border: 1px solid #e3e9ed; border-radius: 11px; padding: 17px; }
.detail-title { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 13px; }
.detail-title h3 { font-size: 13px; margin: 0 0 2px; }
.detail-title p { color: var(--muted); font-size: 10px; margin: 0; }
.detail-title > span { color: var(--muted); font-size: 10px; }
.sim-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.sim-chip { display: inline-flex; align-items: center; gap: 6px; background: #f2f6f7; border-radius: 7px; padding: 5px 5px 5px 9px; }
.sim-chip code { font: 600 11px 'DM Sans', sans-serif; color: var(--navy-2); }
.sim-chip form { display: inline-flex; }
.sim-chip button { border: 0; width: 20px; height: 20px; border-radius: 5px; padding: 0; color: #9aa5ae; background: transparent; cursor: pointer; }
.sim-chip button:hover { color: var(--red); background: var(--red-soft); }
.add-sim-form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px; }
.add-sim-form textarea { min-height: 51px; margin: 0; }
.edit-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.history-block { grid-column: 1 / -1; }
.price-history-list { display: flex; flex-direction: column; gap: 7px; }
.price-history-row { display: grid; grid-template-columns: 95px minmax(190px, 1.35fr) minmax(140px, 1fr) auto; align-items: center; gap: 16px; border: 1px solid #e4e9ed; background: #fbfcfd; border-radius: 10px; padding: 12px 14px; }
.price-history-row.current { border-color: #bfe7de; background: #f3fbf9; }
.price-history-row > div:not(.history-year) { display: flex; flex-direction: column; }
.price-history-row small { color: #8996a2; font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.price-history-row strong { font-size: 11px; }
.price-history-row .history-price { color: var(--navy); font-size: 14px; }
.history-year { display: flex; align-items: center; gap: 7px; }
.history-year > strong { font-size: 17px; }
.history-year > span { padding: 2px 6px; color: #788692; background: #e9eef1; border-radius: 8px; font-size: 7px; font-weight: 800; line-height: 1.3; text-transform: uppercase; }
.price-history-row.current .history-year > span { color: var(--teal-dark); background: #dff5f0; }
.renewal-block { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(190px, .7fr) minmax(0, 1.3fr); align-items: end; gap: 20px; border: 1px solid #cce9e3; background: linear-gradient(135deg, #effaf7, #f8fcfb); border-radius: 11px; padding: 17px; }
.renewal-copy { align-self: center; display: flex; flex-direction: column; }
.renewal-copy strong { font-size: 13px; }
.renewal-copy span { color: var(--muted); font-size: 9px; margin-top: 3px; }
.renewal-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 9px; }
.renewal-form input, .renewal-form select { background: white; }
.record-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 6px; border-top: 1px solid #e3e9ed; padding-top: 13px; }
.record-actions form { display: inline-flex; }
.empty-state { border: 1px dashed #cbd6dd; background: rgba(255, 255, 255, .65); border-radius: 14px; padding: 65px 20px; text-align: center; }
.empty-state > div { width: 48px; height: 48px; border-radius: 50%; background: #e9eff2; color: #83919e; display: grid; place-items: center; font-size: 22px; margin: 0 auto 13px; }
.empty-state h3 { margin-bottom: 5px; }
.empty-state p { color: var(--muted); margin: 0; }

.alert { border-radius: 10px; padding: 12px 14px; margin-bottom: 17px; border: 1px solid; font-weight: 600; font-size: 12px; }
.alert.success { background: var(--teal-soft); color: #087660; border-color: #bae7dc; }
.alert.error { background: var(--red-soft); color: #af3535; border-color: #f2c5c5; }
.alert.dismissible { display: flex; justify-content: space-between; align-items: center; box-shadow: 0 8px 20px rgba(24, 51, 78, .05); }
.alert.dismissible button { border: 0; color: inherit; background: transparent; font-size: 18px; cursor: pointer; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.settings-grid .compact-panel { grid-column: 1; }
.import-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(340px, .9fr); gap: 20px; align-items: start; }
.import-summary-panel, .import-detail-panel { min-width: 0; }
.import-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.import-stat { border: 1px solid #dce9e6; background: #f4fbf9; border-radius: 11px; padding: 15px; display: flex; flex-direction: column; }
.import-stat.warning { border-color: #f0dfbc; background: #fff9ed; }
.import-stat strong { color: var(--teal-dark); font-size: 25px; line-height: 1.1; }
.import-stat.warning strong { color: #c57b07; }
.import-stat span { color: var(--muted); font-size: 9px; font-weight: 700; margin-top: 5px; text-transform: uppercase; letter-spacing: .04em; }
.import-explanation { color: var(--muted); font-size: 11px; line-height: 1.65; margin: 0 0 18px; }
.mapping-list { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; margin-bottom: 18px; }
.mapping-row { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr); gap: 8px; align-items: center; padding: 12px 14px; border-bottom: 1px solid #e8edf0; font-size: 10px; }
.mapping-row:last-child { border-bottom: 0; }
.mapping-row span { color: var(--muted); }
.mapping-row b { color: var(--teal); text-align: center; }
.mapping-row strong { font-size: 10px; }
.import-warning { display: flex; gap: 11px; align-items: flex-start; border: 1px solid #f1dba8; background: var(--amber-soft); color: #8b641b; border-radius: 11px; padding: 13px; margin-bottom: 13px; }
.import-warning > span { width: 24px; height: 24px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: white; background: var(--amber); font-weight: 900; }
.import-warning strong { font-size: 11px; }
.import-warning p { margin: 2px 0 0; font-size: 9px; }
.import-complete { display: flex; gap: 13px; align-items: flex-start; border: 1px solid #bfe7de; background: var(--teal-soft); color: #087660; border-radius: 11px; padding: 16px; margin-bottom: 17px; }
.import-complete > span { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: white; background: var(--teal); font-weight: 900; }
.import-complete strong { font-size: 12px; }
.import-complete p { margin: 3px 0 4px; font-size: 10px; }
.import-complete small { font-size: 9px; opacity: .8; }
.cron-status { display: flex; align-items: center; gap: 10px; border-radius: 10px; background: #f6faf9; padding: 13px; margin-bottom: 18px; }
.status-dot { width: 9px; height: 9px; background: var(--teal); border-radius: 50%; box-shadow: 0 0 0 5px var(--teal-soft); margin: 0 4px; }
.cron-status div { display: flex; flex-direction: column; }
.cron-status strong { font-size: 11px; }
.cron-status small { color: var(--muted); font-size: 9px; }
.code-label { display: block; margin-bottom: 6px; }
.copy-field { display: flex; background: var(--navy); border-radius: 9px; overflow: hidden; }
.copy-field code { color: #b7d7cf; padding: 11px 12px; font-size: 10px; white-space: nowrap; overflow: auto; flex: 1; }
.copy-field button { border: 0; color: white; background: #274662; padding: 0 13px; font-size: 10px; font-weight: 700; cursor: pointer; }
.help-text { color: var(--muted); font-size: 10px; margin: 10px 0 17px; }
.last-run { border-radius: 9px; padding: 12px; display: flex; flex-direction: column; }
.last-run.sent { background: var(--teal-soft); color: #087660; }
.last-run.failed { background: var(--red-soft); color: #a73535; }
.last-run.neutral { background: #f1f4f6; color: #596978; }
.last-run strong { font-size: 10px; }
.last-run small { font-size: 9px; margin-top: 2px; }

.auth-page { min-height: 100vh; background: var(--navy); }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth-brand { position: relative; overflow: hidden; padding: clamp(50px, 8vw, 120px); display: flex; flex-direction: column; justify-content: center; color: white; background: radial-gradient(circle at 15% 85%, rgba(24, 183, 151, .22), transparent 35%), linear-gradient(145deg, #0b1d31, #132d47); }
.auth-brand::before, .auth-brand::after { content: ''; position: absolute; border: 1px solid rgba(255, 255, 255, .05); border-radius: 50%; width: 460px; height: 460px; right: -180px; top: -180px; }
.auth-brand::after { width: 650px; height: 650px; right: -260px; top: -270px; }
.auth-brand .brand-mark { margin-bottom: 55px; }
.auth-brand .eyebrow { color: #74d8c4; }
.auth-brand h1 { max-width: 650px; font-size: clamp(38px, 4vw, 66px); line-height: 1.08; letter-spacing: -.055em; margin: 0 0 22px; }
.auth-brand h1 em { color: var(--teal); font-style: normal; }
.auth-brand > p:not(.eyebrow) { max-width: 520px; color: #aebdca; font-size: 16px; }
.auth-features { display: flex; gap: 35px; margin-top: 25px; color: #bfcbd5; }
.auth-features span { max-width: 140px; font-size: 11px; line-height: 1.35; }
.auth-features b { display: block; color: white; font-size: 25px; }
.auth-card { background: #f8fafb; padding: clamp(35px, 8vw, 120px); display: flex; flex-direction: column; justify-content: center; }
.auth-card > * { width: 100%; max-width: 420px; margin-left: auto; margin-right: auto; }
.auth-card h2 { margin-bottom: 7px; font-size: 27px; letter-spacing: -.045em; }
.auth-card .muted { color: var(--muted); margin-bottom: 25px; }
.mobile-logo { display: none; align-items: center; gap: 10px; font-family: 'Manrope'; font-weight: 800; margin-bottom: 40px; }

footer { max-width: 1440px; margin: 0 auto; padding: 20px 24px; color: #8b98a4; font-size: 10px; display: flex; justify-content: space-between; border-top: 1px solid #e1e7eb; }

@media (max-width: 1120px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .customer-record summary { grid-template-columns: minmax(170px, 1.2fr) minmax(140px, 1fr) 130px 22px; }
    .sim-preview { display: none; }
}

@media (max-width: 840px) {
    .topbar { grid-template-columns: 1fr auto; padding: 0 16px; }
    .topbar nav { position: fixed; bottom: 0; left: 0; right: 0; height: 58px; background: var(--navy); z-index: 30; justify-content: center; box-shadow: 0 -5px 18px rgba(0,0,0,.12); }
    .topbar nav a { padding: 0 25px; }
    .account-name { display: none; }
    .page-shell { padding: 27px 16px 80px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .add-panel { position: static; }
    .settings-grid { grid-template-columns: 1fr; }
    .settings-grid .compact-panel { grid-column: auto; }
    .import-grid { grid-template-columns: 1fr; }
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { display: none; }
    .mobile-logo { display: flex; }
    footer { margin-bottom: 58px; }
}

@media (max-width: 620px) {
    .logo small { display: none; }
    .logo strong { max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .account-menu form { padding-left: 7px; }
    .topbar nav { gap: 4px; }
    .topbar nav a { padding: 0 13px; font-size: 11px; }
    .page-heading { align-items: flex-end; }
    .dashboard-heading .button { display: none; }
    .page-heading h1 { font-size: 25px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .stat-card { min-height: 105px; padding: 14px; gap: 10px; }
    .stat-icon { width: 37px; height: 37px; border-radius: 10px; }
    .stat-card strong { font-size: 23px; }
    .stat-card small { display: none; }
    .list-toolbar { flex-direction: column; }
    .search-form, .search-input { width: 100%; }
    .customer-record summary { grid-template-columns: 1fr auto 18px; padding: 13px; min-height: 78px; gap: 9px; }
    .date-column { display: none; }
    .customer-avatar { width: 34px; height: 34px; }
    .countdown { width: 92px; }
    .record-details { grid-template-columns: 1fr; padding: 12px; gap: 10px; }
    .record-actions { grid-column: auto; flex-wrap: wrap; }
    .history-block, .renewal-block { grid-column: auto; }
    .price-history-row { grid-template-columns: 70px 1fr; gap: 9px 12px; }
    .price-history-row .expiry-choice { justify-self: start; }
    .renewal-block { grid-template-columns: 1fr; gap: 12px; }
    .renewal-form { grid-template-columns: 1fr; }
    .edit-form { grid-template-columns: 1fr; }
    .add-sim-form { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .auth-card { min-height: 100vh; padding: 27px 22px; }
    .settings-grid .panel { padding: 18px; }
    .import-grid .panel { padding: 18px; }
    .import-stats { gap: 7px; }
    .import-stat { padding: 12px 9px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
