/* ==========================================================================
   Jobika Mail — Jobika design system applied to Roundcube (Elastic skin)
   Rules are prefixed with "html:root body" so they win over Elastic's own
   light and dark-mode selectors without !important.
   ========================================================================== */

:root{
  --bg:#ffffff; --panel:#f6f8fa; --panel-2:#fbfcfd;
  --ink:#0d1117; --ink-soft:#24292f; --muted:#57606a;
  --border:#d8dee4; --border-soft:#eaeef2;
  --brand:#0a7d54; --brand-ink:#065f40; --brand-soft:#e6f4ee;
  --ok:#1a7f37; --ok-soft:#e6f4ea;
  --warn:#9a6700; --warn-soft:#fff8e1;
  --bad:#cf222e; --bad-soft:#ffebe9;
  --info:#0969da; --info-soft:#e8f0fe;
  --mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace;
  --sans:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --shadow:0 1px 2px rgba(27,31,36,.06),0 3px 8px rgba(27,31,36,.04);
  --radius:12px;
}
html.dark-mode{
  --bg:#0d1117; --panel:#161b22; --panel-2:#1c2128;
  --ink:#e6edf3; --ink-soft:#c9d1d9; --muted:#8b949e;
  --border:#30363d; --border-soft:#21262d;
  --brand:#3fb950; --brand-ink:#56d364; --brand-soft:#132d1c;
  --ok:#3fb950; --ok-soft:#12261a;
  --warn:#d29922; --warn-soft:#2b2410;
  --bad:#f85149; --bad-soft:#2d1315;
  --info:#58a6ff; --info-soft:#12233b;
  --shadow:0 1px 2px rgba(0,0,0,.4);
}

/* ------------------------------------------------------------------ base */
html:root body{font-family:var(--sans);color:var(--ink);background:var(--bg);-webkit-font-smoothing:antialiased}
html:root body, html:root body input, html:root body select, html:root body textarea,
html:root body button, html:root body .btn, html:root body .form-control{font-family:var(--sans)}
html:root body a{color:var(--brand)}
html:root body ::selection{background:var(--brand-soft);color:var(--ink)}

