/* Wohto mobile layout: a deliberate single-column workspace, not a squeezed desktop. */
html { width: 100%; min-width: 0; max-width: 100%; overflow-x: hidden; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { width: 100%; min-width: 0; max-width: 100%; overflow-x: hidden; }

@media (max-width: 760px) {
  body { background: #f5f8fc; font-size: 14px; }
  .app-shell { display: block; min-height: 100dvh; }
  .workspace { width: 100%; min-width: 0; }
  .sidebar { width: min(294px, 86vw); padding: 16px 10px; box-shadow: 12px 0 32px #102a4b44; }
  .sidebar .brand { padding: 1px 10px 16px; font-size: 24px; }
  .sidebar .nav-item { height: 42px; padding: 0 13px; font-size: 14px; }
  .sidebar .subnav { margin-left: 21px; }
  .sidebar .subnav button { padding: 8px 12px; font-size: 13px; }

  .topbar { position: sticky; top: 0; height: 60px; gap: 8px; padding: 9px 12px; box-shadow: 0 1px 0 #dce5f1; }
  .mobile-menu { display: grid; width: 36px; height: 36px; place-items: center; flex: 0 0 36px; border: 1px solid #d2deee; border-radius: 9px; color: #1c579e; font-size: 0; }
  .mobile-menu::before { content: "☰"; font-size: 20px; line-height: 1; }
  .search { height: 38px; flex: 1 1 auto; min-width: 0; padding: 0 9px; gap: 6px; }
  .search > span { font-size: 18px; }
  .search input { min-width: 0; font-size: 13px; font-weight: 600; }
  .search input::placeholder { font-size: 0; }
  .search input::placeholder { font-size: 13px; }
  .topbar .quick-metrics, .topbar .rates, .topbar > .icon-btn { display: none; }
  /* The desktop chat card becomes a compact trigger on a phone.  Without
     this override, the card is inserted into the top bar at its full width. */
  .topbar > .top-chat {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    min-width: 36px;
    height: 36px;
    min-height: 36px;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 1px solid #d2deee;
    border-radius: 9px;
    background: #fff;
    box-shadow: none;
    cursor: pointer;
  }
  .topbar > .top-chat::before { display: none; }
  .topbar > .top-chat::after { content: "✉"; color: #1c579e; font-size: 17px; line-height: 1; }
  .topbar > .top-chat .card-head,
  .topbar > .top-chat .contact-tabs,
  .topbar > .top-chat .conversation,
  .topbar > .top-chat .attachment,
  .topbar > .top-chat .composer { display: none; }
  .topbar > .top-chat.open {
    position: fixed;
    z-index: 1000;
    top: 68px;
    right: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    width: auto;
    min-width: 0;
    height: min(560px, calc(100dvh - 82px));
    min-height: 0;
    padding: 0 0 8px;
    overflow: hidden;
    border: 1px solid #cbd9ec;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 18px 42px #102a4b35;
    cursor: default;
  }
  .topbar > .top-chat.open::after { display: none; }
  .topbar > .top-chat.open .card-head { display: flex; height: 48px; padding: 0 13px; }
  .topbar > .top-chat.open .card-head h2 { font-size: 16px; font-weight: 500; }
  .topbar > .top-chat.open .contact-tabs { display: flex; gap: 5px; padding: 7px 10px; overflow-x: auto; border-bottom: 1px solid #e8eef6; }
  .topbar > .top-chat.open .contact-tabs button { flex: 0 0 auto; height: 30px; font-size: 11px; }
  .topbar > .top-chat.open .conversation { display: block; flex: 1; min-height: 0; overflow-y: auto; padding: 4px 10px; }
  .topbar > .top-chat.open .attachment,
  .topbar > .top-chat.open .composer { display: flex; }
  .topbar > .top-chat.open .composer { margin: 7px 9px 0; }
  .topbar .profile-wrap { margin-left: 0; }
  .topbar .avatar { width: 36px; height: 36px; border: 1px solid #d2deee; border-radius: 9px; }
  .profile-menu { position: fixed; top: 68px; right: 10px; width: min(310px, calc(100vw - 20px)); }

  .tabs { height: 48px; padding: 6px 10px; gap: 7px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { height: 34px; flex: 0 0 auto; padding: 0 11px; font-size: 12px; }
  .tab b, .tab-pin { display: none !important; }
  .tabs .tab:not(.active) { display: none; }

  .content { max-width: none; padding: 12px; }
  .title-row { padding: 2px 0 12px; }
  .title-row h1 { font-size: 23px; letter-spacing: -.7px; }
  .title-row p { font-size: 13px; line-height: 1.4; }
  .dashboard-grid, .left-column, .right-column, .top-workspace, .bottom-workspace { display: grid; grid-template-columns: minmax(0, 1fr) !important; gap: 12px; min-width: 0; }
  .dashboard-grid { margin-top: 0; }
  .left-column, .right-column { min-height: 0; grid-template-rows: auto; }
  .cash-card { display: none !important; }
  .card { width: 100%; min-width: 0; border-radius: 12px; }
  .top-workspace .todo-card, .top-workspace .top-mail, .bottom-workspace .calendar-card, .bottom-workspace .schedule-card, .right-column > .card { min-height: auto !important; height: auto !important; }

  .todo-board { grid-template-columns: 1fr; }
  .todo-board > section { border-right: 0; border-bottom: 1px solid #e5ecf5; }
  .todo-board > section:last-child { border-bottom: 0; }
  .todo-item { padding: 9px 11px; }
  .todo-item b { font-size: 13px; }
  .todo-item small { font-size: 11px; }
  .todo-item em { font-size: 11px; }

  .card-head { height: 47px; padding: 0 12px; }
  .card .card-head h2 { font-size: 17px; }
  .panel-action, .calendar-head .outline { width: auto; min-width: 86px; height: 30px; font-size: 11px !important; }
  .mail-row { grid-template-columns: 21px minmax(0, 1fr) 62px; min-height: 61px; padding: 9px 10px; }
  .mail-row strong { font-size: 12px; }
  .mail-row small { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 1; -webkit-box-orient: vertical; font-size: 10px; white-space: normal; }
  .mail-meta { gap: 4px; }
  .mail-row button { padding: 4px 2px; font-size: 9px; }

  .calendar-head { display: grid; grid-template-columns: 30px minmax(0, 1fr) 30px auto; gap: 5px; height: 48px; padding: 0 9px; }
  .calendar-head h2 { min-width: 0; margin: 0 2px; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
  .calendar-head .calendar-legend { display: none; }
  .calendar-head .outline { min-width: 76px; padding: 0 6px; font-size: 0 !important; }
  .calendar-head .outline::after { content: "＋ Ekle"; font-size: 11px; }
  .calendar-card .calendar { grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: 27px repeat(5, 52px); overflow: hidden; }
  .calendar-card .dow { padding: 2px 0; overflow: hidden; font-size: 10px; }
  .calendar-card .day { height: 52px; min-width: 0; padding: 4px 3px; overflow: hidden; font-size: 10px; }
  .calendar-card .event { margin-top: 2px; padding: 2px 3px; overflow: hidden; font-size: 8px; text-overflow: ellipsis; }
  .schedule-entry { grid-template-columns: 42px minmax(0, 1fr); padding: 10px 12px; }
  .schedule-entry b { font-size: 13px; }
  .schedule-entry small { font-size: 11px; }

  .right-column > .messages { position: static; overflow: hidden; }
  .right-column > .messages::before, .right-column > .messages::after { display: none; }
  .contact-tabs { padding: 8px; overflow-x: auto; }
  .contact-tabs button { flex: 0 0 auto; font-size: 11px; }
  .conversation { min-height: 150px; padding: 1px 10px; }
  .bubble p { max-width: 92%; font-size: 12px; }
  .composer { margin: 7px 8px 8px; }

  .mail-module { grid-template-columns: minmax(0, 1fr); min-height: 0; border-radius: 12px; }
  .mail-folders { display: none; }
  .mail-inbox { min-width: 0; }
  .mail-detail { display: none; }
  .mail-message { grid-template-columns: 18px minmax(0, 1fr) 38px; min-height: 60px; padding: 8px 10px; }
  .mail-message .subject-title { font-size: 12px; }
  .mail-message .mail-preview { font-size: 10px; }

  .calendar-module { padding: 12px; }
  .calendar-module-header { gap: 10px; margin-bottom: 12px; }
  .calendar-module-header h2 { font-size: 22px; }
  .calendar-module-actions { width: 100%; }
  .calendar-module-actions .outline { margin-left: auto; }
  .calendar-full { grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 6px; }
  .full-dow { overflow: hidden; padding: 6px 1px; font-size: 10px; }
  .full-day { min-height: 58px; padding: 4px; gap: 3px; }
  .full-day b { font-size: 11px; }
  .full-event { padding: 2px 3px; font-size: 8px; }
  .full-day small { display: none; }

  .login-screen { padding: 16px; }
  .login-card { padding: 24px 20px; border-radius: 15px; }
}

@media (max-width: 390px) {
  .content { padding: 10px; }
  .topbar { padding: 9px 9px; }
  .mobile-menu { width: 34px; flex-basis: 34px; }
  .search input::placeholder { font-size: 12px; }
  .calendar-head h2 { font-size: 15px; }
  .calendar-head .outline { min-width: 62px; }
  .calendar-head .outline::after { content: "＋"; font-size: 17px; }
}
