/* ========================================================
   GGram Activator – Fresh Redesign
   ======================================================== */

/* --- Design Tokens --- */
:root {
    /* Dark palette */
    --navy-900: #0f172a;
    --navy-800: #1e293b;
    --navy-700: #334155;
    --navy-600: #475569;

    /* Neutrals */
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50:  #f8fafc;
    --white:     #ffffff;

    /* Brand – emerald */
    --emerald-600: #059669;
    --emerald-500: #10b981;
    --emerald-100: #d1fae5;
    --emerald-50:  #ecfdf5;

    /* Accent – amber */
    --amber-500: #f59e0b;
    --amber-400: #fbbf24;
    --amber-100: #fef3c7;
    --amber-50:  #fffbeb;

    /* Danger – red */
    --red-500: #ef4444;
    --red-100: #fee2e2;
    --red-50:  #fef2f2;

    /* Surfaces & effects */
    --surface:        rgba(255, 255, 255, 0.82);
    --surface-strong: #ffffff;
    --line:           var(--slate-200);
    --ink-strong:     var(--navy-900);
    --ink:            var(--navy-800);
    --ink-soft:       var(--navy-600);

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.10), 0 4px 8px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 50px rgba(15, 23, 42, 0.14), 0 8px 16px rgba(15, 23, 42, 0.06);

    /* Radii */
    --radius-xs: 6px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-pill: 999px;

    /* Legacy mappings (keep for backward compat) */
    --brand: var(--emerald-600);
    --brand-deep: var(--emerald-600);
    --brand-soft: var(--emerald-100);
    --accent: var(--amber-500);
    --accent-deep: #b45309;
    --danger: var(--red-500);
}

/* --- Animations --- */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* --- Reset / Base --- */
* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--slate-100);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Shell (Root Wrapper) --- */
.shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Remove old decorative blobs – shell pseudo-elements are now inert */
.shell::before,
.shell::after {
    display: none;
}

/* --- Topbar --- */
.topbar,
.page-body {
    position: relative;
    z-index: 1;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 0 40px;
    height: 64px;
    color: var(--slate-300);
    background: var(--navy-900);
    /* Subtle SVG mesh / decorative gradient instead of blobs */
    background-image:
        radial-gradient(ellipse 80% 60% at 10% 50%, rgba(16, 185, 129, 0.12) 0%, transparent 70%),
        radial-gradient(ellipse 50% 80% at 90% 30%, rgba(245, 158, 11, 0.08) 0%, transparent 60%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='m' width='60' height='60' patternUnits='userSpaceOnUse'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z' fill='none' stroke='%23ffffff' stroke-width='0.4' opacity='0.04'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='60' height='60' fill='url(%23m)'/%3E%3C/svg%3E");
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    color: var(--emerald-500);
    flex-shrink: 0;
}

.topbar h1 {
    margin: 0;
    font-size: 20px;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-weight: 800;
    color: var(--white);
    white-space: nowrap;
}

.eyebrow {
    margin: 0 0 2px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--emerald-500);
}

/* --- Navigation Pills --- */
.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--slate-300);
    text-decoration: none;
    padding: 7px 16px;
    border-radius: var(--radius-pill);
    background: transparent;
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
}

.nav a svg {
    flex-shrink: 0;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.nav a:hover svg,
.nav a.active svg {
    opacity: 1;
}

.nav a:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.nav a.active {
    color: var(--white);
    background: var(--emerald-600);
    border-color: var(--emerald-600);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.35);
}

/* --- Page Body --- */
.page-body {
    padding: 28px 40px 48px;
    animation: fadeIn 0.35s ease;
    flex: 1;
}

/* --- App Footer --- */
.app-footer {
    padding: 20px 40px;
    text-align: center;
    font-size: 13px;
    color: var(--slate-400);
    border-top: 1px solid var(--slate-200);
    background: rgba(255, 255, 255, 0.6);
}

.app-footer p {
    margin: 0;
}

/* --- Layout Grid --- */
.layout {
    display: grid;
    grid-template-columns: 420px minmax(0, 1fr);
    gap: 24px;
    max-width: 1520px;
    margin: 0 auto;
}