/* ------------------------------------------------------- left task menu */
html:root body #layout-menu{background:var(--panel);border-right:1px solid var(--border)}
html:root body #layout-menu .popover-header{background:var(--panel)}
html:root body #layout-menu #logo{width:40px;height:40px;max-height:40px;object-fit:contain;padding:0;margin:9px auto}
html:root body #taskmenu a{color:var(--ink-soft);border-radius:9px;margin:2px 8px;font-weight:500;font-size:12.5px}
html:root body #taskmenu a:before{color:var(--muted)}
html:root body #taskmenu a:hover,html:root body #taskmenu a:focus{background:var(--border-soft);color:var(--ink)}
html:root body #taskmenu a.selected{background:var(--brand-soft);color:var(--brand);font-weight:600}
html:root body #taskmenu a.selected:before{color:var(--brand)}
html:root body #taskmenu a.compose{color:#fff;background:var(--brand);margin:8px 8px 10px}
html:root body #taskmenu a.compose:before{color:#fff}
html:root body #taskmenu a.compose:hover{filter:brightness(1.08);background:var(--brand)}
html:root body #taskmenu a.compose.disabled{opacity:.5}
html:root body #taskmenu .special-buttons a.logout,
html:root body #taskmenu .special-buttons a.logout:before{color:var(--bad)}
html:root body #taskmenu .special-buttons{padding-top:6px;background:transparent}
html:root body .floating-action-buttons a.button,html:root body .floating-action-buttons button{
  background:var(--brand);color:#fff;box-shadow:0 4px 14px color-mix(in srgb,var(--brand) 35%,transparent)}
html:root body .floating-action-buttons a.button:before{color:#fff}
html:root body #taskmenu .special-buttons a{color:var(--ink-soft)}
html:root body #taskmenu .special-buttons a:before{color:var(--muted)}
html:root body #layout-menu .popover-header,html:root body #layout-menu #logo{background:var(--panel) !important}
html:root body #taskmenu a.compose{margin:8px 8px 10px;width:auto}

/* --------------------------------------------------- columns and headers */
html:root body #layout-sidebar,html:root body #layout-list,html:root body #layout-content{
  background:var(--bg);border-color:var(--border)}
html:root body #layout-sidebar{background:var(--panel-2)}
html:root body .header,html:root body .header-title,html:root body .footer{
  background:var(--bg);color:var(--ink);border-color:var(--border)}
html:root body #layout-sidebar .header{background:var(--panel-2)}
html:root body .header .header-title{font-weight:700;letter-spacing:-.01em}
html:root body .footer{border-top:1px solid var(--border)}

/* ---------------------------------------------------------------- toolbar */
html:root body .toolbar a.button,html:root body .toolbar a.button:before,
html:root body .toolbar .dropbutton:after{color:var(--ink-soft)}
html:root body .toolbar a.button{border-radius:9px}
html:root body .toolbar a.button:not(.disabled):hover,
html:root body .toolbar a.button:not(.disabled):hover:before{color:var(--brand);background:var(--brand-soft)}
html:root body .toolbar a.button.disabled,html:root body .toolbar a.button.disabled:before{color:var(--muted);opacity:.45}

/* ------------------------------------------------------------ folder list */
html:root body .listing li{border-color:var(--border-soft)}
html:root body #folderlist-content .listing li a,html:root body .listing li a{color:var(--ink-soft)}
html:root body .listing li a:before{color:var(--muted)}
html:root body #layout-sidebar .listing li{border:0}
html:root body #layout-sidebar .listing li a{border-radius:8px;margin:1px 8px;font-weight:500}
html:root body #layout-sidebar .listing li:not(.selected) a:hover{background:var(--border-soft)}
html:root body .listing li.selected,html:root body .listing li.selected > a,
html:root body .listing li.selected > div > a{background-color:var(--brand-soft);color:var(--brand)}
html:root body #layout-sidebar .listing li.selected{background:transparent}
html:root body #layout-sidebar .listing li.selected > a{font-weight:600}
html:root body .listing li.selected > a:before{color:var(--brand)}
html:root body .listing li .unreadcount,html:root body .listing li .unreadcount.recent{
  background:var(--brand);color:#fff;border-radius:99px;font-weight:700;font-size:11px}
html:root body .listing li.selected .unreadcount{background:var(--brand);color:#fff}
html:root body #folderlist-header,html:root body .listing li.unread > a{font-weight:700}

/* ----------------------------------------------------------- message list */
html:root body table.records-table{background:var(--bg)}
html:root body table.records-table tr td{border-color:var(--border-soft);color:var(--ink-soft)}
html:root body table.records-table tbody tr:hover td{background:var(--panel-2)}
html:root body table.records-table tr.selected td,
html:root body table.records-table tr.selected:hover td{background-color:var(--brand-soft);color:var(--ink)}
html:root body table.listing tbody tr td{border-color:var(--border-soft);color:var(--ink-soft)}
html:root body table.listing tbody tr:hover td{background-color:var(--panel-2)}
html:root body table.listing tbody tr.selected td,html:root body table.records-table tbody tr.selected td,
html:root body table.listing tbody tr.selected:hover td{background-color:var(--brand-soft) !important;color:var(--ink) !important}
html:root body table.listing tbody tr.selected td.subject span.subject a,
html:root body table.listing tbody tr.selected td a{color:var(--ink) !important}
html:root body table.listing tbody tr.focused td.subject,html:root body table.listing tbody tr.selected td.subject{
  box-shadow:inset 3px 0 0 var(--brand)}
html:root body table.listing tbody tr.focused,html:root body table.listing tbody tr.selected{outline:0}
html:root body table.messagelist td.subject a,html:root body table.messagelist td span.subject a,
html:root body table.messagelist td.subject span.subject a{color:var(--ink-soft)}
html:root body table.messagelist tr.unread td.subject a,html:root body table.messagelist tr.unread td span.subject a{color:var(--ink)}
html:root body table.messagelist tr.unread td .subject a,html:root body table.messagelist tr.unread td span.subject{
  color:var(--ink);font-weight:700}
html:root body table.messagelist td span.fromto,html:root body table.messagelist td .fromto{color:var(--muted)}
html:root body table.messagelist tr.unread td .fromto{color:var(--ink-soft);font-weight:600}
html:root body table.messagelist td span.date,html:root body table.messagelist td .date{color:var(--muted);font-size:12px}
html:root body table.messagelist tr.flagged td,html:root body table.messagelist tr.flagged td a{color:var(--bad)}
html:root body table.messagelist td.subject span.msgicon.status:before,
html:root body table.messagelist tr.unread td span.msgicon.status:before{color:var(--brand)}
html:root body table.messagelist td.flags span.flag:before{color:var(--bad)}

/* ----------------------------------------------------------------- search */
html:root body .searchbar,html:root body .searchbar input{background:var(--bg);color:var(--ink)}
html:root body .searchbar{border-bottom:1px solid var(--border)}
html:root body .searchbar:before,html:root body .searchbar a.button:before{color:var(--muted)}
html:root body .pagenav a.button,html:root body .pagenav a.button:before{color:var(--ink-soft)}
html:root body .pagenav .pagenav-text{color:var(--muted)}
html:root body .pagenav input{border-color:var(--border);border-radius:7px}

/* ----------------------------------------------------------- forms/inputs */
html:root body .form-control,html:root body input.form-control,html:root body select.custom-select,
html:root body input[type=text],html:root body input[type=email],html:root body input[type=password],
html:root body input[type=search],html:root body input[type=number],html:root body textarea{
  background-color:var(--bg);color:var(--ink);border:1px solid var(--border);border-radius:9px}
html:root body .form-control:focus,html:root body input:focus,html:root body select:focus,
html:root body textarea:focus,html:root body .recipient-input.focus{
  border-color:var(--brand);box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 18%,transparent);outline:none}
html:root body .input-group-text{background:var(--panel);border-color:var(--border);color:var(--muted)}
html:root body .input-group > .form-control:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}
html:root body .input-group > .input-group-prepend > .input-group-text{border-radius:9px 0 0 9px}
html:root body .input-group > .form-control:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}
html:root body .input-group > .input-group-append > .input-group-text,
html:root body .input-group > .input-group-append > a{border-radius:0 9px 9px 0}
html:root body .custom-switch .custom-control-input:checked ~ .custom-control-label:before{
  background-color:var(--brand);border-color:var(--brand)}
