@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@500;600;700&display=swap');

:root {
    --navy-950: #061a30;
    --navy-900: #082645;
    --navy-800: #0a3a64;
    --ocean-700: #0878c9;
    --ocean-600: #0284c7;
    --ocean-500: #0ea5e9;
    --ocean-400: #38bdf8;
    --teal-500: #14b8a6;
    --surface: #ffffff;
    --surface-soft: #f3f9fd;
    --ink: #102a43;
    --muted: #64748b;
    --line: rgba(14, 165, 233, .22);
    --danger: #b42318;
    --success: #067647;
    --shadow: 0 28px 75px rgba(2, 25, 52, .32);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    margin: 0;
    font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
    font-weight: 500;
    color: var(--ink);
}

button, input { font: inherit; }
a { color: inherit; }

.login-page {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 10% 18%, rgba(56, 189, 248, .18), transparent 30%),
        radial-gradient(circle at 90% 82%, rgba(14, 165, 233, .16), transparent 32%),
        linear-gradient(135deg, var(--navy-950), var(--navy-900) 48%, #0a2d59);
}

.login-page::before {
    content: "";
    position: fixed;
    inset: 0;
    opacity: .24;
    background-image:
        linear-gradient(rgba(56,189,248,.18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56,189,248,.18) 1px, transparent 1px);
    background-size: 86px 86px;
    mask-image: linear-gradient(to bottom, transparent, #000 28%, #000 76%, transparent);
    pointer-events: none;
}

.ocean-glow {
    position: fixed;
    width: 460px;
    height: 460px;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .18;
    pointer-events: none;
}

.ocean-glow-one { top: -180px; left: -120px; background: var(--ocean-400); }
.ocean-glow-two { right: -180px; bottom: -220px; background: #2563eb; }

.bubble-field span {
    position: fixed;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(125, 211, 252, .55);
    box-shadow: 0 0 12px rgba(56, 189, 248, .55);
}

.bubble-field span:nth-child(1) { left: 9%; top: 15%; }
.bubble-field span:nth-child(2) { left: 24%; top: 72%; width: 3px; height: 3px; }
.bubble-field span:nth-child(3) { left: 71%; top: 17%; width: 4px; height: 4px; }
.bubble-field span:nth-child(4) { left: 83%; top: 61%; }
.bubble-field span:nth-child(5) { left: 61%; top: 82%; width: 3px; height: 3px; }
.bubble-field span:nth-child(6) { left: 92%; top: 31%; width: 3px; height: 3px; }

.login-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 18px;
    padding: 28px 18px;
}

.login-card {
    width: min(620px, calc(100vw - 36px));
    overflow: hidden;
    border: 1px solid rgba(186, 230, 253, .7);
    border-radius: 24px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.brand-head {
    min-height: 100px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    color: #fff;
    background: linear-gradient(115deg, var(--ocean-700), var(--ocean-500) 58%, var(--ocean-400));
}

.brand-logo {
    width: 56px;
    height: 56px;
    padding: 3px;
    object-fit: contain;
    border: 1px solid rgba(255,255,255,.46);
    border-radius: 15px;
    background: rgba(255,255,255,.14);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}
.brand-logo { object-fit: cover; content: url('../img/ocean-pro-logo.jpg'); }

.brand-copy { display: flex; flex-direction: column; gap: 3px; }
.brand-copy span { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; opacity: .82; }
.brand-copy strong { font-size: 22px; letter-spacing: .04em; }

.login-body { padding: 30px 24px 22px; background: linear-gradient(160deg, #fff, var(--surface-soft)); }
.welcome-copy { margin-bottom: 20px; }
.welcome-kicker { display: inline-block; margin-bottom: 5px; color: var(--ocean-700); font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.welcome-copy h1 { margin: 0; color: #0c3155; font-size: clamp(25px, 4vw, 32px); letter-spacing: -.04em; }
.welcome-copy p { margin: 7px 0 0; color: var(--muted); font-size: 14px; }

.alert {
    margin: 0 0 14px;
    padding: 11px 13px;
    border: 1px solid rgba(180,35,24,.18);
    border-radius: 12px;
    color: var(--danger);
    background: #fff1f0;
    font-size: 13px;
    font-weight: 650;
}

.alert.success { color: var(--success); border-color: rgba(6,118,71,.2); background: #ecfdf3; }
.login-form { display: grid; gap: 14px; }

.input-wrap {
    min-height: 52px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #f9fcff;
    transition: border-color .18s, box-shadow .18s, background .18s;
}

.input-wrap:focus-within { border-color: var(--ocean-500); background: #fff; box-shadow: 0 0 0 4px rgba(14,165,233,.12); }
.input-icon { width: 18px; height: 18px; justify-self: center; color: var(--ocean-700); }
.input-icon svg { width: 100%; height: 100%; fill: currentColor; }
.input-wrap input { min-width: 0; width: 100%; height: 50px; padding: 0 13px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 15px; }
.input-wrap input:-webkit-autofill, .input-wrap input:-webkit-autofill:hover, .input-wrap input:-webkit-autofill:focus { -webkit-text-fill-color: var(--ink); -webkit-box-shadow: 0 0 0 1000px #eef4ff inset; box-shadow: 0 0 0 1000px #eef4ff inset; caret-color: var(--ink); }
.input-wrap input::placeholder { color: #8da0b2; }

.sign-in-row { display: grid; grid-template-columns: minmax(220px,300px); justify-content: center; gap: 10px; padding-top: 3px; }
.sign-in-row.has-demo { grid-template-columns: 1.15fr .85fr; }
.sign-in-btn {
    width: 100%;
    min-height: 48px;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #0284c7, #0ea5e9);
    box-shadow: 0 11px 22px rgba(2,132,199,.24);
    font-weight: 800;
    cursor: pointer;
    transition: transform .18s, box-shadow .18s;
}

.sign-in-btn:hover { transform: translateY(-1px); box-shadow: 0 15px 28px rgba(2,132,199,.3); }
.demo-create-btn { width: 100%; min-height: 48px; padding: 0 18px; border: 1px solid #8bd8ff; border-radius: 14px; color: #0369a1; background: linear-gradient(135deg,#effaff,#dff5ff); box-shadow: 0 9px 19px rgba(14,165,233,.13); font-weight: 800; cursor: pointer; transition: transform .18s, box-shadow .18s, background .18s; }
.demo-create-btn:hover { transform: translateY(-1px); background: linear-gradient(135deg,#e2f7ff,#c9edff); box-shadow: 0 13px 25px rgba(14,165,233,.2); }
.demo-success-card { position: relative; overflow: hidden; margin-bottom: 15px; padding: 15px; border: 1px solid #9bdcff; border-radius: 16px; background: linear-gradient(145deg,#f5fcff,#e5f7ff); box-shadow: 0 10px 24px rgba(2,132,199,.1); }
.demo-success-card::after { content: ""; position: absolute; width: 105px; height: 105px; right: -42px; top: -50px; border-radius: 50%; background: rgba(56,189,248,.16); }
.demo-success-heading { position: relative; z-index: 1; display: flex; align-items: center; gap: 11px; }
.demo-success-icon { width: 36px; height: 36px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 11px; color: #fff; background: linear-gradient(135deg,#38bdf8,#0284c7); box-shadow: 0 7px 15px rgba(2,132,199,.2); font-size: 18px; font-weight: 900; }
.demo-success-heading div { display: grid; gap: 2px; }
.demo-success-heading small { color: #0284c7; font-size: 9px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.demo-success-heading strong { color: #0c4a6e; font-size: 14px; }
.demo-success-card > p { margin: 10px 0 12px; color: #52738a; font-size: 11px; font-weight: 650; }
.demo-key-result { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 8px 8px 8px 13px; border: 1px solid rgba(14,165,233,.22); border-radius: 12px; background: rgba(255,255,255,.86); }
.demo-key-result code { overflow: hidden; color: #075985; font: 800 14px/1.2 Consolas,"Courier New",monospace; letter-spacing: .06em; text-overflow: ellipsis; }
.demo-copy-btn { min-height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 11px; border: 0; border-radius: 9px; color: #fff; background: linear-gradient(135deg,#0ea5e9,#0284c7); box-shadow: 0 6px 13px rgba(2,132,199,.2); font-size: 10px; font-weight: 850; cursor: pointer; }
.demo-copy-btn svg { width: 14px; height: 14px; fill: currentColor; }
.demo-copy-btn:hover { filter: brightness(.96); transform: translateY(-1px); }

.download-btn {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: var(--ocean-700);
    background: #edf8ff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

.download-btn:hover { border-color: rgba(2,132,199,.42); background: #e0f2fe; }
.download-btn svg { width: 18px; height: 18px; fill: currentColor; }
.download-support-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; align-items: stretch; margin-top: 18px; }
.download-support-row .download-btn,.login-telegram-banner { min-width: 0; height: 50px; margin: 0; display: grid; grid-template-columns: 32px minmax(0,1fr) 18px; align-items: center; justify-content: initial; gap: 9px; padding: 7px 10px; border: 1px solid rgba(0,136,248,.3); border-radius: 12px; color: #006bc7; background: linear-gradient(180deg,rgba(255,255,255,.96),rgba(220,243,255,.98)); box-shadow: 0 5px 15px rgba(0,112,222,.14); text-align: left; text-decoration: none; transition: transform .15s ease,border-color .15s ease,box-shadow .15s ease; }
.download-support-row .download-btn:hover,.login-telegram-banner:hover { transform: translateY(-1px); border-color: rgba(0,136,248,.7); background: linear-gradient(180deg,rgba(255,255,255,.98),rgba(211,239,255,1)); box-shadow: 0 7px 18px rgba(0,136,248,.23); }
.download-action-icon,.login-telegram-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(145deg,#27b7f5,#0788dc); box-shadow: 0 3px 8px rgba(0,136,248,.3); }
.download-action-icon svg,.login-telegram-icon svg { width: 17px; height: 17px; fill: currentColor; }
.download-action-copy,.login-telegram-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.08; }
.download-action-copy strong,.login-telegram-copy strong { overflow: hidden; font-size: 12px; letter-spacing: .01em; text-overflow: ellipsis; white-space: nowrap; }
.download-action-copy small,.login-telegram-copy small { overflow: hidden; margin-top: 3px; color: #52708b; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.download-action-arrow,.login-telegram-arrow { color: #0088e8; font-size: 15px; font-weight: 900; text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.plain-field { display: grid; gap: 6px; color: #334155; font-size: 12px; font-weight: 750; }
.plain-field input { min-height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; outline: 0; color: var(--ink); background: #fff; }
.plain-field input:focus { border-color: var(--ocean-500); box-shadow: 0 0 0 4px rgba(14,165,233,.12); }
.text-link { display: block; margin-top: 17px; color: var(--ocean-700); text-align: center; font-size: 13px; font-weight: 750; }

.dashboard-page { min-height: 100vh; padding: 30px; background: linear-gradient(145deg, #f8fcff, #e6f6ff); }
.dashboard-shell { width: min(1120px, 100%); margin: 0 auto; }
.dashboard-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 14px 35px rgba(3,105,161,.1); }
.dashboard-brand { display: flex; align-items: center; gap: 12px; }
.dashboard-brand img { width: 46px; height: 46px; object-fit: contain; border-radius: 12px; }
.dashboard-brand div { display: flex; flex-direction: column; }
.dashboard-brand span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.dashboard-brand strong { color: #0c4a6e; font-size: 20px; }
.logout-btn { padding: 10px 14px; border: 1px solid var(--line); border-radius: 11px; color: #075985; background: #eef8ff; text-decoration: none; font-size: 13px; font-weight: 800; }
.placeholder-card { margin-top: 24px; padding: clamp(26px, 6vw, 60px); border: 1px solid var(--line); border-radius: 22px; background: #fff; box-shadow: 0 18px 45px rgba(3,105,161,.1); text-align: center; }
.placeholder-card h1 { margin: 16px 0 8px; color: #0c4a6e; font-size: clamp(26px, 5vw, 42px); }
.placeholder-card p { max-width: 620px; margin: 0 auto; color: var(--muted); line-height: 1.7; }
.status-pill { display: inline-flex; padding: 7px 11px; border-radius: 999px; color: #067647; background: #d1fadf; font-size: 11px; font-weight: 800; }
.dashboard-download { width: min(340px, 100%); margin: 24px auto 0; }

@media (max-width: 600px) {
    .login-shell { padding: 16px; }
    .login-card { width: 100%; border-radius: 20px; }
    .brand-head { min-height: 86px; padding: 16px 18px; }
    .brand-logo { width: 48px; height: 48px; }
    .brand-copy strong { font-size: 19px; }
    .login-body { padding: 24px 18px 18px; }
    .dashboard-page { padding: 14px; }
    .dashboard-head { align-items: flex-start; }
}

/* Seller/Admin portal */
.portal-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 8% 5%, rgba(56,189,248,.14), transparent 24%),
        linear-gradient(155deg, #f8fcff, #eaf7ff 52%, #f4fbff);
}

.portal-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px clamp(18px, 4vw, 48px);
    border-bottom: 1px solid rgba(14,165,233,.18);
    background: rgba(255,255,255,.94);
    box-shadow: 0 8px 26px rgba(3,105,161,.08);
    backdrop-filter: blur(14px);
}

.portal-brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.portal-brand img { width: 48px; height: 48px; object-fit: cover; border-radius: 13px; content: url('../img/ocean-pro-logo.jpg'); }
.portal-brand span { display: flex; flex-direction: column; }
.portal-brand small { color: var(--ocean-700); font-size: 10px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.portal-brand strong { color: #0c4a6e; font-size: 20px; }
.portal-nav { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.portal-nav a { padding: 9px 12px; border-radius: 10px; color: #48657b; text-decoration: none; font-size: 13px; font-weight: 750; }
.portal-nav a:hover, .portal-nav a.is-active { color: #075985; background: #e0f2fe; }
.wallet-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border: 1px solid rgba(20,184,166,.25); border-radius: 999px; color: #0f766e; background: #e6fffb; font-size: 12px; font-weight: 700; white-space: nowrap; }
.wallet-chip::before { content: "Wallet"; color: #52756f; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }

.portal-main { width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 54px; }
.portal-main.narrow-main { width: min(680px, calc(100% - 32px)); }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading h1 { margin: 3px 0 0; color: #0c4a6e; font-size: clamp(27px, 4vw, 38px); letter-spacing: -.04em; }
.eyebrow { color: var(--ocean-700); font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.user-chip, .table-count, .pending-note { display: inline-flex; align-items: center; min-height: 32px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; color: #075985; background: #f0f9ff; font-size: 11px; font-weight: 800; }

.portal-alert { margin-bottom: 18px; padding: 12px 14px; border: 1px solid rgba(180,35,24,.18); border-radius: 12px; color: var(--danger); background: #fff1f0; font-size: 13px; font-weight: 700; }
.portal-alert.success { color: var(--success); border-color: rgba(6,118,71,.2); background: #ecfdf3; }

.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 280px)); gap: 18px; margin-bottom: 22px; }
.metric-card { position: relative; min-height: 150px; display: grid; grid-template-columns: 1fr auto; align-content: space-between; overflow: hidden; padding: 20px; border-radius: 22px; color: #fff; box-shadow: 0 18px 38px rgba(3,105,161,.16); }
.metric-blue { background: linear-gradient(135deg, #38bdf8, #2563eb); }
.metric-orange { background: linear-gradient(135deg, #fbbf24, #f97316); }
.metric-card div:first-child { display: flex; flex-direction: column; gap: 2px; }
.metric-card strong { font-size: 34px; line-height: 1; }
.metric-card span { font-size: 13px; font-weight: 800; }
.metric-icon { align-self: start; font-size: 38px; opacity: .22; }
.metric-card a { grid-column: 1 / -1; margin: 18px -8px -8px; padding: 9px; border-radius: 10px; color: #fff; background: rgba(2,43,94,.18); text-align: center; text-decoration: none; font-size: 11px; font-weight: 850; }

.portal-card { margin-bottom: 22px; padding: 20px; border: 1px solid rgba(14,165,233,.18); border-radius: 20px; background: rgba(255,255,255,.96); box-shadow: 0 15px 36px rgba(3,105,161,.08); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.section-heading h2 { margin: 3px 0 0; color: #0c4a6e; font-size: 20px; }
.pending-note { color: #9a6700; border-color: #fde68a; background: #fffbeb; }

.create-key-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; }
.create-key-form label, .admin-seller-form label, .stack-form label { display: grid; gap: 6px; color: #42647d; font-size: 11px; font-weight: 800; }
.create-key-form input, .admin-seller-form input, .stack-form input { min-height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; outline: 0; color: var(--ink); background: #fbfdff; }
.create-key-form input:focus, .admin-seller-form input:focus, .stack-form input:focus { border-color: var(--ocean-500); background: #fff; box-shadow: 0 0 0 4px rgba(14,165,233,.11); }
.primary-btn, .approve-btn { min-height: 46px; padding: 0 20px; border: 0; border-radius: 12px; color: #fff; background: linear-gradient(135deg, var(--ocean-500), var(--ocean-700)); box-shadow: 0 9px 20px rgba(2,132,199,.2); font-weight: 850; cursor: pointer; }
.approve-btn { min-height: 34px; padding: 0 12px; border-radius: 9px; background: linear-gradient(135deg, #14b8a6, #059669); font-size: 12px; }
.primary-btn:hover, .approve-btn:hover { filter: brightness(.96); transform: translateY(-1px); }
.stack-form { display: grid; gap: 15px; }
.stack-form .primary-btn { justify-self: start; min-width: 180px; }
.form-card { padding: 26px; }
.admin-seller-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; align-items: end; gap: 12px; }
.admin-seller-form.compact-form { grid-template-columns: repeat(2, minmax(0, 1fr)) auto; }

.table-wrap { overflow-x: auto; border: 1px solid rgba(14,165,233,.16); border-radius: 14px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 760px; font-size: 13px; }
.data-table th, .data-table td { padding: 13px 14px; border-bottom: 1px solid #e5eef5; text-align: left; vertical-align: middle; }
.data-table th { color: #075985; background: #e5f5ff; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.data-table tbody tr:nth-child(even) { background: #f9fcff; }
.data-table tbody tr:hover { background: #eff9ff; }
.data-table tr:last-child td { border-bottom: 0; }
.key-code { color: #0c4a6e; font-family: Consolas, "Courier New", monospace; letter-spacing: .03em; }
.empty-cell { padding: 30px !important; color: var(--muted); text-align: center !important; }
.cell-sub, .status-help, .pending-text { display: block; margin-top: 3px; font-size: 10px; }
.cell-sub, .status-help { color: var(--muted); }
.pending-text { color: #d97706; }
.status-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 7px; font-size: 10px; font-weight: 850; }
.status-badge.paid { color: #067647; background: #d1fadf; }
.status-badge.unpaid { color: #b42318; background: #fee4e2; }
.icon-action { width: 36px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 9px; color: #fff; background: linear-gradient(135deg, #818cf8, #6366f1); cursor: pointer; }
.icon-action svg { width: 17px; height: 17px; fill: currentColor; }
.icon-action:hover { filter: brightness(.94); }
.icon-action:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.2); }

.table-tools { display: flex; justify-content: flex-end; margin: -4px 0 13px; }
.table-search { width: min(320px, 100%); min-height: 40px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: var(--ink); background: #f9fcff; font-size: 12px; font-weight: 600; }
.table-search:focus { border-color: var(--ocean-500); box-shadow: 0 0 0 4px rgba(14,165,233,.1); background: #fff; }
.expiry-stack { display: flex; flex-direction: column; gap: 4px; }
.days-left { color: #0284c7; font-size: 10px; font-weight: 700; }
.action-group { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.icon-action.danger { background: linear-gradient(135deg, #fb7185, #e11d48); }
.icon-action.success-action { background: linear-gradient(135deg, #34d399, #059669); }
.icon-action.neutral { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.icon-action.warning { background: linear-gradient(135deg, #fbbf24, #f97316); }
.icon-action.cash-action { background: linear-gradient(135deg, #22c55e, #15803d); }
.icon-action.delete-action { background: linear-gradient(135deg, #f43f5e, #be123c); }
.action-link { text-decoration: none; }
.binding-state { display: block; width: max-content; margin-top: 5px; padding: 3px 7px; border-radius: 999px; font-size: 9px; font-family: Montserrat, sans-serif; font-weight: 800; letter-spacing: .05em; }
.binding-state.bound { color: #067647; background: #d1fadf; }
.binding-state.unbound { color: #946200; background: #fef3c7; }
.receipt-flash { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.receipt-flash > span { white-space: pre-line; }
.receipt-flash code { padding: 7px 9px; border-radius: 8px; color: #075985; background: #fff; font-size: 11px; }
.copy-btn { min-height: 32px; padding: 0 11px; border: 0; border-radius: 8px; color: #fff; background: #0284c7; font-size: 11px; font-weight: 800; cursor: pointer; }
.bulk-delete-form { display: grid; gap: 14px; }
.bulk-delete-form label { display: grid; gap: 7px; color: #42647d; font-size: 11px; font-weight: 800; }
.bulk-delete-form textarea { width: 100%; min-height: 240px; resize: vertical; padding: 14px; border: 1px solid var(--line); border-radius: 14px; outline: 0; color: #0c4a6e; background: #fbfdff; font: 700 13px/1.7 Consolas, "Courier New", monospace; }
.bulk-delete-form textarea:focus { border-color: var(--ocean-500); background: #fff; box-shadow: 0 0 0 4px rgba(14,165,233,.11); }
.danger-delete-btn { justify-self: start; min-height: 44px; padding: 0 22px; border: 0; border-radius: 11px; color: #fff; background: linear-gradient(135deg,#fb7185,#e11d48); box-shadow: 0 9px 20px rgba(225,29,72,.2); font-weight: 850; cursor: pointer; }
.delete-results-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; }
.result-card { margin-bottom: 0; }
.success-result { border-color: rgba(6,118,71,.25); }
.missing-result { border-color: rgba(180,35,24,.22); }
.key-result-list { display: flex; flex-wrap: wrap; gap: 8px; }
.key-result-list code { padding: 7px 9px; border: 1px solid rgba(14,165,233,.16); border-radius: 8px; color: #0c4a6e; background: #f0f9ff; font-size: 11px; }
.result-heading-actions { display: flex; align-items: center; gap: 8px; }
.key-result-lines { min-height: 90px; margin: 0; padding: 13px 14px; overflow: auto; border: 1px solid rgba(180,35,24,.13); border-radius: 11px; color: #0c4a6e; background: #fff8f7; font: 700 12px/1.8 Consolas, "Courier New", monospace; white-space: pre-wrap; }
.key-result-lines.deleted-lines { border-color: rgba(6,118,71,.16); background: #f3fff8; }
.result-empty { margin: 0; color: var(--muted); font-size: 13px; }
.page-heading-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.delete-unpaid-btn { min-height: 36px; padding: 0 13px; border: 0; border-radius: 10px; color: #fff; background: linear-gradient(135deg,#fb7185,#e11d48); box-shadow: 0 7px 16px rgba(225,29,72,.18); font-size: 11px; font-weight: 850; cursor: pointer; }
.delete-unpaid-btn:disabled { opacity: .48; cursor: not-allowed; box-shadow: none; }
.validity-all-btn { min-height: 36px; padding: 0 13px; border: 0; border-radius: 10px; color: #fff; background: linear-gradient(135deg,#8b5cf6,#4f46e5); box-shadow: 0 7px 16px rgba(79,70,229,.2); font-size: 11px; font-weight: 850; cursor: pointer; }
.icon-action.validity-action { background: linear-gradient(135deg,#8b5cf6,#4f46e5); }
.transaction-type { display: inline-flex; align-items: center; min-height: 25px; padding: 0 9px; border-radius: 7px; font-size: 10px; font-weight: 850; }
.transaction-type.key-paid { color: #075985; background: #e0f2fe; }
.transaction-type.due-received { color: #067647; background: #d1fadf; }
.transaction-type.controller-settlement { color: #9a3412; background: #ffedd5; }
.data-table tbody tr.admin-ledger-row { background: #f2fff7; }
.data-table tbody tr.controller-ledger-row { background: #fff7ed; }
.data-table tbody tr.admin-ledger-row:hover { background: #e8fff1; }
.data-table tbody tr.controller-ledger-row:hover { background: #ffedd5; }
.data-table tbody tr.controller-ledger-row .ledger-value.settled,
.data-table tbody tr.controller-ledger-row .status-badge.paid {
  color: #9a3412;
  background: #ffedd5;
}
.data-table tbody tr.paid-key-ledger-row { background: #f0f9ff; }
.data-table tbody tr.due-ledger-row { background: #f2fff7; }
.data-table tbody tr.paid-key-ledger-row:hover { background: #e0f2fe; }
.data-table tbody tr.due-ledger-row:hover { background: #e8fff1; }
.data-table tbody tr.paid-key-ledger-row .ledger-value.debit {
  color: #075985;
  background: #e0f2fe;
}
.ledger-reference { margin-top: 0; font-weight: 700; }
.ledger-value { display: inline-flex; min-width: 38px; justify-content: center; padding: 5px 8px; border-radius: 7px; font-size: 11px; font-weight: 850; }
.ledger-value.debit { color: #b42318; background: #fee4e2; }
.ledger-value.settled { color: #067647; background: #d1fadf; }
.back-link { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 15px; color: #075985; text-decoration: none; font-size: 12px; font-weight: 700; }
.metric-grid.metric-three { grid-template-columns: repeat(3, minmax(0, 280px)); }
.metric-grid.metric-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.metric-grid.metric-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.metric-grid.metric-six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-green { background: linear-gradient(135deg, #22c55e, #15803d); }
.metric-teal { background: linear-gradient(135deg, #2dd4bf, #0f766e); }
.metric-violet { background: linear-gradient(135deg, #8b5cf6, #4f46e5); }
.seller-actions { min-width: 160px; }
.owner-actions { min-width: 230px; }
.masked-password { color: #64748b; letter-spacing: 2px; font-size: 13px; font-weight: 750; }
.demo-settings-form { display: grid; grid-template-columns: minmax(240px,1fr) minmax(180px,260px) auto; align-items: end; gap: 18px; }
.demo-settings-form > label:not(.toggle-control) { display: grid; gap: 7px; color: #42647d; font-size: 11px; font-weight: 800; }
.demo-settings-form input[type="number"] { min-height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; outline: 0; color: var(--ink); background: #fbfdff; }
.toggle-control { display: flex; align-items: center; gap: 11px; min-height: 46px; color: #0c4a6e; font-size: 13px; font-weight: 800; cursor: pointer; }
.toggle-control input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-slider { position: relative; width: 50px; height: 28px; flex: 0 0 auto; border-radius: 999px; background: #cbd5e1; transition: .2s; }
.toggle-slider::after { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 7px rgba(15,23,42,.22); transition: .2s; }
.toggle-control input:checked + .toggle-slider { background: linear-gradient(135deg,#22c55e,#059669); }
.toggle-control input:checked + .toggle-slider::after { transform: translateX(22px); }
.settings-help { margin: 13px 0 0; color: var(--muted); font-size: 12px; }

.result-date-form { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.result-date-form label { display: grid; gap: 5px; color: #42647d; font-size: 10px; font-weight: 800; }
.result-date-form input { min-height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 10px; color: #0c4a6e; background: #fff; font-weight: 700; }
.result-date-form .primary-btn { min-height: 38px; padding: 0 15px; }
.result-slot-summary { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin: 0 0 20px; }
.result-slot-summary a { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; padding: 18px 20px; border: 1px solid rgba(14,165,233,.2); border-radius: 17px; color: #075985; background: linear-gradient(145deg,#fff,#eaf8ff); box-shadow: 0 12px 28px rgba(2,132,199,.09); text-decoration: none; }
.result-slot-summary span { font-size: 13px; font-weight: 850; }
.result-slot-summary strong { grid-row: 1 / span 2; grid-column: 2; color: #0284c7; font-size: 28px; }
.result-slot-summary small { color: var(--muted); font-size: 10px; font-weight: 700; }
.result-slot-section { scroll-margin-top: 18px; }
.result-photo-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.result-photo-card { min-width: 0; overflow: hidden; border: 1px solid rgba(14,165,233,.2); border-radius: 14px; background: #f8fcff; box-shadow: 0 8px 22px rgba(15,80,120,.08); }
.result-photo-card > a { display: block; aspect-ratio: 1.25; overflow: hidden; background: #dff3ff; }
.result-photo-card img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .25s ease; }
.result-photo-card:hover img { transform: scale(1.025); }
.result-photo-meta { display: flex; justify-content: space-between; gap: 10px; padding: 11px 12px; }
.result-photo-meta div { min-width: 0; }
.result-photo-meta strong, .result-photo-meta span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-photo-meta strong { color: #0c4a6e; font-size: 11px; }
.result-photo-meta span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.result-photo-meta time { flex: 0 0 auto; color: #0284c7; font-size: 9px; font-weight: 800; }
.result-gallery-empty { display: grid; justify-items: center; gap: 7px; padding: 34px 20px; border: 1px dashed rgba(14,165,233,.28); border-radius: 14px; color: #5f7c90; background: #f7fcff; text-align: center; }
.result-gallery-empty > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: #0284c7; background: #e0f2fe; font-size: 22px; }
.result-gallery-empty strong { color: #0c4a6e; font-size: 13px; }
.result-gallery-empty p { margin: 0; font-size: 11px; }
.privacy-notice { margin-bottom: 18px; }
.pnr-slot-section { scroll-margin-top: 18px; }
.pnr-table { min-width: 1480px; }
.pnr-table td { white-space: nowrap; }

.news-compose-card { margin-bottom: 20px; }
.news-compose-card .section-heading small { color: var(--muted); font-size: 10px; font-weight: 700; }
.news-compose-form { display: grid; gap: 18px; }
.news-compose-form > label:not(.toggle-control) { display: grid; gap: 8px; color: #254f6d; font-size: 11px; font-weight: 800; }
.news-compose-form textarea { width: 100%; min-height: 230px; resize: vertical; border: 1px solid #a8dffc; border-radius: 14px; padding: 16px; color: #0c3551; background: #fbfdff; font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.65; outline: none; }
.news-compose-form textarea:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,.12); }
.news-form-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.news-form-footer > span { color: var(--muted); font-size: 10px; font-weight: 700; }
.news-preview-card { overflow: hidden; }
.software-news-preview { width: min(984px,100%); aspect-ratio: 984 / 680; display: grid; grid-template-rows: 76px 1fr 78px; margin: 0 auto; overflow: hidden; border: 1px solid #174d7c; border-radius: 15px; color: #dceeff; background: #071426; box-shadow: 0 20px 55px rgba(4,38,70,.22); }
.software-news-preview > header { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: center; padding: 0 22px; border-bottom: 1px solid rgba(56,189,248,.25); background: linear-gradient(180deg,#0a2540,#071b31); }
.preview-brand { display: flex; align-items: center; gap: 10px; }
.preview-brand > span { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid #38bdf8; border-radius: 10px; color: #7dd3fc; font-weight: 900; }
.preview-brand div,.preview-clock span { display: grid; }
.preview-brand strong { font-size: 14px; }.preview-brand small,.preview-clock small { color: #7dd3fc; font-size: 7px; letter-spacing: .08em; }
.preview-title { justify-self: center; color: #67e8f9; font-size: 13px; font-weight: 900; letter-spacing: .08em; }
.preview-clock { justify-self: end; display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; }
.software-news-preview > main { min-height: 0; overflow: auto; padding: 26px 42px; background: linear-gradient(150deg,#0a1d34,#071426); }
.preview-date { margin: 0 0 18px; color: #38bdf8; font-size: 11px; font-weight: 800; }
.preview-news-text { white-space: pre-wrap; color: #e5f5ff; font-size: clamp(11px,1.3vw,15px); font-weight: 600; line-height: 1.75; }
.preview-news-empty { display: grid; place-items: center; height: 100%; color: #7694ac; font-size: 13px; }
.software-news-preview > footer { display: grid; grid-template-columns: minmax(220px,430px) minmax(180px,240px); justify-content: center; align-items: center; gap: 14px; padding: 12px 22px; border-top: 1px solid rgba(56,189,248,.2); background: #071b31; }
.software-news-preview footer button { width: 42px; height: 42px; border: 0; border-radius: 50%; color: #fff; background: #10b981; font-size: 10px; font-weight: 900; }
.software-news-preview footer button:last-child { background: #0ea5e9; }
.software-news-preview footer button:first-child { display: none; }
.software-news-preview footer button:last-child { width: 100%; height: 42px; border-radius: 11px; }
.software-news-preview footer button:last-child::after { content: ' Telegram · Join @oceanxpro'; }
.software-news-preview footer > span { display: grid; place-items: center; min-height: 42px; border-radius: 12px; color: #062b3f; background: linear-gradient(180deg,#2dd4bf,#14b8a6); font-size: 13px; font-weight: 900; letter-spacing: .12em; }
.preview-brand > span { color: transparent; overflow: hidden; background: #061c55 url('../img/ocean-pro-logo.jpg') center / cover no-repeat; }

.confirm-layer {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(6, 26, 48, .52);
    backdrop-filter: blur(7px);
}
.confirm-layer[hidden] { display: none; }
.confirm-dialog { width: min(400px, 100%); padding: 26px; border: 1px solid rgba(14,165,233,.28); border-radius: 22px; background: linear-gradient(155deg, #fff, #eef9ff); box-shadow: 0 28px 70px rgba(2,25,52,.35); text-align: center; }
.confirm-symbol { width: 52px; height: 52px; display: grid; place-items: center; margin: 0 auto 13px; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #fb7185, #e11d48); font-size: 20px; font-weight: 700; }
.confirm-dialog h2 { margin: 0; color: #0c4a6e; font-size: 21px; }
.confirm-dialog p { margin: 10px 0 20px; color: #526b7e; font-size: 13px; line-height: 1.6; }
.confirm-actions { display: flex; justify-content: center; gap: 10px; }
.confirm-actions button { min-width: 112px; min-height: 42px; border-radius: 11px; font-weight: 700; cursor: pointer; }
.confirm-cancel { border: 1px solid var(--line); color: #42647d; background: #fff; }
.confirm-ok { border: 0; color: #fff; background: linear-gradient(135deg, #0ea5e9, #0878c9); box-shadow: 0 8px 18px rgba(2,132,199,.22); }

@media (max-width: 820px) {
    .portal-topbar { align-items: flex-start; flex-direction: column; }
    .portal-nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; }
    .portal-nav a { white-space: nowrap; }
    .metric-grid { grid-template-columns: 1fr 1fr; }
    .metric-grid.metric-three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-grid.metric-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-grid.metric-five, .metric-grid.metric-six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .admin-seller-form { grid-template-columns: 1fr 1fr; }
    .admin-seller-form .primary-btn { grid-column: 1 / -1; }
    .delete-results-grid { grid-template-columns: 1fr; }
    .demo-settings-form { grid-template-columns: 1fr 1fr; }
    .demo-settings-form .primary-btn { grid-column: 1 / -1; }
    .result-photo-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 560px) {
    .portal-main { width: min(100% - 20px, 1240px); padding-top: 22px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .metric-grid { grid-template-columns: 1fr; }
    .metric-grid.metric-three { grid-template-columns: 1fr; }
    .metric-grid.metric-four { grid-template-columns: 1fr; }
    .metric-grid.metric-five, .metric-grid.metric-six { grid-template-columns: 1fr; }
    .create-key-form, .admin-seller-form { grid-template-columns: 1fr; }
    .create-key-form .primary-btn, .admin-seller-form .primary-btn { width: 100%; grid-column: auto; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .sign-in-row, .sign-in-row.has-demo { grid-template-columns: 1fr; }
    .demo-key-result { grid-template-columns: 1fr; }
    .demo-copy-btn { justify-content: center; }
    .sign-in-btn, .demo-create-btn { width: 100%; }
    .download-support-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
    .download-support-row .download-btn,.login-telegram-banner { grid-template-columns: 28px minmax(0,1fr) 14px; gap: 6px; padding-inline: 7px; }
    .download-action-icon,.login-telegram-icon { width: 27px; height: 27px; }
    .download-action-icon svg,.login-telegram-icon svg { width: 15px; height: 15px; }
    .download-action-copy strong,.login-telegram-copy strong { font-size: 11px; }
    .download-action-copy small,.login-telegram-copy small { font-size: 8px; }
    .demo-settings-form { grid-template-columns: 1fr; }
    .demo-settings-form .primary-btn { grid-column: auto; width: 100%; }
    .result-slot-summary, .result-photo-grid { grid-template-columns: 1fr; }
    .result-date-form { width: 100%; }
}
