:root {
  --ebms-red: #b71c1c;
  --ebms-header: #7a1515;
  --ebms-tile-icon: #37474f;
  --ebms-border: #bdbdbd;
  --ebms-company: #90a4ae;
}

.ebms-app {
  min-height: 100vh;
  background: #fff;
  font-family: Roboto, Nunito, sans-serif;
}

.ebms-header {
  background: var(--ebms-header);
  color: #fff;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
}

.ebms-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ebms-header-back {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  line-height: 1;
  padding: 4px 8px 4px 0;
  cursor: pointer;
}

.ebms-header-title {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.ebms-header-home-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}

.ebms-header-user {
  font-size: 14px;
  opacity: 0.95;
}

.ebms-content {
  padding: 12px;
}

.ebms-tile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

@media (max-width: 576px) {
  .ebms-tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  .ebms-tile-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    max-width: 900px;
  }
}

.ebms-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 110px;
  padding: 12px 8px;
  background: #fff;
  border: 1px solid var(--ebms-border);
  border-radius: 2px;
  color: #212121;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.ebms-tile:hover {
  background: #fafafa;
  color: #212121;
}

.ebms-tile i {
  font-size: 40px;
  color: var(--ebms-tile-icon);
  margin-bottom: 10px;
}

.ebms-tile span {
  font-size: 13px;
  text-align: center;
  line-height: 1.25;
}

.ebms-login {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: #fff;
}

.ebms-login-logo {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--ebms-red);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 28px;
  margin-bottom: 12px;
}

.ebms-login h1 {
  font-size: 18px;
  font-weight: 700;
  color: #1565c0;
  text-align: center;
  margin-bottom: 4px;
}

.ebms-login-tagline {
  font-size: 12px;
  color: var(--ebms-gray-text, #757575);
  text-align: center;
  margin-bottom: 24px;
  max-width: 280px;
}

.ebms-login-company {
  color: var(--ebms-company);
  font-size: 14px;
  text-align: center;
  margin-bottom: 16px;
}

.ebms-login-form {
  width: 100%;
  max-width: 320px;
}

.ebms-login-form input {
  width: 100%;
  border: none;
  border-bottom: 1px solid #ccc;
  padding: 10px 0;
  margin-bottom: 16px;
  font-size: 15px;
  outline: none;
}

.ebms-login-form input:focus {
  border-bottom-color: var(--ebms-red);
}

.ebms-login-error {
  color: var(--ebms-red);
  font-size: 13px;
  margin-bottom: 12px;
  text-align: center;
}

.ebms-login-btn {
  width: 100%;
  background: var(--ebms-red);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.ebms-login-btn:disabled {
  opacity: 0.7;
}

.ebms-login-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 12px;
  color: #9e9e9e;
}

/* Hide legacy sidebar layout when EBMS shell is active */
.ebms-app ~ .vertical-menu,
.ebms-app .vertical-menu,
body.ebms-mode .vertical-menu,
body.ebms-mode .navbar-header,
body.ebms-mode #page-topbar,
body.ebms-mode .footer,
body.ebms-mode .top-header {
  display: none !important;
}

body.ebms-mode .main-content {
  margin-left: 0 !important;
  margin-top: 0 !important;
}

body.ebms-mode .page-content {
  margin-top: 0 !important;
  padding: 0 !important;
}

body.ebms-mode .container-fluid {
  padding: 0 !important;
  max-width: 100%;
}

.ebms-page-content {
  padding: 12px 16px 24px;
}
