@import url('https://fonts.googleapis.com/css2?family=Google+Sans+Flex:wght@400;500;600;700;800&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.7.2/css/all.min.css');
:root{--terra:#b45b43;--terra2:#95452f;--bg:#f8f6f4;--line:#e8e0da;--ink:#302a25;--muted:#837a72}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:'Google Sans Flex',Arial,sans-serif;font-size:14px}a{color:inherit;text-decoration:none}button,input,select{font:inherit}button{cursor:pointer}.layout{display:flex;min-height:100vh}.sidebar{width:248px;flex-shrink:0;background:#fff;border-right:1px solid var(--line);display:flex;flex-direction:column;padding:24px 15px;gap:32px}.brand{display:flex;align-items:center;gap:12px;font-size:22px;font-weight:800}.brandmark{width:45px;height:45px;background:var(--terra);color:white;border-radius:12px;display:grid;place-items:center}.brand small{display:block;color:var(--muted);font-size:12px;font-weight:500}.nav{display:grid;gap:6px}.nav a{display:block;padding:12px 14px;border-radius:8px;font-weight:600;color:#70655d}.nav a:hover{background:#faeee8;color:var(--terra2)}.nav a i{width:24px}.sidebottom{margin-top:auto;border-top:1px solid var(--line);padding-top:18px;color:var(--muted);font-size:12px}.main{flex:1;min-width:0;display:flex;flex-direction:column}.main>header{height:76px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 33px;font-weight:700}.user{display:flex;align-items:center;gap:17px}.logout{border:1px solid var(--line);background:white;padding:9px 12px;border-radius:6px}.main>main{flex:1;width:100%;max-width:1350px;margin:0 auto;padding:32px}.main>footer{text-align:center;padding:20px;color:var(--muted);border-top:1px solid var(--line);font-size:12px}.pagehead{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px;gap:18px}.pagehead h1{margin:0;font-size:27px}.pagehead p{color:var(--muted);margin:6px 0 0}.card,.stat{background:#fff;border:1px solid var(--line);border-radius:12px;padding:23px}.card h2{font-size:18px;margin:0 0 19px}.card h1{font-size:25px;margin:0 0 10px}.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:15px;margin-bottom:20px}.stat span{color:var(--muted);font-size:13px}.stat strong{display:block;font-size:29px;margin-top:15px}.grid2{display:grid;grid-template-columns:1fr 1fr;gap:18px}.fileline{padding:14px 0;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:15px}.fileline small{display:block}.pill{border-radius:100px;padding:5px 9px;background:#faeee7;color:var(--terra2);font-size:12px}.muted{font-size:13px;color:var(--muted);line-height:1.6}.btn{border:0;border-radius:5px;padding:11px 17px;background:var(--terra);color:#fff;font-weight:700;display:inline-block}.btn:hover{background:var(--terra2)}.btn.secondary{background:#f6ede8;color:#93503b}.btn.danger,.icon.danger{background:#fff0ee;color:#a83b30}.buttonrow{display:flex;gap:12px;margin-top:20px}.authbox{width:min(430px,calc(100% - 32px));margin:9vh auto}.authbox .brand{margin-bottom:24px}.authbox .card{padding:30px}.authbox .center{text-align:center}.authbox button{margin-top:20px}form label{display:block;font-weight:700;margin:17px 0 6px;font-size:13px}input:not([type=hidden]):not([type=checkbox]),select{border:1px solid #ded6d0;border-radius:6px;padding:11px 12px;width:100%;outline-color:var(--terra);background:white}input[type=file]{cursor:pointer}.card form>.btn{margin-top:20px}.scroll{overflow:auto}.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:18px}.toolbar input{max-width:330px}.toolbar select{max-width:175px}table{width:100%;min-width:760px;text-align:left;border-collapse:collapse}th{background:#faf8f6;text-transform:uppercase;font-size:11px;color:var(--muted);letter-spacing:.04em}th,td{border-bottom:1px solid #eee9e5;padding:14px 12px}td small{display:block}td.actions{white-space:nowrap}.actions a,.actions .icon{display:inline-grid;place-items:center;border:1px solid var(--line);border-radius:6px;width:34px;height:34px;background:white;color:var(--terra2);margin-right:4px;vertical-align:middle}.actions form{display:inline}.actions .icon.danger{color:#a83b30}.flash,.notice{padding:15px;background:#f7ece6;color:#80402d;border-radius:8px;margin-bottom:18px;overflow-wrap:anywhere}.flash.error{background:#fff1ee;color:#a43127}.break{display:block;overflow-wrap:anywhere;margin-top:12px}.code{background:#f6f2ee;padding:16px;white-space:pre-wrap;border-radius:9px;overflow-wrap:anywhere}.custom-days[hidden]{display:none}.custom-days{border-left:3px solid var(--terra);padding-left:14px}.custom-days input{max-width:125px}input.day-number{max-width:120px}select.expiry{max-width:100%}
@media(max-width:950px){.sidebar{width:72px;padding:15px 8px}.sidebar .brand span,.sidebottom{display:none}.sidebar .nav a{font-size:0;text-align:center}.sidebar .nav a i{font-size:18px}.stats{grid-template-columns:repeat(2,1fr)}.grid2{grid-template-columns:1fr}}@media(max-width:600px){.sidebar{width:55px}.main>header{height:68px;padding:0 13px}.main>main{padding:16px}.card,.stat{padding:16px}.stats{gap:9px}.stat strong{font-size:23px}.pagehead{flex-direction:column;align-items:flex-start}.user{gap:9px}.brandmark{width:39px;height:39px}}

/* Guia da API para Hermes */
.api-guide-card{margin-top:20px}.api-guide-head{display:flex;justify-content:space-between;align-items:flex-start;flex-wrap:wrap;gap:16px}.api-guide-head .btn{flex-shrink:0}.api-guide{white-space:pre-wrap;overflow-wrap:anywhere;max-height:550px;overflow:auto;padding:18px;margin:14px 0 18px;border:1px solid var(--line);border-radius:8px;background:rgba(0,0,0,.035);font-size:12px;line-height:1.65;user-select:text}.api-guide-card .notice{margin-top:14px}.card code{overflow-wrap:anywhere}

/* Tokens da API: revelacao autenticada */
.token-list-item{border-bottom:1px solid var(--line);padding:14px 0}
.token-list-item:last-child{border-bottom:0}
.token-list-top,.token-actions{display:flex;align-items:center;gap:10px}
.token-list-top{justify-content:space-between;flex-wrap:wrap}
.token-date{display:block;margin-top:4px}
.token-eye-details{position:relative}
.token-eye-btn{display:inline-grid;place-items:center;width:38px;height:38px;border:1px solid var(--line);border-radius:6px;background:#fff;color:var(--terra2);cursor:pointer;list-style:none}
.token-eye-btn::-webkit-details-marker{display:none}
.token-eye-btn:hover{background:#f8efea}
.token-eye-panel{position:absolute;right:0;top:43px;z-index:5;width:min(330px,80vw);padding:16px;border:1px solid var(--line);border-radius:8px;box-shadow:0 10px 28px rgba(0,0,0,.15);background:#fff}
.token-eye-panel form{display:grid;gap:10px}
.token-eye-panel p{margin:0 0 10px}
.token-box{padding:12px;overflow-wrap:anywhere;word-break:break-all;border:1px solid var(--line);border-radius:6px;background:#f8f6f4;margin:12px 0}
.token-reveal-card{max-width:780px}

/* Acoes de tokens v2.0 */
.token-delete-form{display:inline-flex;margin:0}
.token-delete-btn{display:inline-grid;place-items:center;width:38px;height:38px;border:1px solid #ead1ce;border-radius:6px;background:#fff2f1;color:#a83b30;cursor:pointer}
.token-delete-btn:hover,.token-delete-btn:focus-visible{background:#fbdedb;color:#8b2d24}
.token-actions{display:flex;align-items:center;gap:8px}

/* Token list: linhas horizontais, responsivas e com acoes alinhadas */
.token-list-card{min-width:0}
.token-list-heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin-bottom:8px}
.token-list-heading h2{margin:0}
.token-count{font-size:12px;white-space:nowrap}
.token-list-card .token-list-item{display:block;width:100%;padding:14px 0;margin:0;border-bottom:1px solid var(--line)}
.token-list-card .token-list-item:last-child{border-bottom:0;padding-bottom:0}
.token-list-card .token-list-top{display:flex;flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:nowrap;width:100%;min-width:0;gap:16px}
.token-list-card .token-info{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:3px;min-width:0;flex:1 1 auto}
.token-list-card .token-info strong{display:block;font-size:14px;font-weight:650;line-height:1.35;overflow-wrap:anywhere}
.token-list-card .token-date{display:block;margin:0;font-size:12px;line-height:1.45;color:var(--muted)}
.token-list-card .token-actions{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;flex-wrap:nowrap;flex:0 0 auto;gap:8px}
.token-list-card .token-eye-details{position:relative;display:block;flex:0 0 auto;margin:0;padding:0}
.token-list-card .token-eye-btn,.token-list-card .token-delete-btn{display:inline-flex;align-items:center;justify-content:center;flex:0 0 38px;width:38px;height:38px;border-radius:6px;padding:0;line-height:1;font-size:15px;appearance:none;vertical-align:middle}
.token-list-card .token-eye-btn{list-style:none}
.token-list-card .token-eye-btn::marker{content:""}
.token-list-card .token-eye-btn::-webkit-details-marker{display:none}
.token-list-card .token-delete-form{display:flex;align-items:center;flex:0 0 auto;width:38px;margin:0;padding:0}
.token-list-card .token-eye-panel{right:0;left:auto;top:44px;width:min(330px,80vw)}
.token-list-card .token-eye-panel form{display:grid;gap:10px}
.token-list-card .token-eye-panel input{min-width:0;width:100%}
@media(max-width:600px){
 .token-list-card .token-list-top{gap:10px}
 .token-list-card .token-list-item{padding:12px 0}
 .token-list-card .token-eye-btn,.token-list-card .token-delete-btn{width:36px;height:36px;flex-basis:36px}
 .token-list-card .token-delete-form{width:36px}
 .token-list-card .token-actions{gap:6px}
}

/* v2.3 - tema claro/escuro, aplicado no documento inteiro */
:root{color-scheme:light;--surface:#fff;--surface-alt:#faf8f6;--field:#fff;--field-border:#ded6d0;--nav-ink:#70655d;--nav-hover:#faeee8;--soft:#f6ede8;--soft-ink:#93503b;--table-line:#eee9e5;--shadow:rgba(0,0,0,.15)}
:root[data-theme="dark"]{
 color-scheme:dark;
 --terra:#d27b61;--terra2:#eea38b;
 --bg:#111820;--surface:#1b2530;--surface-alt:#222f3b;
 --field:#18222c;--field-border:#425161;
 --line:#344351;--ink:#edf2f6;--muted:#a9b8c7;
 --nav-ink:#b7c6d3;--nav-hover:#2a3946;
 --soft:#3a302e;--soft-ink:#f1b39d;
 --table-line:#35434f;--shadow:rgba(0,0,0,.48);
}
:root[data-theme="dark"] body{background:var(--bg);color:var(--ink)}
.sidebar,.main>header,.card,.stat{background:var(--surface);color:var(--ink)}
.sidebar,.main>header,.card,.stat,.main>footer{border-color:var(--line)}
.nav a{color:var(--nav-ink)}
.nav a:hover{background:var(--nav-hover);color:var(--terra2)}
.logout,.theme-toggle{border:1px solid var(--line);background:var(--surface);color:var(--ink);border-radius:6px;display:inline-flex;align-items:center;justify-content:center;width:40px;height:38px;flex-shrink:0;cursor:pointer}
.logout:hover,.theme-toggle:hover{background:var(--surface-alt)}
.theme-toggle:focus-visible,.logout:focus-visible{outline:2px solid var(--terra);outline-offset:2px}
.theme-toggle .theme-icon-sun{display:none}
:root[data-theme="dark"] .theme-toggle .theme-icon-moon{display:none}
:root[data-theme="dark"] .theme-toggle .theme-icon-sun{display:inline}
:root[data-theme="dark"] .brandmark{color:#111820}
:root[data-theme="dark"] .pill{background:#3c3230;color:#f4b59f}
:root[data-theme="dark"] .btn{color:#111820}
:root[data-theme="dark"] .btn.secondary{background:#35404a;color:#f0c3b1}
:root[data-theme="dark"] .btn.danger,:root[data-theme="dark"] .icon.danger{background:#482d31;color:#ffb6b1}
:root[data-theme="dark"] input:not([type=hidden]):not([type=checkbox]),:root[data-theme="dark"] select,:root[data-theme="dark"] textarea{
 background:var(--field);border-color:var(--field-border);color:var(--ink);color-scheme:dark
}
:root[data-theme="dark"] input::placeholder,:root[data-theme="dark"] textarea::placeholder{color:#98a7b6}
:root[data-theme="dark"] input[type=file]::file-selector-button{background:#344351;color:#edf2f6;border:1px solid #52616e;border-radius:5px;padding:6px 9px;margin-right:10px}
:root[data-theme="dark"] th{background:var(--surface-alt);color:var(--muted)}
:root[data-theme="dark"] td,:root[data-theme="dark"] th,:root[data-theme="dark"] .fileline{border-color:var(--table-line)}
:root[data-theme="dark"] .actions a,:root[data-theme="dark"] .actions .icon{background:var(--surface-alt);color:var(--terra2);border-color:var(--line)}
:root[data-theme="dark"] .actions .icon.danger{background:#482d31;color:#ffb6b1}
:root[data-theme="dark"] .flash,:root[data-theme="dark"] .notice{background:#3b302d;color:#f6c9b8}
:root[data-theme="dark"] .flash.error{background:#4b2c31;color:#ffc4bc}
:root[data-theme="dark"] .code,:root[data-theme="dark"] .api-guide,:root[data-theme="dark"] .token-box{background:var(--surface-alt);color:var(--ink);border-color:var(--line)}
:root[data-theme="dark"] .token-eye-btn{background:var(--surface-alt);border-color:var(--line);color:var(--terra2)}
:root[data-theme="dark"] .token-eye-btn:hover{background:#344451}
:root[data-theme="dark"] .token-eye-panel{background:var(--surface);border-color:var(--line);box-shadow:0 10px 28px var(--shadow)}
:root[data-theme="dark"] .token-delete-btn{background:#432b31;color:#ffc0ba;border-color:#6d444a}
:root[data-theme="dark"] .token-delete-btn:hover{background:#61353b;color:#fff}
:root[data-theme="dark"] .authbox .card{background:var(--surface)}
:root[data-theme="dark"] a:focus-visible,:root[data-theme="dark"] button:focus-visible{outline-color:var(--terra)}
@media(max-width:600px){.theme-toggle,.logout{width:36px;height:36px}.user{gap:8px}}
