:root {
    --bg: #f7f6fb;
    --surface: #ffffff;
    --surface-soft: #fbfaff;
    --ink: #252032;
    --muted: #777287;
    --border: #e7e3ef;
    --brand: #673de6;
    --brand-dark: #5228c7;
    --brand-soft: #f0ebff;
    --brand-softer: #f8f5ff;
    --success: #16855b;
    --success-soft: #e8f8f0;
    --danger: #d13b4b;
    --danger-soft: #fff0f2;
    --warning: #9a6500;
    --warning-soft: #fff7dc;
    --shadow: 0 10px 34px rgba(47, 36, 79, .07);
    --shadow-sm: 0 3px 14px rgba(47, 36, 79, .06);
    --sidebar-w: 255px;
    --topbar-h: 74px;
    --radius: 18px;
    --radius-sm: 12px;
}

/* Major admin update: readable tool text, accounts, blog and upload progress */
.tool-admin-search input,.tools-admin-toolbar select{font-size:13px!important}.tools-sync-note{font-size:12px!important}.tool-admin-title-row h2{font-size:17px!important}.tool-admin-card-head p{font-size:11px!important}.tool-mini-badge,.tool-state{min-height:25px;font-size:10px!important}.tool-admin-desc{min-height:38px;font-size:12px!important;line-height:1.6}.tool-metrics strong{font-size:17px!important}.tool-metrics span{font-size:10px!important}.tool-status-form label{font-size:11px!important}.tool-status-form input{font-size:12px!important}.tool-last-use{font-size:11px!important}.tool-last-use>strong{font-size:13px!important}.tool-last-use>code,.tool-last-use>small{font-size:10px!important}.activity-table th{font-size:10px!important}.activity-table td{font-size:11px!important}.tools-kpi small,.report-period,.report-security-note,.report-monthly-top label{font-size:10px!important}.month-report-grid a{font-size:11px!important}.tools-list-heading p,.reports-head p{font-size:12px!important}.field-group small,.upload-zone small{font-size:10px!important;line-height:1.5}.target-grid label,.check-options label{font-size:11px!important}.content-item-main>p{font-size:11px!important}.content-item-main>small{font-size:10px!important}.content-item-title span,.target-chips span{font-size:9px!important}
.account-grid-expanded{grid-template-columns:300px minmax(0,1fr)}.account-settings-stack{display:grid;gap:14px}.profile-photo{padding:0;object-fit:cover}.permission-picker,.seo-fieldset{margin:5px 0 15px;padding:15px;border:1px solid var(--border);border-radius:13px;background:#fbfaff}.permission-picker legend,.seo-fieldset>span{padding:0 6px;color:#5d5666;font-size:11px;font-weight:850;letter-spacing:.06em}.permission-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.permission-grid label{display:grid;grid-template-columns:auto 1fr;gap:9px;align-items:start;padding:11px;border:1px solid #ebe7f1;border-radius:10px;background:#fff;cursor:pointer}.permission-grid input{width:16px;height:16px;margin:2px 0 0;accent-color:var(--brand)}.permission-grid b,.permission-grid small{display:block}.permission-grid b{font-size:12px}.permission-grid small{margin-top:3px;color:var(--muted);font-size:10px;line-height:1.45}
.admin-user-list{display:grid;gap:9px}.admin-user-row{display:grid;grid-template-columns:44px minmax(0,1fr) auto auto;gap:12px;align-items:center;padding:14px;border:1px solid #e9e5ef;border-radius:13px}.admin-user-avatar{width:42px;height:42px;display:grid;place-items:center;overflow:hidden;border-radius:12px;background:var(--brand-soft);color:var(--brand);font-weight:850}.admin-user-avatar img,.admin-avatar img{width:100%;height:100%;display:block;object-fit:cover}.admin-user-row h3{margin:0;font-size:14px}.admin-user-row p{margin:3px 0;color:var(--muted);font-size:11px}.admin-user-row small{color:#9a94a2;font-size:10px}.main-admin-lock{padding:7px 10px;border-radius:999px;background:var(--brand-soft);color:var(--brand);font-size:10px;font-weight:800}
.blog-editor-layout{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(280px,.55fr);gap:15px;align-items:start}.blog-guide{position:sticky;top:94px;background:linear-gradient(150deg,#211731,#38245a);color:#fff}.blog-guide h3{margin:10px 0 16px;font-size:21px}.article-editor{min-height:430px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace!important;font-size:13px!important;line-height:1.65!important}.seo-fieldset>span{display:block;margin-bottom:12px;color:var(--brand)}
.upload-progress-modal[hidden]{display:none}.upload-progress-modal{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:24px;background:rgba(20,15,31,.68);backdrop-filter:blur(8px)}.upload-progress-card{width:min(440px,100%);padding:32px;border-radius:22px;background:#fff;text-align:center;box-shadow:0 28px 90px rgba(14,8,26,.35)}.upload-progress-icon{width:54px;height:54px;display:grid;place-items:center;margin:0 auto 15px;border-radius:16px;background:var(--brand-soft);color:var(--brand);font-size:24px;font-weight:900}.upload-progress-card>span{color:var(--brand);font-size:10px;font-weight:900;letter-spacing:.13em}.upload-progress-card h2{margin:8px 0 18px;font-size:20px;overflow-wrap:anywhere}.upload-progress-bar{height:10px;overflow:hidden;border-radius:99px;background:#eeeaf4}.upload-progress-bar i{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--brand),#8d6af1);transition:width .15s}.upload-progress-card>strong{display:block;margin-top:11px;font-size:24px}.upload-progress-card p{margin:7px 0 0;color:var(--muted);font-size:11px}.upload-progress-modal.has-error .upload-progress-icon,.upload-progress-modal.has-error .upload-progress-bar i{background:var(--danger);color:#fff}body.uploading{overflow:hidden}
@media(max-width:900px){.permission-grid{grid-template-columns:1fr}.blog-editor-layout,.account-grid-expanded{grid-template-columns:1fr}.blog-guide{position:static}.admin-user-row{grid-template-columns:44px 1fr}.admin-user-row>.tool-state,.admin-user-row>.content-item-actions{grid-column:2}}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

/* Authentication */
.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(circle at 15% 15%, rgba(103,61,230,.14), transparent 28%),
        radial-gradient(circle at 85% 85%, rgba(111,79,210,.10), transparent 30%),
        #f8f7fc;
}
.auth-box {
    width: min(420px, 100%);
    padding: 34px;
    background: rgba(255,255,255,.96);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
}
.auth-box::before {
    content: "D";
    display: grid;
    place-items: center;
    width: 48px; height: 48px;
    margin-bottom: 20px;
    border-radius: 14px;
    background: var(--brand);
    color: #fff;
    font-size: 20px;
    font-weight: 800;
}
.auth-box h1 { margin: 0 0 22px; font-size: 25px; letter-spacing: -.02em; }
.auth-box label, .modern-form label { display: block; color: #565064; font-size: 13px; font-weight: 650; }
.auth-box input {
    width: 100%; margin-top: 7px; padding: 12px 13px; border: 1px solid var(--border); border-radius: 11px; outline: none; background: #fff;
}
.auth-box input:focus { border-color: #9a7df1; box-shadow: 0 0 0 4px rgba(103,61,230,.09); }
.auth-box button { width: 100%; margin-top: 22px; border: 0; border-radius: 11px; padding: 13px; background: var(--brand); color: #fff; font-weight: 700; cursor: pointer; }

/* Main shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-w);
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    color: #fff;
    background: linear-gradient(180deg, #1f1735 0%, #171126 100%);
    transition: transform .25s ease;
    overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 24px 20px 20px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: linear-gradient(135deg, #7c56ea, #5d31d9); box-shadow: 0 8px 18px rgba(103,61,230,.28); font-weight: 900; }
.sidebar-brand strong { display: block; font-size: 16px; letter-spacing: -.01em; }
.sidebar-brand span { display: block; margin-top: 2px; color: #aaa2bb; font-size: 11px; }
.sidebar-nav { flex: 1; padding: 10px 13px 18px; }
.nav-label { padding: 14px 11px 7px; color: #817991; font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.nav-label.mail-label { margin-top: 12px; }
.sidebar-nav a { position: relative; display: flex; align-items: center; gap: 11px; min-height: 44px; margin: 3px 0; padding: 0 12px; border-radius: 11px; color: #c9c3d3; text-decoration: none; font-size: 13px; font-weight: 600; transition: .16s ease; }
.sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,.07); }
.sidebar-nav a.active { color: #fff; background: linear-gradient(90deg, rgba(103,61,230,.95), rgba(117,75,236,.84)); box-shadow: 0 7px 20px rgba(80,44,173,.18); }
.nav-icon { width: 22px; text-align: center; font-size: 17px; opacity: .96; }
.nav-live { position: absolute; right: 13px; width: 7px; height: 7px; border-radius: 99px; background: #52d59a; box-shadow: 0 0 0 3px rgba(82,213,154,.12); }
.sidebar-bottom { padding: 15px 14px 17px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-domain { padding: 5px 9px 13px; }
.sidebar-domain small { display: block; color: #837b92; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.sidebar-domain strong { display: block; margin-top: 4px; font-size: 12px; color: #ccc6d7; font-weight: 600; }
.sidebar-logout { display: flex; gap: 9px; align-items: center; padding: 10px 11px; border-radius: 10px; color: #f1b1ba; text-decoration: none; font-size: 12px; font-weight: 650; }
.sidebar-logout:hover { background: rgba(255,255,255,.06); }
.main-area { flex: 1; min-width: 0; margin-left: var(--sidebar-w); }
.topbar { height: var(--topbar-h); position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(231,227,239,.92); }
.topbar-title { font-size: 14px; font-weight: 750; color: #4c4658; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.admin-avatar { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 800; }
.topbar-user strong { display: block; font-size: 12px; color: #3d3748; }
.topbar-user span { display: block; margin-top: 1px; font-size: 10px; color: #9b96a4; }
.content { padding: 28px; }
.menu-toggle { display: none; position: fixed; z-index: 70; top: 16px; left: 15px; width: 42px; height: 42px; border: 0; border-radius: 11px; background: #211832; align-items: center; justify-content: center; flex-direction: column; gap: 4px; }
.menu-toggle span { width: 20px; height: 2px; background: #fff; border-radius: 2px; }
.sidebar-overlay { display: none; position: fixed; inset: 0; z-index: 45; background: rgba(24,18,35,.48); backdrop-filter: blur(2px); }
.sidebar-overlay.visible { display: block; }

/* Shared headings & components */
.page-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-heading { margin: 0; font-size: 27px; letter-spacing: -.035em; }
.page-subtitle { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.back-link { display: inline-block; margin-bottom: 11px; color: var(--muted); font-size: 12px; text-decoration: none; }
.back-link:hover { color: var(--brand); }
.welcome-heading { margin: 0; font-size: 27px; letter-spacing: -.035em; }
.welcome-sub { margin: 7px 0 24px; color: var(--muted); font-size: 13px; }

.alert { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 20px; padding: 12px 14px; border: 1px solid; border-radius: 12px; font-size: 12px; line-height: 1.45; }
.alert strong { flex: none; }
.alert-success { color: #176847; background: var(--success-soft); border-color: #c7ebdb; }
.alert-error { color: #a72f3d; background: var(--danger-soft); border-color: #f3cbd0; }
.error { color: var(--danger); }
.notice { color: var(--success); }

.btn-primary, .btn-secondary, .btn-ghost-danger, .btn-reply, .btn-delete { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 15px; border: 0; border-radius: 10px; text-decoration: none; font-size: 12px; font-weight: 750; cursor: pointer; transition: .16s ease; }
.btn-primary { margin-top: 18px; color: #fff; background: var(--brand); box-shadow: 0 6px 15px rgba(103,61,230,.15); }
.btn-primary:hover { color: #fff; background: var(--brand-dark); transform: translateY(-1px); }
.btn-primary.wide { width: 100%; }
.btn-primary.no-margin { margin-top: 0; }
.btn-primary.compact, .btn-secondary.compact { min-height: 36px; padding: 0 12px; }
.btn-secondary { color: #4c4658; background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { color: var(--brand); border-color: #cfc2f6; }
.btn-ghost-danger { color: var(--danger); background: transparent; border: 1px solid #f0d5d8; }
.btn-ghost-danger:hover { background: var(--danger-soft); }

.panel-card, .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-card { padding: 22px; }
.card { max-width: 600px; padding: 20px; margin-bottom: 20px; }
.panel-card-head { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; }
.panel-card-head h2, .card h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.panel-card-head p, .card-sub { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.panel-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; font-size: 17px; font-weight: 800; }
.panel-icon.purple { color: var(--brand); background: var(--brand-soft); }

/* Dashboard */
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stat-card { position: relative; min-height: 145px; padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none; transition: .18s ease; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; width: 85px; height: 85px; border-radius: 50%; right: -28px; top: -28px; background: var(--brand-soft); }
.stat-card:hover { transform: translateY(-2px); border-color: #d8cef6; box-shadow: var(--shadow); }
.stat-number { font-size: 34px; font-weight: 820; letter-spacing: -.04em; }
.stat-label { margin-top: 20px; color: var(--muted); font-size: 12px; font-weight: 600; }
.stat-badge { position: absolute; top: 18px; right: 18px; z-index: 1; padding: 5px 8px; border-radius: 99px; color: #8a5c00; background: var(--warning-soft); font-size: 10px; font-weight: 800; }

/* Forms */
.modern-form, .stacked-form { width: 100%; }
.field-grid { display: grid; gap: 14px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.field-grid.three { grid-template-columns: 1.4fr .65fr .8fr; }
.field-group { margin-bottom: 14px; }
.field-group label, .stacked-form label { display: block; margin: 0 0 7px; color: #5e5868; font-size: 12px; font-weight: 700; }
.field-group input, .field-group select, .field-group textarea, .modern-form input, .modern-form select, .modern-form textarea, .stacked-form input, .stacked-form textarea, .stacked-form select {
    width: 100%; min-height: 43px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--ink); outline: none; font-size: 13px; transition: .15s ease;
}
.field-group textarea, .modern-form textarea, .stacked-form textarea { min-height: 130px; resize: vertical; line-height: 1.5; }
.field-group input:focus, .field-group select:focus, .field-group textarea:focus, .modern-form input:focus, .modern-form select:focus, .modern-form textarea:focus, .stacked-form input:focus, .stacked-form textarea:focus, .stacked-form select:focus { border-color: #a88df1; box-shadow: 0 0 0 4px rgba(103,61,230,.08); }
.field-group small { display: block; margin-top: 6px; color: #9a95a4; font-size: 10px; }
.password-field { position: relative; }
.password-field input { padding-right: 65px; }
.password-toggle { position: absolute; top: 50%; right: 7px; transform: translateY(-50%); border: 0; background: var(--brand-soft); color: var(--brand); border-radius: 7px; padding: 5px 9px; font-size: 10px; font-weight: 750; cursor: pointer; }
.form-row { display: flex; gap: 14px; }
.form-row > div { flex: 1; }

.advanced-settings { margin-top: 2px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-soft); overflow: hidden; }
.advanced-settings summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; list-style: none; padding: 12px 14px; cursor: pointer; color: #514b5d; font-size: 12px; font-weight: 750; }
.advanced-settings summary::-webkit-details-marker { display: none; }
.advanced-settings summary span { color: #9791a1; font-size: 10px; font-weight: 500; }
.advanced-settings[open] summary { border-bottom: 1px solid var(--border); }
.advanced-body { padding: 14px 14px 1px; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th { padding: 13px 14px; text-align: left; border-bottom: 1px solid var(--border); background: #fbfafd; color: #7a7484; font-size: 10px; text-transform: uppercase; letter-spacing: .055em; font-weight: 800; }
.data-table td { padding: 14px; border-bottom: 1px solid #efecf4; font-size: 12px; line-height: 1.45; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fcfbff; }
.data-table a { text-decoration: none; }
.sort-link { color: #6d6777; }
.message-cell { max-width: 350px; color: #686170; }
.inline-form { display: inline-block; margin: 0; }
.actions-cell { white-space: nowrap; }
.data-table select { min-height: 32px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 11px; }
.status-new { color: #8e5f00; background: #fff8de; }
.status-read { color: #5335ac; background: #f1ecff; }
.status-replied { color: #14744f; background: #ebf9f2; }
.btn-reply { min-height: 32px; padding: 0 10px; color: var(--brand); background: var(--brand-soft); }
.btn-delete { min-height: 32px; padding: 0 10px; color: var(--danger); background: var(--danger-soft); }
.empty { padding: 45px 20px !important; text-align: center; color: #9993a2; }

/* Mail account setup */
.mail-setup-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .75fr); gap: 18px; align-items: stretch; }
.mailbox-connect-card { min-width: 0; }
.mail-help-card { position: relative; overflow: hidden; padding: 24px; border-radius: var(--radius); background: linear-gradient(145deg, #261a43, #3a2563); color: #fff; box-shadow: var(--shadow); }
.mail-help-card::after { content: ""; position: absolute; width: 170px; height: 170px; border-radius: 50%; right: -70px; top: -70px; background: rgba(123,83,234,.33); }
.help-kicker { position: relative; z-index: 1; color: #bba9ed; font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.mail-help-card h3 { position: relative; z-index: 1; margin: 8px 0 20px; font-size: 20px; }
.server-line { position: relative; z-index: 1; display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; align-items: center; padding: 11px 0; border-bottom: 1px solid rgba(255,255,255,.11); }
.server-line span { color: #aaa0ba; font-size: 10px; }
.server-line strong { font-size: 11px; font-weight: 650; }
.server-line em { color: #d3c7f3; font-size: 10px; font-style: normal; }
.mail-help-card > p { position: relative; z-index: 1; margin: 18px 0; color: #c2b9ce; font-size: 11px; line-height: 1.55; }
.help-note { position: relative; z-index: 1; padding: 11px; border-radius: 10px; background: rgba(255,255,255,.07); color: #d7d0df; font-size: 10px; line-height: 1.45; }
.mail-account-section { margin-top: 25px; }
.section-title-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 13px; }
.section-title-row h2 { margin: 0; font-size: 17px; }
.section-title-row p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.count-pill { padding: 6px 10px; border: 1px solid #d8cff2; border-radius: 99px; color: var(--brand); background: var(--brand-softer); font-size: 10px; font-weight: 800; }
.mail-account-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 14px; }
.mail-account-card { padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow-sm); }
.mail-account-top { display: flex; align-items: center; gap: 11px; }
.mail-avatar { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: #fff; background: linear-gradient(135deg, #7d57ec, #5f35d8); font-size: 13px; font-weight: 850; }
.mail-avatar.large { width: 44px; height: 44px; border-radius: 13px; font-size: 15px; }
.mail-account-copy { min-width: 0; flex: 1; }
.mail-account-copy h3 { margin: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-account-copy p { margin: 3px 0 0; color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-dot { display: inline-flex; align-items: center; gap: 5px; color: var(--success); font-size: 9px; font-weight: 800; }
.live-dot i { width: 6px; height: 6px; border-radius: 50%; background: #36b37e; }
.mail-account-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 15px 0; padding: 12px; background: #faf9fc; border-radius: 10px; }
.mail-account-meta span { min-width: 0; color: #575061; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail-account-meta small { display: block; margin-bottom: 3px; color: #aaa4b0; font-size: 8px; font-weight: 850; letter-spacing: .08em; }
.mail-account-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.empty-state-card { grid-column: 1/-1; padding: 42px 20px; text-align: center; border: 1px dashed #d6d0df; border-radius: var(--radius); background: rgba(255,255,255,.55); }
.empty-state-icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 14px; color: var(--brand); background: var(--brand-soft); font-size: 20px; }
.empty-state-card h3 { margin: 0; font-size: 14px; }
.empty-state-card p { max-width: 440px; margin: 7px auto 0; color: var(--muted); font-size: 11px; line-height: 1.55; }

/* Full mail client */
.mail-app { margin: -8px; }
.mail-app-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 16px; padding: 0 2px; }
.mail-account-identity { display: flex; align-items: center; gap: 11px; }
.mail-account-identity h1 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
.mail-account-identity p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.status-online { margin-left: 6px; color: var(--success); font-size: 9px; font-weight: 800; }
.mail-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.mail-layout { display: grid; grid-template-columns: 180px 340px minmax(0,1fr); height: calc(100vh - 150px); min-height: 580px; overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); }
.mail-folders-panel { display: flex; flex-direction: column; padding: 14px 10px; background: #fbfafd; border-right: 1px solid var(--border); }
.compose-side-btn { display: flex; align-items: center; justify-content: center; min-height: 40px; margin: 0 3px 13px; border-radius: 10px; color: #fff; background: var(--brand); text-decoration: none; font-size: 11px; font-weight: 800; }
.mail-folder-nav { display: flex; flex-direction: column; gap: 2px; }
.mail-folder-nav a { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; min-height: 39px; padding: 0 10px; border-radius: 9px; color: #635d6d; text-decoration: none; font-size: 11px; font-weight: 650; }
.mail-folder-nav a:hover { background: #f0ecf8; }
.mail-folder-nav a.active { color: var(--brand); background: var(--brand-soft); font-weight: 800; }
.folder-icon { text-align: center; font-size: 14px; }
.mail-folder-nav em { min-width: 20px; padding: 3px 6px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 8px; font-style: normal; text-align: center; }
.mail-storage-note { margin-top: auto; padding: 12px 9px 4px; border-top: 1px solid var(--border); color: var(--muted); }
.mail-storage-note small { display: block; color: #aaa4b0; font-size: 8px; text-transform: uppercase; letter-spacing: .08em; }
.mail-storage-note strong { display: block; margin: 4px 0; color: #5b5563; font-size: 9px; overflow: hidden; text-overflow: ellipsis; }
.mail-storage-note span { display: block; font-size: 8px; line-height: 1.4; }
.message-list-panel { min-width: 0; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.message-list-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 65px; padding: 11px 12px; border-bottom: 1px solid var(--border); }
.message-list-head h2 { margin: 0; font-size: 15px; }
.message-list-head > div > span { display: block; margin-top: 2px; color: #9c96a5; font-size: 8px; }
.mini-search { width: 150px; position: relative; }
.mini-search span { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); color: #9992a2; }
.mini-search input { width: 100%; height: 34px; padding: 0 9px 0 27px; border: 1px solid var(--border); border-radius: 9px; outline: none; background: #faf9fc; font-size: 9px; }
.mini-search input:focus { border-color: #b8a5ed; }
.message-list { flex: 1; overflow-y: auto; }
.message-row { position: relative; display: flex; align-items: flex-start; gap: 10px; min-height: 76px; padding: 12px 13px; border-bottom: 1px solid #f0edf3; color: var(--ink); text-decoration: none; transition: background .12s ease; }
.message-row:hover { background: #fbf9ff; }
.message-row.selected { background: #f2edff; box-shadow: inset 3px 0 0 var(--brand); }
.sender-dot { flex: none; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: #5b3ab4; background: #ece6fb; font-size: 10px; font-weight: 850; }
.sender-dot.big { width: 38px; height: 38px; border-radius: 11px; }
.message-row-copy { min-width: 0; flex: 1; }
.message-row-top { display: flex; align-items: center; gap: 7px; }
.message-row-top strong { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #494352; font-size: 10px; font-weight: 650; }
.message-row.unread .message-row-top strong, .message-row.unread p { color: #2d2638; font-weight: 820; }
.message-row-top time { color: #a39da9; font-size: 8px; }
.message-row p { margin: 5px 0 0; color: #77717e; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-dot { position: absolute; right: 10px; bottom: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }
.mail-empty, .mail-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; padding: 30px; text-align: center; color: var(--muted); }
.mail-empty > div, .placeholder-graphic { width: 55px; height: 55px; display: grid; place-items: center; border-radius: 16px; background: var(--brand-soft); color: var(--brand); font-size: 22px; }
.mail-empty h3, .mail-placeholder h2 { margin: 13px 0 0; color: #4d4657; font-size: 15px; }
.mail-empty p, .mail-placeholder p { max-width: 350px; margin: 6px 0 18px; font-size: 10px; line-height: 1.5; }
.message-view-panel { min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.message-view-toolbar { min-height: 55px; display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.message-view-toolbar h2 { margin: 0; font-size: 14px; }
.toolbar-group { display: flex; align-items: center; gap: 5px; }
.toolbar-group form { margin: 0; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: none; padding: 0; border: 1px solid var(--border); border-radius: 9px; color: #686171; background: #fff; text-decoration: none; cursor: pointer; font-size: 14px; }
.icon-btn:hover { color: var(--brand); background: var(--brand-softer); border-color: #d7ccf6; }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); border-color: #efcdd2; }
.opened-message { flex: 1; padding: 23px; overflow-y: auto; }
.opened-message > h2 { margin: 0 0 18px; color: #322c3a; font-size: 20px; letter-spacing: -.025em; }
.opened-sender { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding-bottom: 17px; border-bottom: 1px solid #efecf3; }
.opened-sender strong { display: inline; font-size: 11px; }
.opened-sender span { margin-left: 5px; color: #938d9c; font-size: 9px; }
.opened-sender small { display: block; margin-top: 3px; color: #aaa4b0; font-size: 8px; }
.opened-sender time { color: #9a94a2; font-size: 9px; }
.opened-body { padding-top: 19px; }
.plain-mail-body { color: #48414f; font-size: 12px; line-height: 1.7; white-space: normal; }
.mail-html-frame { width: 100%; min-height: 420px; border: 0; background: #fff; }
.compose-pane { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.compose-form { flex: 1; display: flex; flex-direction: column; padding: 18px; min-height: 0; }
.compose-from { margin-bottom: 12px; padding: 9px 11px; border-radius: 9px; background: #faf9fc; color: var(--muted); font-size: 9px; }
.compose-from strong { color: #4d4657; }
.compose-form label { display: grid; grid-template-columns: 55px 1fr; align-items: center; min-height: 44px; border-bottom: 1px solid var(--border); color: #8b8492; font-size: 10px; }
.compose-form input { width: 100%; height: 42px; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 11px; }
.compose-form textarea { flex: 1; width: 100%; min-height: 260px; margin-top: 14px; padding: 0; border: 0; resize: none; outline: none; color: #403a47; font-size: 12px; line-height: 1.65; }
.compose-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); }
.compose-footer span { color: #9f99a5; font-size: 8px; }

/* Reply page */
.reply-layout { display: grid; grid-template-columns: minmax(280px,.8fr) minmax(0,1.2fr); gap: 18px; align-items: start; }
.contact-profile-row { display: flex; align-items: center; gap: 10px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.contact-profile-row h2 { margin: 0; font-size: 14px; }
.contact-profile-row a { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; text-decoration: none; }
.contact-details { margin: 14px 0 0; }
.contact-details > div { padding: 9px 0; }
.contact-details dt { color: #9b95a3; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.contact-details dd { margin: 5px 0 0; color: #514a59; font-size: 11px; line-height: 1.55; }
.reply-card { min-width: 0; }

/* Responsive */
@media (max-width: 1180px) {
    .mail-layout { grid-template-columns: 155px 305px minmax(0,1fr); }
    .mail-help-card { display: none; }
    .mail-setup-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-area { margin-left: 0; }
    .menu-toggle { display: flex; }
    .topbar { padding-left: 70px; }
    .stat-grid { grid-template-columns: 1fr; }
    .mail-layout { height: auto; min-height: 0; grid-template-columns: 150px minmax(280px, .8fr) minmax(0,1.2fr); }
    .message-view-panel { min-height: 650px; }
    .reply-layout { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
    .content { padding: 18px; }
    .topbar { padding-right: 16px; }
    .topbar-user > div:last-child { display: none; }
    .page-heading-row, .mail-app-head { flex-direction: column; align-items: stretch; }
    .page-heading-row .btn-secondary { align-self: flex-start; }
    .field-grid.two, .field-grid.three { grid-template-columns: 1fr; }
    .mail-layout { grid-template-columns: 1fr; overflow: visible; border-radius: 14px; }
    .mail-folders-panel { border-right: 0; border-bottom: 1px solid var(--border); }
    .mail-folder-nav { flex-direction: row; overflow-x: auto; padding-bottom: 2px; }
    .mail-folder-nav a { flex: none; grid-template-columns: 20px auto auto; }
    .mail-storage-note { display: none; }
    .compose-side-btn { align-self: flex-start; padding: 0 16px; }
    .message-list-panel { max-height: 420px; border-right: 0; border-bottom: 1px solid var(--border); }
    .message-view-panel { min-height: 620px; }
    .mail-account-grid { grid-template-columns: 1fr; }
    .server-line { grid-template-columns: 62px 1fr; }
    .server-line em { display: none; }
    .data-table thead { display: none; }
    .data-table, .data-table tbody, .data-table tr, .data-table td { display: block; width: 100%; min-width: 0; }
    .data-table tr { padding: 10px 12px; border-bottom: 1px solid var(--border); }
    .data-table td { padding: 6px 0; border: 0; }
    .data-table td::before { content: attr(data-label); display: block; margin-bottom: 2px; color: #aaa4b0; font-size: 8px; text-transform: uppercase; letter-spacing: .07em; }
}
@media (max-width: 520px) {
    .content { padding: 14px; }
    .page-heading { font-size: 23px; }
    .mail-account-actions { align-items: stretch; flex-direction: column; }
    .mail-account-actions form, .mail-account-actions button, .mail-account-actions a { width: 100%; }
    .mail-head-actions { justify-content: flex-start; }
    .mini-search { width: 125px; }
    .opened-sender { grid-template-columns: auto 1fr; }
    .opened-sender time { grid-column: 2; }
    .compose-footer { align-items: flex-start; flex-direction: column; }
}


/* DS Tools Control */
.tools-stat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 20px; }
.tools-stat-grid .stat-card { min-height: 118px; }
.tools-stat-grid .stat-label { margin-top: 12px; }
.tools-admin-toolbar { display: grid; grid-template-columns: minmax(260px, 1fr) 190px auto; align-items: center; gap: 10px; margin: 0 0 16px; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.tool-admin-search { position: relative; }
.tool-admin-search span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #9c96a5; }
.tool-admin-search input, .tools-admin-toolbar select { width: 100%; min-height: 40px; border: 1px solid var(--border); border-radius: 10px; outline: 0; background: #fbfafe; color: var(--ink); font-size: 11px; }
.tool-admin-search input { padding: 0 12px 0 34px; }
.tools-admin-toolbar select { padding: 0 10px; }
.tool-admin-search input:focus, .tools-admin-toolbar select:focus, .tool-status-form input:focus { border-color: #a58df0; box-shadow: 0 0 0 3px rgba(103,61,230,.08); }
.tools-sync-note { color: var(--muted); font-size: 10px; white-space: nowrap; }
.tools-sync-note code { color: #574f61; }
.tool-admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tool-admin-card { min-width: 0; padding: 17px; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.tool-admin-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tool-admin-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tool-admin-title-row h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.tool-admin-card-head p { margin: 5px 0 0; color: #9a94a2; font-size: 9px; }
.tool-mini-badge, .tool-state { display: inline-flex; align-items: center; min-height: 23px; padding: 0 8px; border-radius: 99px; font-size: 8px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.tool-mini-badge { color: #5d4e78; background: #f2eefb; }
.tool-state { flex: none; }
.tool-state.on { color: #13734f; background: var(--success-soft); }
.tool-state.off { color: #a72f3d; background: var(--danger-soft); }
.tool-state.locked { color: #8a5c00; background: var(--warning-soft); }
.tool-admin-desc { min-height: 34px; margin: 12px 0; color: #6f6977; font-size: 10px; line-height: 1.55; }
.tool-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin: 12px 0; }
.tool-metrics > div { min-width: 0; padding: 9px; border-radius: 10px; background: #faf9fc; border: 1px solid #f0edf4; }
.tool-metrics strong { display: block; color: #3d3748; font-size: 15px; }
.tool-metrics span { display: block; margin-top: 3px; color: #9c96a5; font-size: 8px; }
.tool-status-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-top: 12px; }
.tool-status-form label { min-width: 0; color: #77717e; font-size: 9px; font-weight: 700; }
.tool-status-form input { width: 100%; min-height: 36px; margin-top: 5px; padding: 0 10px; border: 1px solid var(--border); border-radius: 9px; outline: 0; background: #fff; color: var(--ink); font-size: 10px; }
.tool-admin-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #efecf3; }
.tool-admin-actions form { margin: 0; }
.tool-admin-actions .btn-primary, .tool-admin-actions .btn-ghost-danger { margin-top: 0; }
.tool-admin-actions .compact { min-height: 36px; padding: 0 12px; }
.tool-admin-actions button[disabled] { opacity: .55; cursor: not-allowed; }
.tool-admin-empty { padding: 30px; border: 1px dashed var(--border); border-radius: 14px; color: var(--muted); background: #fff; text-align: center; font-size: 12px; }
@media (max-width: 1260px) { .tools-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 980px) { .tools-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tool-admin-grid { grid-template-columns: 1fr; } .tools-admin-toolbar { grid-template-columns: 1fr 180px; } .tools-sync-note { grid-column: 1 / -1; } }
@media (max-width: 620px) { .tools-stat-grid { grid-template-columns: 1fr; } .tools-admin-toolbar { grid-template-columns: 1fr; } .tools-sync-note { grid-column: auto; white-space: normal; } .tool-metrics { grid-template-columns: repeat(2, 1fr); } .tool-status-form { grid-template-columns: 1fr; } .tool-admin-actions { align-items: stretch; flex-direction: column; } .tool-admin-actions a, .tool-admin-actions form, .tool-admin-actions button { width: 100%; } }


/* Per-use DS Tools activity */
.tool-last-use{display:grid;grid-template-columns:auto auto 1fr;align-items:center;gap:5px 9px;margin:0 0 12px;padding:10px 11px;border:1px solid #eeeaf2;border-radius:11px;background:#fbfafc;font-size:9px;color:#8f8797}.tool-last-use>span{font-weight:700;text-transform:uppercase;letter-spacing:.06em}.tool-last-use>strong{font-size:11px;color:#403849}.tool-last-use>code{justify-self:end;font-size:9px;color:#5d5366;background:#f1eef4;padding:3px 6px;border-radius:6px}.tool-last-use>small{grid-column:1/-1;color:#9b94a3;font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.tool-last-use.no-use{display:block;color:#aaa3af;text-align:center}.tool-activity-panel{margin:0 0 22px;padding:18px;border:1px solid var(--border);border-radius:17px;background:#fff;box-shadow:var(--shadow-sm)}.tool-activity-head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;margin-bottom:14px}.tool-activity-head h2{margin:7px 0 4px;font-size:20px}.tool-activity-head p{margin:0;color:#918a99;font-size:10px}.activity-table-wrap{overflow:auto;border:1px solid #eeeaf2;border-radius:12px}.activity-table{width:100%;border-collapse:collapse;min-width:900px;background:#fff}.activity-table th,.activity-table td{padding:10px 11px;border-bottom:1px solid #f0edf3;text-align:left;vertical-align:middle;font-size:9px}.activity-table th{position:sticky;top:0;background:#faf9fb;color:#7f7788;font-size:8px;text-transform:uppercase;letter-spacing:.06em}.activity-table td strong{color:#3f3848}.activity-table td code{font-size:9px;color:#514859}.activity-table tbody tr:last-child td{border-bottom:0}.activity-table tbody tr:hover{background:#fcfbfd}.activity-empty{text-align:center!important;color:#99919f;padding:24px!important}
@media(max-width:700px){.tool-activity-head{flex-direction:column}.tool-last-use{grid-template-columns:auto auto}.tool-last-use>code{justify-self:start}.tool-activity-panel{padding:13px}}

/* Tools Control Center — v6 */
.page-sub { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.content { width: 100%; max-width: 1660px; margin: 0 auto; }
.tools-hero {
    position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 28px;
    margin-bottom: 20px; padding: 26px 28px; border: 1px solid #ddd5f6; border-radius: 22px;
    background: linear-gradient(135deg,#ffffff 0%,#faf8ff 55%,#f1ecff 100%); box-shadow: var(--shadow-sm);
}
.tools-hero::after { content:""; position:absolute; right:-70px; top:-115px; width:280px; height:280px; border-radius:50%; background:rgba(103,61,230,.09); }
.tools-hero::before { content:""; position:absolute; right:125px; bottom:-90px; width:190px; height:190px; border-radius:50%; background:rgba(103,61,230,.045); }
.tools-hero > * { position: relative; z-index: 1; }
.eyebrow { margin-bottom: 8px; color: var(--brand); font-size: 9px; font-weight: 900; letter-spacing: .16em; }
.tools-hero h1 { margin:0; font-size: 30px; line-height:1.1; letter-spacing:-.04em; }
.tools-hero p { max-width: 760px; margin: 9px 0 0; color: #756e81; font-size: 12px; line-height: 1.6; }
.tools-open-site { min-width: 142px; }

.tools-stat-grid { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
.tools-stat-grid .stat-card { min-height: 132px; padding: 18px; }
.tools-kpi::after { width:74px; height:74px; right:-24px; top:-24px; }
.tools-kpi .kpi-icon { position:absolute; z-index:2; right:15px; top:15px; width:31px; height:31px; display:grid; place-items:center; border-radius:10px; background:#f2edff; color:var(--brand); font-size:13px; font-weight:900; }
.tools-kpi .stat-number { font-size: 29px; }
.tools-kpi .stat-label { margin-top: 10px; color:#554e60; font-size:11px; font-weight:800; }
.tools-kpi small { display:block; margin-top:4px; color:#a19aa9; font-size:8px; }

.reports-panel { margin-bottom: 20px; padding: 20px; border:1px solid var(--border); border-radius:19px; background:#fff; box-shadow:var(--shadow-sm); }
.reports-head { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin-bottom:14px; }
.reports-head-copy { display:flex; gap:12px; align-items:flex-start; }
.reports-icon { flex:none; width:39px; height:39px; display:grid; place-items:center; border-radius:12px; color:#fff; background:linear-gradient(135deg,#6f49df,#5430c4); box-shadow:0 8px 18px rgba(103,61,230,.18); font-size:17px; font-weight:800; }
.reports-head h2 { margin:1px 0 4px; font-size:17px; letter-spacing:-.02em; }
.reports-head p { max-width:900px; margin:0; color:#88818f; font-size:10px; line-height:1.55; }
.report-security-note { flex:none; padding:6px 9px; border-radius:99px; color:#176847; background:#eaf8f1; font-size:8px; font-weight:850; text-transform:uppercase; letter-spacing:.06em; }
.report-quick-grid { display:grid; grid-template-columns: 210px 210px minmax(0,1fr); gap:11px; }
.report-quick-card { position:relative; min-height:153px; display:flex; flex-direction:column; padding:15px; border:1px solid #e9e4f3; border-radius:14px; background:linear-gradient(180deg,#fdfcff,#faf8ff); color:var(--ink); text-decoration:none; transition:.16s ease; }
.report-quick-card:hover { transform:translateY(-2px); border-color:#cfc2f6; box-shadow:0 10px 24px rgba(69,52,105,.08); }
.report-period { color:#908797; font-size:8px; font-weight:900; letter-spacing:.1em; }
.report-quick-card strong { margin-top:13px; font-size:22px; letter-spacing:-.03em; }
.report-quick-card small { margin-top:3px; color:#99919f; font-size:9px; }
.report-quick-card b { margin-top:auto; display:flex; align-items:center; justify-content:space-between; color:var(--brand); font-size:10px; }
.report-quick-card b span { width:25px; height:25px; display:grid; place-items:center; border-radius:8px; background:#eee8ff; }
.report-monthly-box { padding:14px; border:1px solid #e9e4f3; border-radius:14px; background:#fbfaff; }
.report-monthly-top { display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin-bottom:11px; }
.report-monthly-top strong { display:block; margin-top:5px; font-size:13px; }
.report-monthly-top label { color:#908997; font-size:8px; font-weight:800; text-transform:uppercase; letter-spacing:.06em; }
.report-monthly-top select { display:block; min-width:88px; height:32px; margin-top:4px; padding:0 9px; border:1px solid var(--border); border-radius:8px; outline:0; background:#fff; color:#51495c; font-size:10px; }
.report-monthly-top select:focus { border-color:#a58df0; box-shadow:0 0 0 3px rgba(103,61,230,.08); }
.month-report-grid { display:grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap:6px; }
.month-report-grid a { min-height:35px; display:flex; align-items:center; gap:6px; padding:0 8px; border:1px solid #ece8f2; border-radius:8px; background:#fff; color:#574f61; text-decoration:none; font-size:9px; font-weight:750; transition:.15s ease; }
.month-report-grid a span { color:#aaa3af; font-size:7px; }
.month-report-grid a i { margin-left:auto; color:#8e7ac6; font-style:normal; }
.month-report-grid a:hover { color:var(--brand); border-color:#cfc2f6; background:#f6f2ff; }

.tools-list-section { padding: 20px; border:1px solid var(--border); border-radius:19px; background:#fff; box-shadow:var(--shadow-sm); }
.tools-list-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:15px; margin-bottom:13px; }
.tools-list-heading h2 { margin:0; font-size:17px; letter-spacing:-.02em; }
.tools-list-heading p { margin:4px 0 0; color:#918a99; font-size:10px; }
.tools-list-heading > span { padding:6px 9px; border-radius:99px; background:#f4f1f8; color:#7c7483; font-size:8px; font-weight:800; }
.tools-admin-toolbar { display:grid; grid-template-columns:minmax(280px,1fr) 190px auto; align-items:center; gap:9px; margin:0 0 13px; padding:9px; border:1px solid #ece8f2; border-radius:12px; background:#faf9fc; box-shadow:none; }
.tool-admin-search span { left:13px; font-size:16px; }
.tool-admin-search input,.tools-admin-toolbar select { min-height:39px; border:1px solid #e2ddea; border-radius:9px; background:#fff; font-size:10px; }
.tool-admin-search input { padding-left:37px; }
.tools-sync-note { display:flex; align-items:center; gap:6px; color:#827b89; font-size:9px; white-space:nowrap; }
.tools-sync-note i { width:7px; height:7px; border-radius:99px; background:#39b77d; box-shadow:0 0 0 3px rgba(57,183,125,.12); }
.tool-admin-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap:10px; }
.tool-admin-card { padding:15px; border:1px solid #e9e5ef; border-radius:14px; box-shadow:none; transition:.16s ease; }
.tool-admin-card:hover { border-color:#d6cef0; box-shadow:0 9px 22px rgba(47,36,79,.055); }
.tool-admin-title-row h2 { font-size:14px; }
.tool-admin-card-head p { display:flex; align-items:center; gap:5px; margin-top:5px; font-size:8px; }
.tool-admin-card-head p code { padding:2px 5px; border-radius:5px; background:#f4f1f7; color:#635b6b; }
.tool-state { gap:5px; min-height:24px; padding:0 9px; }
.tool-state i { width:6px; height:6px; border-radius:50%; background:currentColor; opacity:.8; }
.tool-admin-desc { min-height:30px; margin:10px 0; font-size:9px; }
.tool-metrics { gap:6px; margin:10px 0; }
.tool-metrics > div { padding:8px; border-radius:9px; background:#fbfafd; }
.tool-metrics strong { font-size:14px; }
.tool-metrics span { font-size:7px; text-transform:uppercase; letter-spacing:.04em; }
.tool-last-use { margin-bottom:9px; padding:9px 10px; background:#faf9fb; }
.tool-status-form { margin-top:9px; }
.tool-status-form input { min-height:34px; }
.tool-admin-actions { margin-top:10px; padding-top:10px; }
.tool-admin-links { display:flex; gap:6px; }
.activity-head-actions { display:flex; gap:7px; flex-wrap:wrap; justify-content:flex-end; }

@media (max-width: 1320px) {
    .tools-stat-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .report-quick-grid { grid-template-columns: 1fr 1fr; }
    .report-monthly-box { grid-column:1/-1; }
}
@media (max-width: 980px) {
    .tools-hero { align-items:flex-start; flex-direction:column; }
    .tools-stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .tool-admin-grid { grid-template-columns:1fr; }
    .tools-admin-toolbar { grid-template-columns:1fr 180px; }
    .tools-sync-note { grid-column:1/-1; }
    .month-report-grid { grid-template-columns:repeat(4,minmax(0,1fr)); }
}
@media (max-width: 640px) {
    .tools-hero,.reports-panel,.tools-list-section { padding:15px; border-radius:15px; }
    .tools-hero h1 { font-size:24px; }
    .tools-stat-grid,.report-quick-grid { grid-template-columns:1fr; }
    .report-monthly-box { grid-column:auto; }
    .month-report-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .reports-head,.report-monthly-top,.tools-list-heading { align-items:flex-start; flex-direction:column; }
    .tools-admin-toolbar { grid-template-columns:1fr; }
    .tools-sync-note { grid-column:auto; }
    .tool-metrics { grid-template-columns:repeat(2,1fr); }
    .tool-status-form { grid-template-columns:1fr; }
    .tool-admin-actions { align-items:stretch; flex-direction:column; }
    .tool-admin-links { display:grid; grid-template-columns:1fr 1fr; }
    .tool-admin-actions form,.tool-admin-actions button { width:100%; }
    .activity-head-actions { justify-content:flex-start; }
}

/* v7 readability and article studio */
.tool-admin-card-head p,.tool-admin-desc,.tools-list-heading p,.tools-sync-note { font-size:11px; line-height:1.55; }
.tool-admin-card-head p code { font-size:10px; }
.tool-admin-title-row h2 { font-size:16px; line-height:1.35; }
.tool-metrics span { font-size:9px; letter-spacing:.055em; }
.tool-metrics strong { font-size:17px; }
.tool-admin-actions .btn-secondary,.tool-admin-actions button,.tool-status-form input { font-size:11px; }
.blog-studio-side { display:grid; gap:14px; }
.blog-studio-side .blog-guide { position:static; }
.blog-guide > p { margin:-7px 0 14px; color:#d6cbe7; font-size:11px; line-height:1.6; }
.article-choice-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.article-template-list,.blog-theme-list { display:grid; gap:8px; }
.article-template-card,.blog-theme-card { width:100%; border:1px solid rgba(255,255,255,.13); border-radius:12px; background:rgba(255,255,255,.055); color:#fff; text-align:left; cursor:pointer; transition:.16s ease; }
.article-template-card { padding:12px; }
.article-template-card span { display:block; font-size:12px; font-weight:850; }
.article-template-card small { display:block; margin-top:4px; color:#cfc3dd; font-size:9px; line-height:1.5; }
.article-template-card:hover,.article-template-card.is-selected,.blog-theme-card:hover,.blog-theme-card.is-selected { border-color:#ff9b5a; background:rgba(255,101,0,.14); box-shadow:0 0 0 2px rgba(255,101,0,.08); }
.blog-theme-card { display:grid; grid-template-columns:42px 1fr; align-items:center; gap:10px; padding:9px; }
.blog-theme-card > i { width:42px; height:42px; border-radius:10px; background:linear-gradient(135deg,var(--theme-base) 0 67%,var(--theme-accent) 67%); box-shadow:inset 0 0 0 1px rgba(255,255,255,.12); }
.blog-theme-card span,.blog-theme-card b,.blog-theme-card small { display:block; }
.blog-theme-card b { font-size:11px; }
.blog-theme-card small { margin-top:3px; color:#cfc3dd; font-size:8px; line-height:1.4; }
.article-meta-pills { display:flex; flex-wrap:wrap; gap:5px; margin:8px 0; }
.article-meta-pills span,.table-pill { display:inline-flex; align-items:center; min-height:22px; padding:0 8px; border:1px solid #e4deed; border-radius:99px; background:#f8f5fc; color:#675d72; font-size:8px; font-weight:800; }
.pdf-audit-panel { margin-top:16px; padding:19px; }
.pdf-audit-stats { display:flex; gap:7px; }
.pdf-audit-stats span { min-width:72px; padding:8px 10px; border:1px solid #e8e2ef; border-radius:11px; color:#8a8290; font-size:8px; text-align:center; }
.pdf-audit-stats b { display:block; margin-bottom:2px; color:var(--ink); font-size:17px; }
.admin-table-wrap { width:100%; overflow:auto; border:1px solid #ece7f1; border-radius:13px; }
.admin-table { width:100%; border-collapse:collapse; background:#fff; }
.admin-table th { padding:10px 12px; background:#f8f6fa; color:#827989; font-size:8px; letter-spacing:.06em; text-align:left; text-transform:uppercase; }
.admin-table td { min-width:155px; padding:12px; border-top:1px solid #eeeaf2; color:#534b59; font-size:10px; vertical-align:top; }
.admin-table td:first-child { min-width:240px; }
.admin-table td strong,.admin-table td small { display:block; }
.admin-table td strong { font-size:11px; }
.admin-table td small { margin-top:4px; color:#948c99; font-size:8px; }
.admin-table code { padding:3px 6px; border-radius:6px; background:#f3f0f6; color:#4f4657; font-size:9px; }
.empty-table { padding:25px; color:#968e9c; text-align:center; }
@media (max-width:900px) { .article-choice-grid { grid-template-columns:1fr; } .pdf-audit-panel .section-title-row { align-items:flex-start; flex-direction:column; } }
@media (max-width:560px) { .pdf-audit-stats { width:100%; } .pdf-audit-stats span { flex:1; min-width:0; } }