/* --- Cards (Glassmorphism) --- */
.card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 28px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    animation: fadeUp 0.45s ease both;
}

.full-width {
    max-width: 1520px;
    margin: 0 auto;
}

.card-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
}

.card-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.section-title {
    margin: 0 0 20px;
    color: var(--ink-strong);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.025em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title svg {
    flex-shrink: 0;
    color: var(--emerald-600);
}

.section-hint {
    margin: -12px 0 16px;
    font-size: 13px;
    color: var(--ink-soft);
    line-height: 1.5;
}

.card-header .section-title {
    margin: 0;
}

/* --- Field Grid / Form Layout --- */
.field-grid {
    display: grid;
    gap: 18px;
}

.field-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field label,
.field .inline-label {
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* --- Form Inputs --- */
.textbox,
.field input[type=text],
.field input[type=password],
.field select,
.field textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--ink-strong);
    font: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.textbox::placeholder,
.field input::placeholder,
.field textarea::placeholder {
    color: var(--slate-400);
}

.textbox:focus,
.field input[type=text]:focus,
.field input[type=password]:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--emerald-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

/* --- Button Row --- */
.button-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 22px;
}

/* --- Buttons --- */
.btn,
input[type=submit],
input[type=button],
button {
    border: none;
    border-radius: var(--radius-sm);
    padding: 11px 20px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.btn:hover,
input[type=submit]:hover,
input[type=button]:hover,
button:hover {
    transform: translateY(-1px);
}

.btn:active,
input[type=submit]:active,
input[type=button]:active,
button:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--emerald-600);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
}

.btn-primary:hover {
    background: var(--emerald-500);
    box-shadow: 0 6px 20px rgba(5, 150, 105, 0.35);
}

.btn-secondary {
    background: var(--navy-700);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.22);
}

.btn-secondary:hover {
    background: var(--navy-800);
    box-shadow: 0 6px 16px rgba(30, 41, 59, 0.28);
}

.btn-danger {
    background: var(--red-500);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-sm);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-decoration: none;
    background: var(--amber-500);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-link:hover {
    background: var(--amber-400);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
    transform: translateY(-1px);
}

.btn-link:active {
    transform: translateY(0);
}

/* --- Status Messages --- */
.status {
    display: block;
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    border: 1px solid transparent;
}

.status-success {
    color: #065f46;
    background: var(--emerald-50);
    border-color: var(--emerald-100);
}

.status-warning {
    color: #92400e;
    background: var(--amber-50);
    border-color: var(--amber-100);
}

.status-error {
    color: #991b1b;
    background: var(--red-50);
    border-color: var(--red-100);
}

/* --- Data Grid / Table --- */
.grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--slate-200);
}

.grid th,
.grid td {
    padding: 13px 16px;
    text-align: left;
    vertical-align: middle;
}

.grid th {
    background: var(--navy-800);
    color: var(--slate-200);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 2px solid var(--navy-700);
}

.grid td {
    background: var(--white);
    border-bottom: 1px solid var(--slate-100);
    font-size: 14px;
    color: var(--ink);
}

.grid tr:nth-child(even) td {
    background: var(--slate-50);
}

.grid tr:hover td {
    background: var(--emerald-50);
    transition: background 0.15s ease;
}

.grid .actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
}

.grid .actions a,
.grid .actions input,
.grid .actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-xs);
    text-decoration: none;
    background: var(--slate-100);
    color: var(--ink);
    border: 1px solid var(--slate-200);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all 0.18s ease;
}

.grid .actions a:hover,
.grid .actions input:hover,
.grid .actions button:hover {
    background: var(--emerald-600);
    border-color: var(--emerald-600);
    color: var(--white);
    transform: translateY(-1px);
}

.grid .actions a.action-delete:hover {
    background: var(--red-500);
    border-color: var(--red-500);
    color: var(--white);
}

.grid .actions a.action-reset:hover {
    background: var(--amber-500);
    border-color: var(--amber-500);
    color: var(--white);
}

