*{box-sizing:border-box}
:root{--bg:#f6f8fc;--surface:#fff;--text:#202124;--muted:#5f6368;--line:#e4e7eb;--hover:#eef3f8;--active:#d3e3fd;--accent:#0b57d0;--shadow:0 1px 2px rgba(0,0,0,.08)}
body{margin:0;font-family:Arial,Helvetica,sans-serif;color:var(--text);background:var(--bg);font-size:14px}
button,input{font:inherit}
button{border:0;background:none;color:inherit}
.topbar{height:64px;display:grid;grid-template-columns:48px 220px minmax(280px,720px) 1fr;align-items:center;gap:8px;padding:8px 16px;background:var(--bg)}
.icon-btn{width:40px;height:40px;border-radius:50%;cursor:pointer;font-size:18px}
.icon-btn:hover{background:#e7eaee}
.brand{display:flex;align-items:center;gap:10px;font-size:20px;color:#5f6368}
.brand-mark,.login-logo{display:grid;place-items:center;background:#111827;color:white;font-weight:700}
.brand-mark{width:34px;height:34px;border-radius:9px}
.search{height:48px;border-radius:24px;background:#eaf1fb;display:flex;align-items:center;padding:0 18px;gap:12px}
.search input{border:0;outline:0;background:transparent;width:100%;font-size:16px;color:var(--text)}
.top-actions{justify-self:end;display:flex;align-items:center;gap:4px}
.avatar{width:36px;height:36px;border-radius:50%;background:#23395d;color:white;font-weight:700;cursor:pointer}
.app-shell{display:grid;grid-template-columns:256px 1fr;min-height:calc(100vh - 64px)}
.sidebar{padding:8px 14px 20px;display:flex;flex-direction:column;min-height:calc(100vh - 64px)}
.compose{width:142px;height:56px;border-radius:16px;background:#c2e7ff;display:flex;gap:12px;align-items:center;justify-content:center;font-weight:600;cursor:pointer;margin-bottom:14px;box-shadow:var(--shadow)}
.compose:hover{box-shadow:0 2px 6px rgba(0,0,0,.18)}
.nav-item{display:grid;grid-template-columns:28px 1fr auto;align-items:center;height:32px;border-radius:16px;padding:0 12px;color:var(--text);text-decoration:none}
.nav-item:hover{background:#e7eaee}
.nav-item.active{background:var(--active)}
.labels-title{display:flex;justify-content:space-between;align-items:center;padding:24px 12px 8px;font-weight:700}
.dot{width:10px;height:10px;border-radius:50%;background:#68758a}
.sidebar-footer{margin-top:auto;padding:16px 12px;color:var(--muted);display:grid;gap:6px}
.sidebar-footer a{color:var(--accent);text-decoration:none}
.mail-pane{margin-right:16px;background:var(--surface);border-radius:16px 16px 0 0;overflow:hidden}
.toolbar{height:48px;display:flex;align-items:center;justify-content:space-between;padding:0 16px;border-bottom:1px solid #f0f1f3}
.checkbox-btn{font-size:19px;margin-right:4px}
.pager{font-size:12px;color:var(--muted)}
.tabs{height:56px;display:flex;border-bottom:1px solid var(--line)}
.tab{min-width:180px;padding:0 20px;text-align:left;color:var(--muted);cursor:pointer;position:relative}
.tab.active{color:var(--accent);font-weight:700}
.tab.active:after{content:"";height:3px;border-radius:3px;background:var(--accent);position:absolute;left:12px;right:12px;bottom:0}
.message-row{display:grid;grid-template-columns:36px 36px 190px minmax(0,1fr) 72px;align-items:center;height:42px;padding:0 12px;border-bottom:1px solid #eceff2;background:#f8fafd;cursor:pointer}
.message-row:hover{box-shadow:inset 0 1px 0 #dadce0,inset 0 -1px 0 #dadce0,0 2px 4px rgba(0,0,0,.12);position:relative;z-index:1}
.message-row.unread{background:white;font-weight:700}
.message-row .subject{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.message-row .subject span{font-weight:400;color:var(--muted)}
.message-row time{text-align:right;font-size:12px}
.security-note{position:fixed;right:18px;bottom:16px;background:#202124;color:#fff;padding:9px 13px;border-radius:8px;font-size:12px;box-shadow:0 4px 16px rgba(0,0,0,.24)}
.login-page{min-height:100vh;display:grid;place-items:center;background:#f4f7fb}
.login-card{width:min(420px,calc(100vw - 32px));background:white;border:1px solid #dfe3e8;border-radius:24px;padding:36px;box-shadow:0 12px 36px rgba(15,23,42,.08)}
.login-logo{width:52px;height:52px;border-radius:14px;margin-bottom:20px;font-size:24px}
.login-card h1{margin:0 0 8px;font-size:28px}
.login-card p{color:var(--muted);margin:0 0 28px}
.login-card form{display:grid;gap:16px}
.login-card label{display:grid;gap:7px;font-size:13px;color:#454b55}
.login-card input{height:48px;border:1px solid #c8cdd4;border-radius:10px;padding:0 13px;outline:none}
.login-card input:focus{border-color:var(--accent);box-shadow:0 0 0 3px rgba(11,87,208,.12)}
.primary-btn{height:48px;border-radius:24px;background:var(--accent);color:white;font-weight:700;cursor:pointer}
.login-card small{display:block;margin-top:20px;color:var(--muted)}
.alert{background:#fce8e6;color:#b3261e;border-radius:10px;padding:12px;margin-bottom:16px}
@media(max-width:900px){
  .topbar{grid-template-columns:40px 1fr auto}.brand{font-size:18px}.search{grid-column:1/-1;grid-row:2;height:44px}.topbar{height:116px}
  .app-shell{grid-template-columns:76px 1fr;min-height:calc(100vh - 116px)}
  .sidebar{min-height:calc(100vh - 116px);padding:8px}.compose{width:56px}.compose span,.nav-item span:not(:first-child),.nav-item strong,.nav-item b,.labels-title,.sidebar-footer{display:none}
  .nav-item{grid-template-columns:1fr;text-align:center;padding:0}
  .mail-pane{margin-right:8px}
  .message-row{grid-template-columns:30px 30px 120px minmax(0,1fr) 58px}
  .tabs .tab{min-width:130px}
}
@media(max-width:620px){
  .app-shell{display:block}.sidebar{display:none}.mail-pane{margin:0;border-radius:0}
  .message-row{grid-template-columns:28px 28px 105px minmax(0,1fr) 48px;padding:0 7px}
  .message-row .subject span{display:none}
  .tabs{overflow-x:auto}.security-note{display:none}
}