html:root body input[type=checkbox],html:root body input[type=radio]{accent-color:var(--brand)}

/* ---------------------------------------------------------------- buttons */
html:root body .btn{border-radius:9px;font-weight:600;font-size:14px}
html:root body .btn-primary,html:root body .btn.btn-primary,html:root body .button.mainaction,
html:root body button.mainaction,html:root body .formbuttons .btn-primary{
  background:var(--brand);border-color:var(--brand);color:#fff}
html:root body .btn-primary:hover,html:root body .btn-primary:focus,html:root body .btn-primary:active,
html:root body button.mainaction:hover{background:var(--brand);border-color:var(--brand);filter:brightness(1.08);color:#fff}
html:root body .btn-primary:focus{box-shadow:0 0 0 3px color-mix(in srgb,var(--brand) 25%,transparent)}
html:root body .btn-secondary,html:root body .btn.btn-secondary{
  background:transparent;color:var(--ink);border:1px solid var(--border)}
html:root body .btn-secondary:hover{background:var(--panel);color:var(--ink);border-color:var(--border)}
html:root body .btn-danger{background:var(--bad);border-color:var(--bad)}

/* ----------------------------------------------- popups, dialogs, notices */
html:root body .popover,html:root body .ui-dialog,html:root body .popupmenu{
  background:var(--bg);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow)}
html:root body .popover-body .listing li a,html:root body .popover .menu a{color:var(--ink-soft)}
html:root body .popover .menu a:hover,html:root body .popover-body .listing li a.active:hover{background:var(--brand-soft);color:var(--brand)}
html:root body .ui-dialog .ui-dialog-titlebar{background:var(--panel-2);border-bottom:1px solid var(--border);border-radius:var(--radius) var(--radius) 0 0}
html:root body .ui-dialog .ui-dialog-buttonpane{background:var(--panel-2);border-top:1px solid var(--border)}
html:root body #messagestack div{border-radius:9px;box-shadow:var(--shadow)}
html:root body #messagestack div.confirmation{background:var(--ok-soft);color:var(--ok);border:1px solid var(--ok)}
html:root body #messagestack div.error{background:var(--bad-soft);color:var(--bad);border:1px solid var(--bad)}
html:root body #messagestack div.warning{background:var(--warn-soft);color:var(--warn);border:1px solid var(--warn)}
html:root body #messagestack div.notice,html:root body #messagestack div.loading{background:var(--info-soft);color:var(--info);border:1px solid var(--info)}
html:root body .boxinformation,html:root body .ui.alert-info{background:var(--info-soft);border-color:var(--info);border-radius:9px}

/* --------------------------------------------------------- message view */
html:root body #messagecontent,html:root body #message-header,html:root body .message-partheaders{background:var(--bg)}
html:root body #message-header .subject,html:root body #message-header h2.subject{color:var(--ink);font-weight:700;letter-spacing:-.02em}
html:root body #message-header .header-links a,html:root body #message-header .header a{color:var(--brand)}
html:root body #message-header .header,html:root body #message-header .short-header{color:var(--muted)}
html:root body #message-header{border-bottom:1px solid var(--border-soft)}
html:root body #messagebody{color:var(--ink)}
html:root body div.message-part blockquote{border-left:3px solid var(--brand);color:var(--muted)}
html:root body #attachment-list li,html:root body .attachmentslist li{border:1px solid var(--border);border-radius:9px;background:var(--panel)}

/* Jobika origin banners (from the jobika_origin plugin) */
html:root body .jobika-note{border:1px solid var(--border);border-left-width:3px;border-radius:9px;
  padding:11px 15px;margin:0 0 14px;font-size:13.5px;line-height:1.5;color:var(--ink)}
html:root body .jobika-note,html:root body .jobika-note > div{display:block;float:none;width:auto}
html:root body .jobika-note .t{margin-bottom:3px}
html:root body .jobika-note .d{color:var(--ink-soft)}
html:root body .jobika-note .from{color:var(--muted);font-weight:400}
html:root body .jobika-note.internal{background:var(--ok-soft);border-color:var(--ok)}
html:root body .jobika-note.internal strong{color:var(--ok)}
html:root body .jobika-note.external{background:var(--warn-soft);border-color:var(--warn)}
html:root body .jobika-note.external strong{color:var(--warn)}
html:root body .jobika-note.suspicious{background:var(--bad-soft);border-color:var(--bad)}
html:root body .jobika-note.suspicious strong{color:var(--bad)}

/* --------------------------------------------------------------- compose */
html:root body #compose-headers .form-group label,html:root body #compose-options label,
html:root body .formcontent label{color:var(--muted);font-weight:600;font-size:13.5px}
html:root body .recipient-input{border-radius:9px;border-color:var(--border);background:var(--bg)}
html:root body .recipient-input input,html:root body .recipient-input input:focus{
  border:0 !important;box-shadow:none !important;background:transparent !important}
html:root body .recipient-input li.recipient{background:var(--brand-soft);border:1px solid color-mix(in srgb,var(--brand) 25%,transparent);
  color:var(--ink);border-radius:99px}
html:root body .recipient-input li.recipient a.button:before{color:var(--muted)}
html:root body #compose-attachments .attachmentslist li{background:var(--panel)}

/* ------------------------------------------------------- settings/contacts */
html:root body .formcontent fieldset,html:root body fieldset{border-color:var(--border);border-radius:var(--radius)}
html:root body legend{color:var(--muted);font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.04em}
html:root body .propform td.title,html:root body table.propform td.title{color:var(--muted)}
html:root body .tab-content,html:root body .nav-tabs{border-color:var(--border)}
html:root body .nav-tabs .nav-link.active{color:var(--brand);border-color:var(--border) var(--border) var(--bg);background:var(--bg)}
html:root body .nav-tabs .nav-link{color:var(--muted)}
html:root body .quota-widget .bar{background:var(--border-soft);border-radius:99px}
html:root body .quota-widget .bar .value{background:var(--brand);border-radius:99px}

/* ------------------------------------------------------------- login page */
html:root body.task-login,html:root body.task-logout,html:root body.task-error{background:var(--panel)}
html:root body.task-login #layout,html:root body.task-login #layout-content{background:var(--panel)}
html:root body.task-login #layout-content{display:flex;flex-direction:column;align-items:center;justify-content:center;
  min-height:100vh;height:auto;padding:24px 20px 112px;box-sizing:border-box;overflow-y:auto}