.grid .actions a svg {
    flex-shrink: 0;
    vertical-align: middle;
}

/* --- Grid Wrapper (responsive scroll) --- */
.grid-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
}

.grid-wrapper .grid {
    border-radius: 0;
}

/* --- Grid Filter Row --- */
.grid-filter-row th {
    background: var(--navy-700);
    padding: 8px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: none;
}

.grid-filter-input {
    width: 100%;
    padding: 7px 10px;
    font-size: 12px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-xs);
    background: rgba(255, 255, 255, 0.95);
    color: var(--ink-strong);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
    font-weight: 600;
}

.grid-filter-input::placeholder {
    color: var(--slate-400);
    font-weight: 400;
    font-size: 11px;
}

.grid-filter-input:focus {
    background: var(--white);
    border-color: var(--emerald-500);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.filter-action-cell {
    text-align: center !important;
}

.btn-clear-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xs);
    background: rgba(255, 255, 255, 0.12);
    color: var(--slate-200);
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.btn-clear-filter:hover {
    background: var(--red-500);
    border-color: var(--red-500);
    color: var(--white);
    transform: translateY(-1px);
}

.record-badge {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    margin-left: 10px;
    border-radius: var(--radius-pill);
    background: var(--emerald-100);
    color: var(--emerald-600);
    vertical-align: middle;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.status-active {
    background: var(--emerald-100);
    color: var(--emerald-600);
}

.status-deactive {
    background: var(--red-100);
    color: var(--red-500);
}

.no-records-row td {
    text-align: center;
    padding: 36px 16px;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 500;
    font-style: italic;
    background: var(--white);
}

/* --- Metric Cards --- */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: 14px;
}

.metric {
    min-height: 100px;
    padding: 18px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.metric:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.metric span {
    display: block;
    margin-bottom: 8px;
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.metric strong {
    display: block;
    color: var(--ink-strong);
    font-size: 28px;
    line-height: 1;
    font-weight: 800;
}

/* --- Hint Text --- */
.hint {
    color: var(--slate-400);
    font-size: 12px;
    line-height: 1.6;
}

/* --- Checkbox List --- */
.checkbox-list {
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    max-height: 240px;
    overflow: auto;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-sm);
    background: var(--white);
}

.checkbox-list input[type=checkbox] {
    margin-right: 8px;
    accent-color: var(--emerald-600);
}

.checkbox-list label {
    display: inline-flex;
    align-items: center;
    color: var(--ink);
    font-size: 14px;
    font-weight: 500;
}

/* --- Single Checkbox Control (e.g. OTP Required) --- */
.checkbox-control {
    display: flex;
    align-items: center;
    min-height: 45px;
    padding: 10px 14px;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.checkbox-control:hover {
    border-color: var(--slate-300);
    background: var(--slate-50);
}

.checkbox-control:has(input:checked) {
    border-color: var(--emerald-500);
    background: var(--emerald-50);
}

.checkbox-control input[type=checkbox] {
    width: 18px;
    height: 18px;
    margin: 0 10px 0 0;
    accent-color: var(--emerald-600);
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-control label {
    color: var(--ink-strong);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    cursor: pointer;
    user-select: none;
    margin: 0;
    line-height: 1.3;
}

/* --- Placeholder --- */
.placeholder {
    padding: 40px;
    text-align: center;
    border: 2px dashed var(--slate-300);
    border-radius: var(--radius-lg);
    background: var(--slate-50);
}

.placeholder h3 {
    margin: 0 0 12px;
    color: var(--ink-strong);
    font-size: 18px;
    font-weight: 700;
}

.placeholder p {
    margin: 0 0 10px;
    color: var(--ink-soft);
}

/* --- Global Checkbox --- */
input[type="checkbox"] {
    accent-color: var(--emerald-600);
}

/* --- Modal --- */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: relative;
    width: min(680px, 100%);
    max-height: 90vh;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: var(--white);
    border: 1px solid var(--slate-200);
    box-shadow: var(--shadow-xl);
    animation: fadeUp 0.25s ease;
}

.modal-header,
.modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
}

.modal-header {
    border-bottom: 1px solid var(--slate-200);
    background: var(--slate-50);
}

.modal-title {
    margin: 0;
    color: var(--ink-strong);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.modal-close {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: var(--red-50);
    color: var(--red-500);
    font-size: 20px;
    line-height: 1;
    border: 1px solid var(--red-100);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease;
}

.modal-close:hover {
    background: var(--red-500);
    color: var(--white);
    transform: none;
}

.modal-body {
    padding: 24px;
    max-height: calc(90vh - 160px);
    overflow: auto;
}

.modal-footer {
    justify-content: flex-end;
    border-top: 1px solid var(--slate-200);
    background: var(--slate-50);
}

/* ========================================================
   Login Page
   ======================================================== */

.nav a.nav-logout:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background: var(--navy-900);
    background-image:
        radial-gradient(ellipse 70% 50% at 15% 20%, rgba(16, 185, 129, 0.16) 0%, transparent 70%),
        radial-gradient(ellipse 60% 60% at 85% 80%, rgba(245, 158, 11, 0.10) 0%, transparent 65%),
        url("data:image/svg+xml,%3Csvg width='60' height='60' xmlns='http://www.w3.org/2000/svg'%3E%3Cdefs%3E%3Cpattern id='m' width='60' height='60' patternUnits='userSpaceOnUse'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z' fill='none' stroke='%23ffffff' stroke-width='0.4' opacity='0.04'/%3E%3C/pattern%3E%3C/defs%3E%3Crect width='60' height='60' fill='url(%23m)'/%3E%3C/svg%3E");
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 36px 32px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.15);
    animation: fadeUp 0.4s ease both;
}

