/* Giao diện SpringWood Mail theo phong cách Gmail (sáng, bo tròn, nhiều khoảng trắng).
   Đổi màu thương hiệu ở 3 biến dưới đây rồi chạy lại cai-webmail.sh. */
:root { --sw: #7a4a21; --sw-dark: #5c3718; --sw-soft: #f3e8dd; --sw-bg: #f6f8fc; }

html:not(.dark-mode) body, html:not(.dark-mode) #layout { background: var(--sw-bg) !important; }
html:not(.dark-mode) body { font-family: "Google Sans", "Segoe UI", Roboto, Arial, sans-serif; }

/* ---------- Thanh bên trái: nền trắng, logo rõ ---------- */
html:not(.dark-mode) #layout-menu { background: #fff !important; border-right: 1px solid #e3e6ea !important; }
html:not(.dark-mode) #layout-menu .popover-header { background: #fff !important; border-bottom: 1px solid #eef0f3; }
#layout-menu .popover-header img, #layout-menu .logo img, #layout-menu img#logo {
  display: block; width: 100% !important; height: auto !important; max-height: 64px;
  object-fit: contain; padding: 8px 6px; background: #fff;
}
html:not(.dark-mode) #taskmenu a {
  color: #444746 !important; border-bottom: 0 !important; border-radius: 14px; margin: 3px 4px;
  box-sizing: border-box; width: calc(100% - 8px) !important; padding: .4rem 0 !important;
  font-size: .72rem !important; line-height: 1.2 !important; height: auto !important;
}
/* Biểu tượng nhỏ lại cho cân đối với chữ */
html:not(.dark-mode) #taskmenu a:before, html:not(.dark-mode) #taskmenu a .inner:before, html:not(.dark-mode) #taskmenu a > span:before {
  font-size: 1.05rem !important; line-height: 1.4 !important;
}
html:not(.dark-mode) #taskmenu a span.inner { font-size: .72rem !important; }
html:not(.dark-mode) #taskmenu a:hover { background: #eef0f3 !important; }
html:not(.dark-mode) #taskmenu a.selected { background: var(--sw-soft) !important; color: var(--sw-dark) !important; font-weight: 600; }
html:not(.dark-mode) #taskmenu .special-buttons { background: #fff !important; }
html:not(.dark-mode) #taskmenu .special-buttons a:not(:focus) { background: transparent !important; }
html:not(.dark-mode) #taskmenu a.logout, html:not(.dark-mode) #taskmenu a.logout:hover { color: #c5221f !important; }

/* Nút Soạn thư: viên thuốc màu thương hiệu như Gmail */
html:not(.dark-mode) #taskmenu .action-buttons a, html:not(.dark-mode) #taskmenu a.compose {
  background: var(--sw) !important; color: #fff !important; border-radius: 16px; margin: 10px 4px 8px;
  box-shadow: 0 1px 3px rgba(60, 64, 67, .3);
}
html:not(.dark-mode) #taskmenu .action-buttons a:hover { background: var(--sw-dark) !important; color: #fff !important; }

/* ---------- Danh sách thư mục ---------- */
html:not(.dark-mode) #layout-sidebar { background: var(--sw-bg) !important; border-right: 0 !important; }
html:not(.dark-mode) ul.treelist li.mailbox > a { border-radius: 0 16px 16px 0; margin-right: 8px; }
html:not(.dark-mode) ul.treelist li.selected > a, html:not(.dark-mode) ul.treelist li.selected > div > a {
  background: var(--sw-soft) !important; color: var(--sw-dark) !important; font-weight: 700;
}
html:not(.dark-mode) ul.treelist li > a:hover { background: #eaecf0; }
.badge.unreadcount, span.unreadcount { background: transparent !important; color: var(--sw-dark) !important; font-weight: 700; }

/* ---------- Khung giữa và nội dung: thẻ trắng bo góc ---------- */
html:not(.dark-mode) #layout-list, html:not(.dark-mode) #layout-content {
  background: #fff !important; border: 0 !important;
}
html:not(.dark-mode) #layout > div > .header {
  background: var(--sw-bg) !important; border-bottom: 0 !important; color: #444746; min-height: 56px;
}
html:not(.dark-mode) #layout-list .header, html:not(.dark-mode) #layout-content .header { background: #fff !important; border-bottom: 1px solid #eef0f3 !important; }
html:not(.dark-mode) .header a.button.icon:not(.disabled):hover, html:not(.dark-mode) .header a.button:not(.disabled):hover { background: #eef0f3 !important; border-radius: 12px; }
html:not(.dark-mode) .header a.button:not(.disabled), html:not(.dark-mode) .toolbar a.button:not(.disabled) { color: #444746; }

/* Hàng thư */
table.messagelist td { border-bottom: 1px solid #f1f3f4 !important; }
table.messagelist tr:hover td { background: #f2f6fc !important; box-shadow: inset 0 -1px 0 #e3e6ea; }
table.messagelist tr.selected td, table.messagelist tr.focused td { background: var(--sw-soft) !important; color: var(--sw-dark) !important; }
table.messagelist tr.unread td, table.messagelist tr.unread td a { font-weight: 700; color: #1f1f1f; }

/* Ô tìm kiếm bo tròn như Gmail */
.searchbar input, .searchbar input[type=text], #mailsearchform { border-radius: 24px !important; background: #eaf1fb !important; border: 0 !important; }
.searchbar input:focus { background: #fff !important; box-shadow: 0 1px 4px rgba(60, 64, 67, .3); }

/* Nút, liên kết, hộp thoại */
html .btn-primary, html .btn.btn-primary, html a.button.mainaction, html .formbuttons .btn.mainaction,
body.task-login #login-form button[type=submit] { background: var(--sw) !important; border-color: var(--sw) !important; color: #fff !important; border-radius: 20px; }
html .btn-primary:hover, html a.button.mainaction:hover { background: var(--sw-dark) !important; }
a { color: var(--sw); }
html .ui-dialog { border-radius: 16px; overflow: hidden; }
.popover, .popupmenu { border-radius: 12px !important; }

/* ---------- Trang đăng nhập ---------- */
body.task-login { background: linear-gradient(160deg, var(--sw-soft), #fff 60%) !important; }
body.task-login #logo { max-height: 110px !important; width: auto !important; margin-bottom: 8px; }
body.task-login form { background: #fff; border-radius: 16px; box-shadow: 0 2px 12px rgba(60, 64, 67, .15); padding: 24px 24px 8px; }
