@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0');

:root {
  --bg: #f6f8fc;
  --panel: #ffffff;
  --line: #e4e7ee;
  --text: #1f2937;
  --muted: #5f6368;
  --brand: #0b57d0;
  --brand2: #d3e3fd;
  --hover: #f2f6fc;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Roboto', Arial, sans-serif; background: var(--bg); color: var(--text); overflow: hidden; }
a { text-decoration: none; color: inherit; }

/* CRITICAL FIX: Properly declare the Material Symbols font */
.material-symbols-outlined { 
  font-family: 'Material Symbols Outlined', sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  color: var(--muted); 
  cursor: pointer; 
  user-select: none; 
}

/* Topbar */
.topbar { height: 64px; display: flex; align-items: center; padding: 8px 24px; gap: 24px; background: var(--bg); }
.logo { font-size: 22px; font-weight: 500; color: var(--brand); display: flex; align-items: center; gap: 16px; min-width: 200px; }
.search-box { flex: 1; max-width: 720px; background: #eaf1fb; border-radius: 24px; display: flex; align-items: center; padding: 0 16px; gap: 12px; height: 48px; transition: background 0.2s, box-shadow 0.2s; }
.search-box:focus-within { background: #fff; box-shadow: 0 1px 3px 0 rgba(60,64,67,0.3); }
.search-box input { border: none; background: transparent; flex: 1; font-size: 16px; outline: none; }
.userchip { margin-left: auto; display: flex; align-items: center; gap: 12px; font-weight: 500; color: var(--muted); font-size: 14px; background: #fff; padding: 6px 16px; border-radius: 20px; border: 1px solid var(--line); }
.userchip a { display: flex; align-items: center; }

/* Shell Layout */
.shell { display: flex; height: calc(100vh - 64px); }
.side { width: 256px; padding: 8px 16px 8px 0; display: flex; flex-direction: column; gap: 16px; }

/* Compose Button */
.composeBtn { background: #c2e7ff; color: #001d35; border-radius: 16px; height: 56px; display: inline-flex; align-items: center; padding: 0 24px; gap: 16px; font-weight: 500; font-size: 15px; margin-left: 8px; width: fit-content; box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3); transition: box-shadow 0.2s, background 0.2s; }
.composeBtn:hover { box-shadow: 0 1px 3px 1px rgba(60,64,67,0.15); background: #b3dcf5; }
.composeBtn .material-symbols-outlined { color: #001d35; }

/* Navigation Sidebar */
.nav { display: flex; flex-direction: column; }
.nav a { display: flex; align-items: center; gap: 18px; padding: 0 12px 0 26px; height: 32px; border-radius: 0 16px 16px 0; font-size: 14px; color: #202124; cursor: pointer; margin-bottom: 2px;}
.nav a:hover { background: var(--line); }
.nav a.active { background: var(--brand2); color: var(--brand); font-weight: 700; }
.nav a.active .material-symbols-outlined { font-variation-settings: 'FILL' 1; color: var(--brand); }

/* Main White Panel */
.main-wrap { flex: 1; background: var(--panel); border-radius: 16px; margin: 0 16px 16px 0; display: flex; flex-direction: column; box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3); overflow: hidden; }
.toolbar { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 16px; align-items: center; min-height: 48px; }
.toolbar .material-symbols-outlined { padding: 8px; border-radius: 50%; transition: background 0.2s; }
.toolbar .material-symbols-outlined:hover { background: rgba(32,33,36,0.06); }

/* Bulletproof Mail List Layout */
.mail-list { flex: 1; overflow-y: auto; }
.mailrow { display: flex; align-items: center; padding: 0 16px; height: 48px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; transition: box-shadow 0.2s; background: #fff; }
.mailrow:hover { box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px 0 rgba(60,64,67,.3); z-index: 2; position: relative; }
.mail-actions { display: flex; gap: 12px; margin-right: 16px; align-items: center; flex: 0 0 auto; }
.from { flex: 0 0 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 16px; }
.subject-wrapper { flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; min-width: 0; /* Prevents flex blowout */ }
.subject { color: #202124; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash { margin: 0 6px; color: var(--muted); flex: 0 0 auto; }
.snippet { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date { flex: 0 0 80px; text-align: right; font-size: 12px; color: var(--muted); padding-left: 16px; }

/* Compose Form Styling */
.card { background: #fff; padding: 32px; height: 100%; display: flex; flex-direction: column; }
.card h2 { margin-top: 0; font-weight: 400; color: #202124; margin-bottom: 24px; font-size: 22px; }
.field { display: flex; flex-direction: column; margin-bottom: 16px; }
.field label { font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.input { width: 100%; padding: 12px 14px; border: 1px solid #dadce0; border-radius: 8px; font-size: 15px; transition: border 0.2s; font-family: inherit; }
.input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 1px var(--brand); }
.btn { background: var(--brand); color: #fff; border: none; padding: 12px 28px; border-radius: 24px; font-weight: 500; cursor: pointer; width: fit-content; margin-top: 8px; transition: background 0.2s; box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3); }
.btn:hover { background: #0842a0; box-shadow: 0 1px 3px 1px rgba(60,64,67,0.15); }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 14px; font-weight: 500; }
.alert.ok { background: #e6f4ea; color: #137333; }
.alert.err { background: #fce8e6; color: #c5221f; }