/* bottom padding = logo (72px) + its gap (16px) + top padding, so the card itself sits at the exact centre */
/* Elastic nudges these with position:relative + top offsets; reset so the pair is truly centred. */
html:root body.task-login #layout-content > #logo,
html:root body.task-login #login-form{position:static;top:auto;left:auto;transform:none}
html:root body.task-login #layout-content > #logo{display:block;width:72px;height:72px;max-width:none;max-height:none;
  margin:0 0 16px;object-fit:contain}
html:root body.task-login #login-form{width:100%;max-width:404px;background:var(--bg);border:1px solid var(--border);
  border-radius:16px;padding:32px;box-shadow:var(--shadow);margin:0}
html:root body.task-login #login-form:before{content:"Sign in to Jobika Mail";display:block;text-align:center;
  font-size:22px;font-weight:700;letter-spacing:-.02em;line-height:1.2;color:var(--ink);margin:0 0 6px}
html:root body.task-login #login-form:after{content:"Use the email address and password given to you by your administrator.";
  display:block;text-align:center;font-size:13px;line-height:1.5;color:var(--muted);margin:18px 0 0}
html:root body.task-login #login-form table,html:root body.task-login #login-form table td{border:0;background:transparent}
html:root body.task-login #login-form table{margin-top:22px;width:100%}
html:root body.task-login #login-form .input-group-text{background:var(--panel)}
html:root body.task-login #login-form input.form-control{padding:10px 12px;height:auto;font-size:14.5px}
html:root body.task-login #rcmloginsubmit{width:100%;padding:11px;border-radius:9px;font-size:14.5px;
  text-transform:none !important;letter-spacing:0;background:var(--brand);border-color:var(--brand);color:#fff;margin-top:8px}
html:root body.task-login #rcmloginsubmit:hover{filter:brightness(1.08)}
html:root body.task-login #login-footer{display:none}

/* ------------------------------------------------------------ mobile/touch */
@media (max-width:480px){
  html:root body.task-login #login-form{padding:24px 20px;border-radius:14px}
  html:root body.task-login #login-form:before{font-size:19px}
}
@media print{html:root body{background:#fff;color:#000}}
