/* ============================================================
   AIAdKing Mail — PostfixAdmin custom theme (loaded after bootstrap.css)
   Upgrade-safe: no template edits; enabled via $CONF['theme_custom_css'].
   ============================================================ */
:root{
  --brand1:#0f766e; --brand2:#2563eb; --accent:#b7791f;
  --grad:linear-gradient(135deg,#0f766e 0%,#2563eb 100%);
  --ink:#18212f; --muted:#657386; --line:#dfe7f0; --bg:#f3f6f9; --card:#fff;
  --radius:8px; --shadow:0 1px 2px rgba(16,24,40,.05),0 18px 42px -30px rgba(16,24,40,.34);
}

/* ---- base ---- */
html,body{background:var(--bg)!important;color:var(--ink)!important;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Inter,"Helvetica Neue",Arial,sans-serif!important;
  -webkit-font-smoothing:antialiased;font-size:14px;line-height:1.5;}
*,*::before,*::after{box-sizing:border-box;}
body{padding-top:78px!important;}
.container{max-width:1180px;}
body.aiak-admin .container[role="main"]{
  width:auto!important;
  min-width:0!important;
  max-width:1240px!important;
  padding-left:22px;
  padding-right:22px;
}
a{color:var(--brand1);text-decoration:none;}
a:hover,a:focus{color:var(--brand2);text-decoration:none;}
hr{border-top:1px solid var(--line);}

/* ---- navbar ---- */
.navbar-default,.navbar-default.navbar-fixed-top,.navbar-default.fixed-top{
  background:rgba(255,255,255,.96)!important;border:0!important;border-bottom:1px solid #e3eaf2!important;border-radius:0!important;
  box-shadow:0 10px 30px -24px rgba(15,23,42,.42);min-height:64px;margin-bottom:28px;backdrop-filter:saturate(180%) blur(12px);}
.navbar-default.navbar-fixed-top,.navbar-default.fixed-top{
  position:fixed;
  top:0;
  right:0;
  left:0;
  z-index:1030;
}
.navbar-header{min-height:62px;}
.navbar-brand{height:62px;display:flex;align-items:center;gap:10px;
  color:#111827!important;font-weight:800;font-size:19px;letter-spacing:0;padding:0 20px 0 15px!important;}
.navbar-brand img{display:none!important;}
.navbar-brand::before{content:"";width:28px;height:28px;flex:0 0 28px;border-radius:8px;
  background:#0f766e url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m22 7-10 6L2 7'/%3E%3C/svg%3E") center/17px no-repeat;}
.navbar-brand::after{content:"AIAdKing Mail";}
.navbar-default .navbar-nav>li>a{color:#425166!important;font-weight:650;
  padding:20px 14px;transition:.15s;}
.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus,
.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,
.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>li.active-page>a{color:#0f766e!important;background:#ecfdf5!important;}
.navbar-default .navbar-nav>li>a .caret{border-top-color:#64748b;}
.navbar-toggle{border-color:#cbd5e1!important;margin-top:14px;}
.navbar-toggle .icon-bar{background:#334155!important;}

/* right-side action buttons (password / backup / logout / setup) */
.navbar-right .btn,.navbar-nav.navbar-right>li>a.btn{
  background:#f8fafc!important;border:1px solid #cbd5e1!important;
  color:#334155!important;border-radius:8px;font-weight:700;margin:14px 3px;padding:6px 13px;}
.navbar-right .btn:hover,.navbar-right .btn:focus{
  background:#ecfdf5!important;color:#0f766e!important;border-color:#99f6e4!important;}

/* ---- dropdown menus ---- */
.dropdown-menu{border:1px solid var(--line);border-radius:11px;box-shadow:var(--shadow);
  padding:6px;margin-top:8px;min-width:214px;}
.dropdown-menu>li>a{border-radius:8px;padding:9px 12px;color:#334155;font-weight:500;}
.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{background:#eef2ff;color:var(--brand1);}

/* ---- headings ---- */
h1,h2,h3,.h2,.h3{color:#0f172a;font-weight:700;}
h2,.h2{font-size:22px;margin:6px 0 20px;}

/* ---- cards / wells / panels ---- */
.well,.panel{background:var(--card)!important;border:1px solid var(--line)!important;
  border-radius:var(--radius)!important;box-shadow:var(--shadow)!important;padding:22px 24px;}
.panel{padding:0;overflow:hidden;}
.panel-heading{background:#f8fafc!important;border-bottom:1px solid var(--line)!important;
  color:#0f172a;font-weight:600;padding:14px 20px;}
.panel-body{padding:20px 22px;}

/* ---- tables ---- */
.table{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);
  border-collapse:separate!important;border-spacing:0;overflow:hidden;
  box-shadow:var(--shadow);margin-bottom:26px;}
.table>thead>tr>th{background:#f8fafc;color:#64748b;font-weight:600;font-size:11.5px;
  text-transform:uppercase;letter-spacing:.6px;border-bottom:1px solid var(--line)!important;
  border-top:0!important;padding:12px 16px;vertical-align:middle;}
.table>tbody>tr>td{padding:12px 16px;border-top:1px solid #eef2f8!important;vertical-align:middle;color:#334155;}
.table>tbody>tr:first-child>td{border-top:0!important;}
.table>tbody>tr:hover{background:#f6f9ff;}
.table-striped>tbody>tr:nth-of-type(odd){background:#fbfcff;}
.table-striped>tbody>tr:hover{background:#f2f6ff;}
.table a{font-weight:500;}

/* ---- buttons ---- */
.btn{border-radius:8px;font-weight:500;padding:7px 15px;border:1px solid transparent;transition:.15s;}
.btn-lg{padding:11px 22px;font-size:16px;border-radius:10px;}
.btn-sm{padding:4px 11px;font-size:12.5px;border-radius:7px;}
.btn-xs{border-radius:6px;}
.btn-primary{background:var(--grad);border:0;color:#fff;box-shadow:0 1px 2px rgba(79,70,229,.45);}
.btn-primary:hover,.btn-primary:focus,.btn-primary:active{filter:brightness(1.07);color:#fff;box-shadow:0 6px 16px rgba(79,70,229,.4);}
.btn-default{background:#fff;border:1px solid #cbd5e1;color:#334155;}
.btn-default:hover,.btn-default:focus{background:#f8fafc;border-color:#94a3b8;color:#0f172a;}
.btn-success{background:#059669;border:0;color:#fff;}
.btn-success:hover{background:#047857;color:#fff;}
.btn-danger{background:#e11d48;border:0;color:#fff;}
.btn-danger:hover{background:#be123c;color:#fff;}
.btn-info{background:#0284c7;border:0;color:#fff;}
.btn-info:hover{background:#0369a1;color:#fff;}
.btn-warning{background:#d97706;border:0;color:#fff;}

/* ---- forms ---- */
label,.control-label{font-weight:600;color:#334155;}
.form-control{border:1px solid #cbd5e1;border-radius:8px;box-shadow:none;height:auto;
  padding:9px 12px;color:#1e293b;transition:.15s;}
.form-control:focus{border-color:var(--brand1);box-shadow:0 0 0 3px rgba(79,70,229,.15);}
select.form-control{height:auto;}
.input-group-addon{border-radius:8px;border:1px solid #cbd5e1;background:#f8fafc;}

/* ---- alerts / flash ---- */
.alert{border-radius:10px;border:1px solid transparent;padding:12px 16px;box-shadow:var(--shadow);}
.alert-success{background:#ecfdf5;border-color:#a7f3d0;color:#065f46;}
.alert-danger,.alert-error,div.error{background:#fef2f2;border-color:#fecaca;color:#991b1b;
  border-radius:10px;padding:12px 16px;}
.alert-info{background:#eff6ff;border-color:#bfdbfe;color:#1e40af;}
.alert-warning{background:#fffbeb;border-color:#fde68a;color:#92400e;}

/* ---- pagination ---- */
.pagination>li>a,.pagination>li>span{color:var(--brand1);border-color:var(--line);}
.pagination>.active>a,.pagination>.active>span{background:var(--brand1);border-color:var(--brand1);}

/* ---- login page ---- */
body.page-login{background:linear-gradient(160deg,#e9edff 0%,#f6f8fc 55%)!important;}
body.page-login #login{max-width:430px;margin:26px auto 0;}
body.page-login #login>h2,body.page-login #login .h2{text-align:center;margin-bottom:18px;font-size:24px;}
body.page-login .well{padding:28px 30px;}
body.page-login .form-signin .btn-primary,body.page-login .form-signin .btn-lg{width:100%;}

/* ---- footer ---- */
.footer{margin-top:44px;padding:18px 0;border-top:1px solid var(--line);color:#94a3b8;font-size:12.5px;}
.footer a{color:#94a3b8;}
.footer a:hover{color:var(--brand1);}

/* ---- global admin shell ---- */
.aiak-admin .panel,
.aiak-admin .well{
  border-radius:8px!important;
}
.aiak-admin .panel-heading h4,
.aiak-admin .panel-heading h3{
  margin:0;
  font-size:18px;
  line-height:1.35;
  font-weight:800;
}
.aiak-admin .panel-footer{
  background:#f8fafc!important;
  border-top:1px solid #e7edf4!important;
  padding:14px 18px;
}
.aiak-admin .btn-toolbar{
  display:flex;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:8px;
}
.aiak-admin .btn-group{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.aiak-admin .btn-group.pull-right{
  float:none!important;
  margin-left:auto;
}
.aiak-admin .form-horizontal .form-group{
  margin-left:0;
  margin-right:0;
  padding:6px 0;
}
.aiak-admin .help-block{
  color:#718096;
  font-size:12.5px;
  margin:7px 0 0;
}
.aiak-admin .has-error .form-control{
  border-color:#f43f5e;
  box-shadow:0 0 0 3px rgba(244,63,94,.12);
}
.aiak-admin .has-error .help-block{
  color:#be123c;
  font-weight:650;
}
.aiak-admin .checkbox label{
  min-height:28px;
  display:inline-flex;
  align-items:center;
}
.aiak-admin input[type="checkbox"]{
  width:16px;
  height:16px;
  margin-top:0;
}
.aiak-admin select.form-control{
  min-height:40px;
}
.aiak-admin textarea.form-control{
  min-height:116px;
}
.searchparams{
  background:#fff7ed;
  border:1px solid #fed7aa;
  color:#9a3412;
  border-radius:8px;
  margin:14px 18px;
  padding:10px 12px;
}
.searchparams p{
  margin:0;
}
.searchparams span{
  display:inline-flex;
  margin:3px 5px;
  padding:3px 7px;
  background:#ffedd5;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
}

/* ---- login ---- */
body.page-login{
  min-height:100vh;
  background:
    linear-gradient(180deg,#f8fafc 0%,#eef6f4 52%,#f4f7fb 100%)!important;
}
body.page-login .container[role="main"]{
  width:100%!important;
  max-width:none!important;
  padding-left:18px;
  padding-right:18px;
}
.login-navbar .container{
  max-width:1120px;
}
.login-shell{
  max-width:1120px!important;
  width:100%!important;
  min-width:0!important;
  margin:34px auto 0!important;
}
.login-card{
  display:grid;
  grid-template-columns:minmax(0,1fr) 420px;
  overflow:hidden;
  min-height:520px;
  background:#fff;
  border:1px solid #dfe7f0;
  border-radius:10px;
  box-shadow:0 26px 70px -46px rgba(15,23,42,.55);
}
.login-intro{
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  padding:44px;
  color:#fff;
  background:
    linear-gradient(135deg,rgba(15,118,110,.94),rgba(37,99,235,.88)),
    repeating-linear-gradient(135deg,rgba(255,255,255,.12) 0,rgba(255,255,255,.12) 1px,transparent 1px,transparent 18px);
}
.login-intro .eyebrow{
  color:#ccfbf1;
}
.login-intro h1{
  margin:0;
  font-size:42px;
  line-height:1.05;
  color:#fff;
}
.login-intro p{
  max-width:520px;
  margin:14px 0 0;
  color:#e8fbff;
  font-size:16px;
}
.login-status-grid{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:26px;
}
.login-status-grid span{
  display:inline-flex;
  gap:7px;
  align-items:center;
  padding:8px 10px;
  border:1px solid rgba(255,255,255,.34);
  border-radius:8px;
  background:rgba(255,255,255,.12);
  color:#f8fafc;
}
.login-status-grid strong{
  color:#fff;
}
.form-signin{
  padding:42px 38px;
  align-self:center;
}
.form-signin h2{
  margin:0 0 22px;
  font-size:24px;
  font-weight:850;
}
.login-actions .btn{
  width:100%;
}
.login-alt{
  margin-top:18px;
  text-align:center;
}

/* ---- dashboard ---- */
.admin-home{
  margin:8px 0 42px;
}
.admin-home-hero{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:24px;
  margin:8px 0 20px;
}
.admin-home-hero h1{
  margin:0;
  font-size:34px;
  line-height:1.1;
  font-weight:850;
}
.admin-home-hero p{
  margin:10px 0 0;
  color:#657386;
  font-size:15px;
}
.home-status{
  display:flex;
  flex-wrap:wrap;
  justify-content:flex-end;
  gap:9px;
}
.home-status span{
  padding:8px 11px;
  border:1px solid #d8e2ec;
  border-radius:8px;
  background:#fff;
  color:#64748b;
  box-shadow:0 10px 28px -24px rgba(15,23,42,.38);
}
.home-status strong{
  color:#18212f;
}
.home-action-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:16px;
}
.home-action-card{
  min-height:184px;
  display:flex;
  flex-direction:column;
  gap:11px;
  padding:22px;
  border:1px solid #dfe7f0;
  border-radius:8px;
  background:#fff;
  color:#253246;
  box-shadow:0 18px 44px -34px rgba(15,23,42,.46);
  transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease;
}
.home-action-card:hover,
.home-action-card:focus{
  transform:translateY(-2px);
  border-color:#99f6e4;
  color:#253246;
  box-shadow:0 22px 50px -32px rgba(15,118,110,.48);
}
.action-icon{
  width:42px;
  height:42px;
  border-radius:8px;
  background:#ecfdf5;
  border:1px solid #b6f1df;
  position:relative;
}
.action-icon::before{
  content:"";
  position:absolute;
  inset:11px;
  background:#0f766e;
  mask:center/contain no-repeat;
  -webkit-mask:center/contain no-repeat;
}
.action-overview::before{mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h8v8H3zM13 3h8v5h-8zM13 10h8v11h-8zM3 13h8v8H3z'/%3E%3C/svg%3E");-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h8v8H3zM13 3h8v5h-8zM13 10h8v11h-8zM3 13h8v8H3z'/%3E%3C/svg%3E");}
.action-mailbox::before{mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 5h20v14H2zM2 7l10 7 10-7'/%3E%3C/svg%3E");-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 5h20v14H2zM2 7l10 7 10-7'/%3E%3C/svg%3E");}
.action-alias::before{mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7h10v4h4L12 20 3 11h4zM7 3h10v3H7z'/%3E%3C/svg%3E");-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7h10v4h4L12 20 3 11h4zM7 3h10v3H7z'/%3E%3C/svg%3E");}
.action-send::before{mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 21 23 12 2 3l4 8 9 1-9 1z'/%3E%3C/svg%3E");-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 21 23 12 2 3l4 8 9 1-9 1z'/%3E%3C/svg%3E");}
.action-password::before{mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 11V8a5 5 0 0 1 10 0v3h1v10H6V11zm3 0h4V8a2 2 0 0 0-4 0z'/%3E%3C/svg%3E");-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 11V8a5 5 0 0 1 10 0v3h1v10H6V11zm3 0h4V8a2 2 0 0 0-4 0z'/%3E%3C/svg%3E");}
.action-log::before{mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h14v18H5zM8 7h8v2H8zM8 11h8v2H8zM8 15h5v2H8z'/%3E%3C/svg%3E");-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 3h14v18H5zM8 7h8v2H8zM8 11h8v2H8zM8 15h5v2H8z'/%3E%3C/svg%3E");}
.action-title{
  color:#111827;
  font-size:18px;
  line-height:1.25;
  font-weight:850;
}
.action-copy{
  color:#66768a;
  line-height:1.55;
}

/* ---- data tables ---- */
.table-commandbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:0 0 10px;
  padding:10px;
  background:#fff;
  border:1px solid #dfe7f0;
  border-radius:8px;
  box-shadow:0 12px 34px -30px rgba(15,23,42,.44);
}
.table-count{
  color:#64748b;
  font-size:12px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.05em;
}
.table-filter{
  max-width:280px;
  min-height:36px;
}
.aiak-admin .table{
  width:100%!important;
}
.aiak-admin .table thead th{
  position:static;
}
.aiak-admin .table>tbody>tr>td .btn,
.aiak-admin .table>tbody>tr>td form .btn{
  white-space:nowrap;
}
.aiak-admin .table form{
  margin:0;
}
.aiak-admin .glyphicon{
  display:none;
}
.admin-list-panel{
  overflow:hidden;
}
.list-panel-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:18px 18px 14px;
  background:#fff;
  border-bottom:1px solid #edf2f7;
}
.list-panel-title h2{
  margin:0;
  color:#111827;
  font-size:20px;
  line-height:1.25;
  font-weight:850;
}
.list-panel-title span{
  display:inline-flex;
  min-height:30px;
  align-items:center;
  padding:5px 10px;
  border-radius:999px;
  background:#f8fafc;
  border:1px solid #dbe5ee;
  color:#64748b;
  font-size:12px;
  font-weight:850;
}
.list-native-search{
  padding:14px 18px 0;
}
.list-native-search form,
.list-native-search .form-inline{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}
.admin-data-table tbody tr:last-child td{
  border-bottom:0;
}
.table-actions{
  width:1%;
  white-space:nowrap;
}
.primary-cell{
  min-width:220px;
}
.entity-link{
  display:inline-flex;
  align-items:center;
  gap:10px;
  color:#111827!important;
  font-weight:800!important;
}
.entity-link:hover,
.entity-link:focus{
  color:#0f766e!important;
}
.entity-icon{
  width:34px;
  height:34px;
  flex:0 0 34px;
  border-radius:8px;
  background:#ecfdf5;
  border:1px solid #a7f3d0;
  position:relative;
}
.entity-icon::before{
  content:"";
  position:absolute;
  inset:8px;
  background:#0f766e;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 4h18v16H3zM5 8h14v2H5zM5 12h14v2H5zM5 16h8v2H5z'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 4h18v16H3zM5 8h14v2H5zM5 12h14v2H5zM5 16h8v2H5z'/%3E%3C/svg%3E") center/contain no-repeat;
}
.entity-link strong{
  display:block;
  font-size:14px;
  line-height:1.2;
}
.entity-link small{
  display:block;
  margin-top:2px;
  color:#64748b;
  font-size:11.5px;
  font-weight:700;
}
.btn-icon{
  display:inline-flex!important;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.btn-icon::before{
  content:"";
  width:15px;
  height:15px;
  flex:0 0 15px;
  background:currentColor;
  mask:center/contain no-repeat;
  -webkit-mask:center/contain no-repeat;
}
.btn-add::before{
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6z'/%3E%3C/svg%3E");
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6z'/%3E%3C/svg%3E");
}
.btn-download::before{
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 4h2v9l4-4 1.4 1.4L12 16.8 5.6 10.4 7 9l4 4zM5 19h14v2H5z'/%3E%3C/svg%3E");
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M11 4h2v9l4-4 1.4 1.4L12 16.8 5.6 10.4 7 9l4 4zM5 19h14v2H5z'/%3E%3C/svg%3E");
}
.btn-edit::before{
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 17.2V20h2.8L17.7 9.1l-2.8-2.8zM18.7 8.1 15.9 5.3 17.2 4a1 1 0 0 1 1.4 0l1.4 1.4a1 1 0 0 1 0 1.4z'/%3E%3C/svg%3E");
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 17.2V20h2.8L17.7 9.1l-2.8-2.8zM18.7 8.1 15.9 5.3 17.2 4a1 1 0 0 1 1.4 0l1.4 1.4a1 1 0 0 1 0 1.4z'/%3E%3C/svg%3E");
}
.btn-delete::before{
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 4h8l1 2h4v2H3V6h4zM6 10h12l-1 10H7z'/%3E%3C/svg%3E");
  -webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 4h8l1 2h4v2H3V6h4zM6 10h12l-1 10H7z'/%3E%3C/svg%3E");
}
.aiak-admin .active{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:4px 9px;
  border-radius:999px;
  background:#ecfdf5;
  color:#047857;
  font-weight:800;
}
.status-pill{
  display:inline-flex;
  align-items:center;
  min-height:28px;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:850;
  border:1px solid transparent;
}
.status-pill.is-on{
  background:#ecfdf5;
  color:#047857;
  border-color:#a7f3d0;
}
.status-pill.is-off{
  background:#fff7ed;
  color:#b45309;
  border-color:#fed7aa;
}
.empty-state{
  display:grid;
  place-items:center;
  gap:6px;
  min-height:116px;
  padding:22px;
  text-align:center;
  color:#64748b;
}
.empty-state strong{
  color:#18212f;
  font-size:16px;
}
.empty-row td{
  background:#fbfdff!important;
}
.searchresult{
  background:#fef08a;
  color:#713f12;
  border-radius:4px;
  padding:0 3px;
}
.quota-cell{
  min-width:132px;
}
.quota-meter{
  display:grid;
  gap:7px;
  align-items:center;
}
.quota_bg{
  width:120px;
  height:8px;
  border-radius:999px;
  background:#e2e8f0;
  overflow:hidden;
}
.quota{
  height:8px;
  border-radius:999px;
  max-width:120px;
}
.quota_low{background:#10b981;}
.quota_mid{background:#f59e0b;}
.quota_high{background:#ef4444;}
.quota_text{
  margin-top:6px;
  color:#475569;
  font-size:12px;
  font-weight:750;
}

/* ---- page-specific shared panels ---- */
#overview.panel .panel-heading form,
.panel-heading form{
  margin:0;
}
#overview.panel .panel-body .text-center ul{
  display:inline-flex;
  gap:10px;
  flex-wrap:wrap;
  list-style:none;
  margin:10px 0 0;
  padding:0;
}
#overview.panel .panel-body .text-center li{
  padding:7px 10px;
  border-radius:8px;
  background:#f8fafc;
  border:1px solid #e2e8f0;
  color:#475569;
  font-weight:750;
}
#overview.panel .panel-body .row .text-center a,
#overview.panel .panel-body .row .text-center .active{
  margin:3px;
}
.virtual-hero{
  display:flex;
  justify-content:space-between;
  gap:20px;
  margin:8px 0 18px;
}
.virtual-hero h1{
  margin:0;
  color:#111827;
  font-size:32px;
  line-height:1.1;
  font-weight:850;
}
.virtual-hero p{
  margin:8px 0 0;
  color:#657386;
}
.virtual-overview .panel-heading .row{
  display:flex;
  gap:16px;
  align-items:center;
}
.virtual-overview .panel-heading [class*="col-"]{
  float:none;
  width:auto;
  flex:1 1 0;
  margin-left:0;
}
.overview-summary h4{
  font-size:20px;
  font-weight:850;
}
.tab-switcher{
  display:flex;
  justify-content:center;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
}
.tab-switcher a{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:5px 10px;
  border:1px solid #dbe5ee;
  border-radius:999px;
  background:#fff;
  color:#0f766e;
  font-weight:800;
}
.mailbox-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.mailbox-count{
  display:inline-flex;
  align-items:center;
  min-height:30px;
  padding:5px 10px;
  border-radius:999px;
  background:#f8fafc;
  border:1px solid #dbe5ee;
  color:#475569;
  font-weight:850;
}
.mailbox-overview-panel #mailbox_table{
  margin-bottom:0;
  border-left:0;
  border-right:0;
  border-radius:0;
  box-shadow:none;
}
.edit-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.edit-heading .eyebrow{
  margin-bottom:5px;
}
.admin-edit-form{
  max-width:960px;
  margin:8px auto 42px;
}
.edit-field{
  border-bottom:1px solid #edf2f7;
}
.edit-field:last-child{
  border-bottom:0;
}
.sticky-form-footer{
  position:sticky;
  bottom:0;
  z-index:8;
  box-shadow:0 -12px 28px -24px rgba(15,23,42,.48);
}
.log-panel{
  overflow:hidden;
}
.log-summary h4{
  margin:0;
  font-weight:800;
}
.log-detail summary{
  cursor:pointer;
  color:#0f766e;
  font-weight:750;
}
.log-detail pre{
  margin:9px 0 0;
  padding:12px;
  border:1px solid #dfe7f0;
  border-radius:8px;
  background:#0f172a;
  color:#e5edf6;
  white-space:pre-wrap;
  word-break:break-word;
  font-size:12px;
  line-height:1.55;
}
.back-to-top{
  position:fixed;
  right:18px;
  bottom:18px;
  display:none;
  z-index:40;
  border:1px solid #cbd5e1;
  border-radius:999px;
  background:#fff;
  color:#334155;
  font-weight:800;
  padding:8px 12px;
  box-shadow:var(--shadow);
}
.back-to-top.is-visible{
  display:block;
}

@media (max-width: 1100px){
  .home-action-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .login-card{grid-template-columns:1fr;}
  .login-intro{min-height:280px;}
}
@media (max-width: 767px){
  html,body{width:100%;overflow-x:hidden;}
  body{padding-top:64px!important;}
  body.aiak-admin .container[role="main"]{padding-left:14px;padding-right:14px;}
  body.aiak-admin .container[role="main"],
  .mail-composer,
  .sendmail-grid,
  .composer-card,
  .sendmail-sidebar,
  .side-panel,
  .admin-home,
  .home-action-grid{
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  .navbar-header{position:relative;width:100%;}
  .navbar-brand{
    max-width:calc(100% - 68px);
    overflow:hidden;
    white-space:nowrap;
  }
  .navbar-toggle{
    display:block!important;
    position:absolute;
    right:10px;
    top:8px;
    margin:0!important;
    width:42px;
    height:42px;
    background:#fff!important;
    border-color:#cbd5e1!important;
    border-radius:8px;
  }
  .navbar-collapse{
    background:#fff;
    border-top:1px solid #e2e8f0;
    box-shadow:0 18px 32px -28px rgba(15,23,42,.45);
  }
  .navbar-default .navbar-nav>li>a{padding:11px 14px;}
  .navbar-nav.navbar-right>li>a.btn{margin:4px 12px 8px;}
  .login-shell{margin-top:18px!important;}
  .login-intro{padding:28px;min-height:240px;}
  .login-intro h1{font-size:34px;}
  .form-signin{padding:28px;}
  .admin-home-hero{display:block;}
  .home-status{justify-content:flex-start;margin-top:14px;}
  .home-action-grid{grid-template-columns:1fr;}
  .table-commandbar{display:block;}
  .table-filter{max-width:none;margin-top:8px;}
  .aiak-admin .table{
    display:block;
    overflow-x:auto;
  }
  .virtual-overview .panel-heading .row{display:block;}
  .virtual-overview .panel-heading [class*="col-"]+ [class*="col-"]{margin-top:10px;}
  .virtual-hero h1{font-size:28px;}
  .mailbox-heading{display:block;}
  .mailbox-count{margin-top:8px;}
  .aiak-admin .btn-toolbar,.aiak-admin .btn-group{display:grid;width:100%;}
  .aiak-admin .btn-group.pull-right{margin-left:0;}
  .sendmail-hero,
  .hero-copy,
  .section-title,
  .field-block,
  .field-block-wide{
    min-width:0;
    max-width:100%;
  }
  .sendmail-hero{
    overflow-wrap:anywhere;
  }
  .form-control,
  .quick-template,
  .preview-panel pre{
    max-width:100%;
  }
}

/* ---- send mail command center ---- */
body.page-sendmail{
  background:
    linear-gradient(180deg,#f4f7fb 0%,#eef3f8 48%,#f8fafc 100%)!important;
}
body.page-sendmail .container[role="main"]{
  width:auto!important;
  min-width:0!important;
  max-width:1240px!important;
  padding-left:22px;
  padding-right:22px;
}
.mail-composer{
  margin:8px 0 42px;
}
.sendmail-hero{
  display:flex;
  justify-content:space-between;
  gap:24px;
  align-items:flex-end;
  margin:6px 0 22px;
  padding:28px 0 8px;
}
.sendmail-hero .eyebrow,
.panel-kicker{
  margin:0 0 7px;
  font-size:11px;
  line-height:1.2;
  text-transform:uppercase;
  letter-spacing:.08em;
  color:#0f766e;
  font-weight:800;
}
.sendmail-hero h1{
  margin:0;
  color:#111827;
  font-size:34px;
  line-height:1.08;
  font-weight:800;
}
.hero-copy{
  margin:10px 0 0;
  color:#526174;
  font-size:15px;
}
.hero-metrics{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.hero-metrics span{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:42px;
  padding:9px 13px;
  background:#fff;
  border:1px solid #dbe3ee;
  border-radius:8px;
  color:#526174;
  box-shadow:0 8px 24px -18px rgba(15,23,42,.42);
}
.hero-metrics strong{
  color:#111827;
  font-size:20px;
  line-height:1;
}
.sendmail-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) 360px;
  gap:18px;
  align-items:start;
}
.composer-card,
.side-panel{
  background:#fff;
  border:1px solid #dbe3ee;
  border-radius:8px;
  box-shadow:0 18px 44px -32px rgba(15,23,42,.45);
}
.composer-card{
  overflow:hidden;
}
.composer-section{
  padding:24px;
  border-bottom:1px solid #e8edf4;
}
.composer-section:last-of-type{
  border-bottom:0;
}
.section-title{
  display:flex;
  align-items:flex-start;
  gap:12px;
  margin-bottom:18px;
}
.section-title h2,
.side-panel h2{
  margin:0;
  color:#111827;
  font-size:18px;
  line-height:1.25;
  font-weight:800;
}
.section-title p{
  margin:3px 0 0;
  color:#66768a;
}
.step-dot{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  flex:0 0 28px;
  border-radius:50%;
  background:#ecfdf5;
  color:#047857;
  font-weight:800;
  border:1px solid #a7f3d0;
}
.field-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:16px;
}
.field-block-wide{
  grid-column:1 / -1;
}
.field-block label,
.composer-section>label{
  display:block;
  margin:0 0 7px;
  color:#253246;
  font-size:13px;
  font-weight:750;
}
.field-meta{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-top:7px;
  color:#718096;
  font-size:12px;
}
.compact-textarea{
  min-height:86px;
  resize:vertical;
}
.subject-input{
  font-size:16px;
  font-weight:650;
}
.body-input{
  min-height:360px;
  resize:vertical;
  font-family:"SFMono-Regular",Consolas,"Liberation Mono",Menlo,monospace;
  font-size:13px;
  line-height:1.65;
}
.quick-row{
  display:flex;
  flex-wrap:wrap;
  gap:9px;
  margin:0 0 14px;
}
.quick-template{
  appearance:none;
  border:1px solid #cfd8e5;
  background:#f8fafc;
  color:#253246;
  border-radius:8px;
  padding:8px 12px;
  font-weight:700;
  line-height:1.2;
  transition:.15s;
}
.quick-template:hover,
.quick-template:focus{
  background:#ecfeff;
  border-color:#67e8f9;
  color:#155e75;
  outline:0;
}
.composer-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding:18px 24px;
  background:#f8fafc;
  border-top:1px solid #e8edf4;
}
.btn-send{
  min-width:148px;
}
.sendmail-sidebar{
  display:grid;
  gap:16px;
  position:sticky;
  top:88px;
}
.side-panel{
  padding:18px;
}
.preview-meta{
  display:grid;
  gap:4px;
  margin:12px 0 14px;
  color:#64748b;
  font-size:12.5px;
}
.preview-panel pre{
  min-height:260px;
  max-height:460px;
  overflow:auto;
  margin:0;
  padding:16px;
  border:1px solid #e1e7ef;
  border-radius:8px;
  background:#0f172a;
  color:#e5edf6;
  white-space:pre-wrap;
  word-break:break-word;
  font-family:"SFMono-Regular",Consolas,"Liberation Mono",Menlo,monospace;
  font-size:12.5px;
  line-height:1.6;
}
.delivery-list{
  list-style:none;
  padding:0;
  margin:12px 0 0;
  display:grid;
  gap:10px;
}
.delivery-list li{
  display:flex;
  align-items:center;
  gap:10px;
  color:#334155;
  font-weight:650;
}
.delivery-list li span{
  width:10px;
  height:10px;
  flex:0 0 10px;
  border-radius:50%;
  background:#10b981;
  box-shadow:0 0 0 4px #d1fae5;
}
.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  border:0;
}

@media (max-width: 991px){
  body.page-sendmail{padding-top:64px!important;}
  body.page-sendmail .container[role="main"]{padding-left:14px;padding-right:14px;}
  .sendmail-hero{display:block;padding-top:18px;}
  .sendmail-hero h1{font-size:28px;}
  .hero-metrics{justify-content:flex-start;margin-top:16px;}
  .sendmail-grid{grid-template-columns:1fr;}
  .sendmail-sidebar{position:static;}
}
@media (max-width: 640px){
  .field-grid{grid-template-columns:1fr;}
  .composer-section{padding:18px;}
  .composer-actions{padding:14px 18px;flex-direction:column-reverse;}
  .composer-actions .btn{width:100%;}
  .field-meta{display:block;}
  .field-meta span+span{display:block;margin-top:3px;}
}