.login-header {
    text-align: center;
    margin-bottom: 26px;
}

.login-logo {
    width: 54px;
    height: 54px;
    margin: 0 auto 14px;
    border-radius: 14px;
    background: var(--emerald-50);
    border: 1px solid var(--emerald-100);
    color: var(--emerald-600);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-header h1 {
    margin: 4px 0 6px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--ink-strong);
}

.login-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--ink-soft);
}

.input-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--slate-400);
    pointer-events: none;
}

.field .input-icon-wrap .textbox.has-icon,
.input-icon-wrap input.textbox.has-icon {
    padding-left: 42px;
}

.field .input-icon-wrap .textbox.has-toggle,
.input-icon-wrap input.textbox.has-toggle {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    right: 8px;
    background: transparent;
    color: var(--slate-400);
    padding: 6px;
    border-radius: var(--radius-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--ink-strong);
    background: var(--slate-100);
    transform: none;
}

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.checkbox-inline input[type=checkbox] {
    width: 16px;
    height: 16px;
    margin: 0 8px 0 0;
    accent-color: var(--emerald-600);
    vertical-align: middle;
    cursor: pointer;
}

.checkbox-inline label {
    font-size: 13px;
    font-weight: 500;
    color: var(--ink-soft);
    text-transform: none;
    letter-spacing: normal;
    cursor: pointer;
}

.btn-block {
    width: 100%;
    padding: 13px 20px;
    font-size: 14px;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    font-size: 12px;
    color: var(--slate-400);
}

.login-footer p {
    margin: 0;
}

/* ========================================================
   Responsive Breakpoints
   ======================================================== */

@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .metric-grid {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }
}

@media (max-width: 860px) {
    .topbar {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
        padding: 16px 20px;
        gap: 12px;
    }

    .page-body {
        padding: 16px 20px 36px;
    }

    .field-grid.two,
    .card-header {
        grid-template-columns: 1fr;
    }

    .card-header {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .topbar h1 {
        font-size: 18px;
    }

    .card {
        padding: 20px;
        border-radius: var(--radius-lg);
    }

    .button-row,
    .card-header-actions,
    .modal-footer {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .btn,
    input[type=submit],
    input[type=button],
    button,
    .btn-link {
        width: 100%;
        justify-content: center;
    }

    .modal {
        padding: 12px;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }
}
