/* Orange Sales Manager – Frontend UI
 * Layout matches the “previous build” you prefer:
 * - Big white panel with soft shadow
 * - Light KPI cards
 * - Compact forms & tables
 */

.osm-name-gradient {
    background: linear-gradient(90deg, #ff6a00, #ff8a00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
}

/* Export Center modal */

.osm-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.osm-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,16,19,0.35);
}

.osm-modal-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(0,0,0,0.12);
    padding: 24px 28px;
    max-width: 520px;
    width: 90%;
    margin: 0 auto;
}

.osm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.osm-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.osm-modal-close {
    border: none;
    background: transparent;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #9ca3af;
}

.osm-modal-subtitle {
    margin: 0 0 16px;
    font-size: 13px;
    color: #6b7280;
}

.osm-export-form .osm-form-row {
    margin-bottom: 14px;
}

.osm-export-form label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 4px;
}

.osm-export-form input[type="date"],
.osm-export-form input[type="email"],
.osm-export-form select {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
    font-size: 13px;
    outline: none;
}

.osm-export-form input:focus,
.osm-export-form select:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 1px rgba(249,115,22,0.25);
}

.osm-form-row-inline {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.osm-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.osm-btn-primary {
    background: #ff7a1a;
    border-radius: 999px;
    border: none;
    padding: 8px 18px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.osm-btn-secondary {
    background: #f3f4f6;
    border-radius: 999px;
    border: none;
    padding: 8px 16px;
    color: #374151;
    font-size: 13px;
    cursor: pointer;
}

.osm-help-text {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
}

.osm-btn-secondary {
    background: #f2f2f2;
    border: 1px solid #ddd;
    color: #333;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.osm-btn-secondary:hover {
    background: #e6e6e6;
}

.osm-btn-primary {
    background: #ff7a00;
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 25px;
    cursor: pointer;
    transition: 0.2s;
}

.osm-btn-primary:hover {
    background: #ff6d00;
}

.osm-dashboard {
  max-width: 1240px;
  /* tighter top spacing for dashboard hero */
  margin: 6px auto 24px;
  padding: 20px 32px 34px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0f1013;
  background: #FFFFFF;
  border-radius: 32px;
  box-shadow: 0 18px 45px rgba(15, 16, 19, 0.06);
}

/* Auth card (login / request access) */
.osm-auth-wrapper {
  max-width: 420px;
  margin: 40px auto;
  padding: 24px 24px 28px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #0f1013;
  background: #FFFFFF;
  border-radius: 24px;
  box-shadow: 0 14px 34px rgba(15, 16, 19, 0.08);
}

.osm-dashboard-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.osm-dashboard-header h2 {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 700;
  color: #0f1013;
}

.osm-dashboard-subtitle {
  margin: 0;
  color: #757575;
  font-size: 16px;
}

/* Make the user name in greeting more prominent */
.osm-name-gradient{
  font-size: 18px;
  font-weight: 800;
}

/* Hide theme/page titles that sometimes leak into OSM pages */
.osm-app-shell .entry-title,
.osm-app-shell .page-title,
.osm-app-shell header.entry-header,
.osm-app-shell .wp-block-post-title{
  display:none !important;
}

.osm-dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* KPI cards – same warm peach style as previous build */
.osm-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.osm-kpi-card {
  padding: 16px 18px;
  background: #FFF6F0;
  border-radius: 22px;
  box-shadow: 0 10px 26px rgba(233, 99, 26, 0.08);
  border: 1px solid rgba(233, 99, 26, 0.16);
}

.osm-kpi-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #b45a1f;
  margin-bottom: 6px;
}

.osm-kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: #d45510;
  margin-bottom: 4px;
}

.osm-kpi-footnote {
  font-size: 12px;
  color: #7a5a46;
}

/* Generic cards – light, soft shadow, no grey boxes */
.osm-card,
.osm-card-full {
  background: #F9FAFB;
  border-radius: 22px;
  border: 1px solid rgba(0,0,0,0.03);
  box-shadow: 0 8px 26px rgba(15, 16, 19, 0.04);
  padding: 18px 20px 20px;
  margin-bottom: 18px;
}

.osm-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.osm-card-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.osm-card-tag {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(233, 99, 26, 0.08);
  color: #b45a1f;
}

.osm-card-description {
  margin: 0 0 12px;
  font-size: 13px;
  color: #7a5a46;
}

/* Layout rows – more compact so less scrolling */
.osm-dashboard-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 16px;
  margin-bottom: 18px;
}

/* Buttons – keep the previous pill style */
.osm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(233, 99, 26, 0.4);
  background: #FFFFFF;
  color: #e9631a;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(15, 16, 19, 0.06);
}

/* Kanban drag & drop affordance (minimal, no redesign) */
.osm-kanban-col.osm-kanban-drop {
  outline: 2px dashed rgba(233, 99, 26, 0.45);
  outline-offset: 2px;
}

.osm-kanban-card:active {
  cursor: grabbing;
}

.osm-btn:hover {
  background: #FFF1E8;
}

.osm-dashboard-actions .osm-btn:last-child {
  /* Example: Field Reports button can be solid if you like */
}

.osm-btn-danger {
  border-color: rgba(198, 40, 40, 0.6);
  color: #c62828;
  background: #FFFFFF;
  box-shadow: 0 10px 24px rgba(198, 40, 40, 0.10);
}

/* Main CTA buttons (like Save) – solid orange bar like previous */
.osm-field button.osm-btn,
.osm-form-grid button.osm-btn,
.osm-modal-dialog button.osm-btn {
  border: none;
  background: linear-gradient(90deg, #f27022, #e9631a);
  color: #fff;
  box-shadow: 0 16px 32px rgba(233, 99, 26, 0.35);
}

.osm-field button.osm-btn:hover,
.osm-form-grid button.osm-btn:hover,
.osm-modal-dialog button.osm-btn:hover {
  transform: translateY(-1px);
}

/* Forms – compact like previous */
.osm-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.osm-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.osm-field label {
  font-weight: 500;
  color: #7a5a46;
}

.osm-field input[type="text"],
.osm-field input[type="email"],
.osm-field input[type="password"],
.osm-field input[type="date"],
.osm-field input[type="datetime-local"],
.osm-field textarea,
.osm-field select {
  border-radius: 999px;
  border: 1px solid rgba(15, 16, 19, 0.10);
  padding: 7px 11px;
  font-size: 13px;
  outline: none;
  background: #FFFFFF;
}

.osm-field textarea {
  border-radius: 16px;
  min-height: 70px;
}

.osm-field-full {
  grid-column: 1 / -1;
}

/* Tables */
.osm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: transparent;
}

.osm-table th,
.osm-table td {
  padding: 8px 8px;
  border-bottom: 1px solid rgba(0,0,0,0.03);
  text-align: left;
}

.osm-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #a26a3b;
}

.osm-table tbody tr:hover {
  background: #FFF8F3; /* soft orange hover like previous */
}

.osm-table-actions {
  text-align: right;
}

/* Pills */
.osm-pill-high,
.osm-pill-medium,
.osm-pill-low {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.osm-pill-high {
  background: rgba(198, 40, 40, 0.1);
  color: #b71c1c;
}
.osm-pill-medium {
  background: rgba(233, 99, 26, 0.12);
  color: #e9631a;
}
.osm-pill-low {
  background: rgba(46, 125, 50, 0.1);
  color: #2e7d32;
}

/* Timeline */
.osm-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}

.osm-timeline-item {
  padding: 10px 0;
  border-bottom: 1px dashed rgba(0,0,0,0.06);
}

.osm-timeline-meta {
  font-size: 11px;
  color: #8b6a52;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}

.osm-timeline-summary {
  font-size: 13px;
  margin-bottom: 3px;
}

.osm-timeline-next {
  font-size: 12px;
  color: #7a5a46;
}

/* Links */
.osm-link {
  color: #e9631a;
  text-decoration: none;
  font-weight: 500;
}

.osm-link:hover {
  text-decoration: underline;
}

.osm-link-danger {
  color: #c62828;
}

.osm-link-button {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  color: #e9631a;
  font-size: 13px;
  cursor: pointer;
}

/* Alerts */
.osm-alert {
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  margin-bottom: 14px;
}

.osm-alert-success {
  background: rgba(56, 142, 60, 0.08);
  color: #2e7d32;
  border: 1px solid rgba(56, 142, 60, 0.26);
}
.osm-alert-error {
  background: rgba(198, 40, 40, 0.08);
  color: #b71c1c;
  border: 1px solid rgba(198, 40, 40, 0.26);
}

/* Auth headings */
.osm-auth-title {
  margin: 0 0 4px;
  font-size: 20px;
}
.osm-auth-note {
  margin: 0 0 16px;
  font-size: 13px;
  color: #7a5a46;
}
.osm-auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Modal – same style as previous floating dialog */
.osm-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}

.osm-modal.osm-open {
  display: block;
}

.osm-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15,16,19,0.35);
}

.osm-modal-dialog {
  position: relative;
  max-width: 560px;
  margin: 70px auto;
  padding: 22px 24px 24px;
  background: #FFFFFF;
  border-radius: 24px;
  box-shadow: 0 22px 50px rgba(15, 16, 19, 0.25);
}

.osm-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #7a5a46;
}

.osm-modal-title {
  margin: 0 0 4px;
  font-size: 18px;
}
.osm-modal-subtitle {
  margin: 0 0 14px;
  font-size: 13px;
  color: #7a5a46;
}

/* Weekly summary text under today's follow-ups */
.osm-weekly-summary {
  margin-top: 10px;
  font-size: 12px;
  color: #7a5a46;
}
.osm-weekly-title {
  margin: 0 0 2px;
  font-weight: 600;
}
.osm-weekly-meta {
  margin: 0;
}

/* Responsive tweaks (same structure, just less scroll on mobile) */
@media (max-width: 900px) {
  .osm-dashboard {
    padding: 20px 16px 26px;
    border-radius: 0;
    box-shadow: none;
  }

  .osm-dashboard-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .osm-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .osm-dashboard-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .osm-dashboard-actions {
    width: 100%;
  }

  .osm-dashboard-actions .osm-btn {
    width: 100%;
    justify-content: center;
  }

  .osm-modal-dialog {
    margin: 40px 16px;
  }
}

@media (max-width: 600px) {
  .osm-kpi-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .osm-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ------------------------------
   MOBILE FIX FOR TOP MENU
   ------------------------------ */
@media (max-width: 768px) {

    /* Ensure header wraps cleanly */
    .osm-dashboard-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 20px !important;
    }

    /* Greeting stays full width */
    .osm-dashboard-header > div:first-child {
        width: 100% !important;
    }

    /* Wrap the menu buttons nicely */
    .osm-dashboard-actions {
        width: 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 12px !important;
        justify-content: flex-start !important;
    }

    /* Buttons auto-resize and avoid distortion */
    .osm-dashboard-actions .osm-btn {
        flex: 1 1 calc(50% - 12px);
        text-align: center;
        padding: 12px 16px !important;
    }

    /* Logout button also responsive */
    #osm-logout-btn {
        flex: 1 1 100% !important;
        text-align: center !important;
    }

    /* Modal fixes: center & prevent stretching */
    .osm-modal-dialog {
        width: 92% !important;
        margin: 0 auto !important;
    }

    /* Export modal inputs full width */
    #osm-export-form .osm-form-row input,
    #osm-export-form .osm-form-row select {
        width: 100% !important;
    }

    /* Fix columns inside modal that stretch */
    .osm-form-row-inline {
        flex-direction: column !important;
        gap: 12px !important;
    }

    /* Tables: smooth scrolling instead of breaking */
    .osm-table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }
}

/* --- FIX: Modal always above header & footer --- */
#osm-export-modal,
#osm-add-client-modal,
.osm-modal-overlay {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 999999 !important;
    background: rgba(0,0,0,0.25); /* keep your original backdrop */
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* --- FIX: Modal content scrolls properly --- */
.osm-modal {
    position: relative !important;
    z-index: 1000000 !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 94%;
    margin: 20px auto;
    border-radius: 18px;
}

body.modal-open {
    overflow: hidden !important;
    height: 100vh !important;
}

.osm-table td {
    word-break: break-all;
    max-width: 120px;
}

/* Header layout with action button on the right */
.osm-card-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.osm-card-header-with-action h3 {
    margin-bottom: 0;
}

/* Slim outline button for Add File */
.osm-btn-outline {
    border: 1px solid #f26c22;
    background: transparent;
    color: #f26c22;
    border-radius: 999px;
    padding: 0.4rem 1.2rem;
    font-size: 0.875rem;
    cursor: pointer;
}

/* Small button variant (used for compact actions like client file upload) */
.osm-btn-sm {
    padding: 0.3rem 0.9rem;
    font-size: 0.8rem;
}

/* Email history – keep long emails inside the cell */
.osm-card-email-history .osm-table td:nth-child(2),
.osm-card-email-history .osm-table td:nth-child(3) {
    word-break: break-word;
    white-space: normal;
}

/* CEO Dashboard Menu */
.osm-ceo-menu {
    max-width: 1240px;
    margin: 0 auto 20px;
    display: flex;
    gap: 12px;
    padding-left: 8px;
}

.osm-ceo-menu a {
    padding: 8px 18px;
    background: #f6f6f6;
    border-radius: 14px;
    text-decoration: none;
    font-size: 14px;
    color: #444;
    border: 1px solid #e5e5e5;
}

.osm-ceo-menu a.active,
.osm-ceo-menu a:hover {
    background: #ffe7d5;
    border-color: #f47020;
    color: #e9631a;
}

/* -------------------------------------------------------------
   SaaS Dashboard Top Section (Smart Cards + Quick Actions)
--------------------------------------------------------------*/
.osm-app-shell .osm-legacy-actions { display:none !important; }

.osm-saas-top{
  display:grid;
  grid-template-columns: 1.6fr 0.8fr;
  gap:18px;
  margin: 18px 0 22px;
}

.osm-saas-cards{
  background:#fff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:14px;
}

.osm-smart-card{
  border: 1px solid rgba(233,99,26,0.18);
  background: rgba(233,99,26,0.06);
  border-radius: 18px;
  padding: 14px;
}

.osm-smart-title{
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color:#b54b10;
  font-weight: 700;
}

.osm-smart-value{
  font-size: 28px;
  font-weight: 800;
  color:#e9631a;
  margin-top: 6px;
}

.osm-smart-sub{
  margin-top: 6px;
  font-size: 13px;
  color:#444;
}

.osm-smart-actions{
  grid-column: 1 / -1;
  display:flex;
  justify-content:flex-end;
}

.osm-btn.osm-btn-ghost{
  background: #fff;
  border: 1px solid rgba(233,99,26,0.35);
  color:#e9631a;
}

.osm-saas-quick{
  background:#fff;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
}

.osm-quick-title{
  font-weight: 800;
  margin-bottom: 12px;
}

.osm-quick-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}

.osm-quick{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  text-decoration:none;
  background: rgba(0,0,0,0.03);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 14px;
  padding: 12px 10px;
  color:#111;
  font-weight: 600;
  font-size: 13px;
  text-align:left;
}
.osm-quick span{ white-space: nowrap; }

.osm-quick:hover{
  border-color: rgba(233,99,26,0.45);
  background: rgba(233,99,26,0.06);
}

@media (max-width: 1200px){
  .osm-saas-cards{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 980px){
  .osm-saas-top{ grid-template-columns: 1fr; }
  .osm-saas-cards{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 520px){
  .osm-saas-cards{ grid-template-columns: 1fr; }
  .osm-quick-grid{ grid-template-columns: 1fr; }
}

/* -------------------------------------------------
   Smooth page load fade-in (Dashboard + reports)
------------------------------------------------- */

.osm-fade-in{
  opacity: 0;
  transform: translateY(8px);
  animation: osmFadeIn 0.45s ease-out forwards;
}

@keyframes osmFadeIn{
  to{
    opacity: 1;
    transform: translateY(0);
  }
}

.osm-greeting-icon{
  display:inline-block;
  margin-right:6px;
  transform: translateY(-1px);
}

/* =========================
   GREETING NAME SIZE
========================= */
.osm-dashboard-subtitle{
  line-height: 1.35;
}
.osm-dashboard-subtitle .osm-name-gradient{
  font-size: 22px;
  font-weight: 800;
}
.osm-dashboard-subtitle .osm-greeting-icon{
  margin-right: 6px;
}

/* =========================
   CLIENT FILES (PORTAL)
========================= */
.osm-files-upload-form{
  margin-top: 10px;
}
.osm-files-upload-actions{
  display:flex;
  align-items:center;
  gap:12px;
  margin-top: 10px;
}
.osm-files-upload-actions .osm-btn-sm{
  padding: 8px 14px !important;
  font-size: 13px !important;
  border-radius: 14px !important;
}
.osm-files-upload-row input[type="file"]{
  padding: 10px 12px;
  border-radius: 14px;
}
.osm-files-list{
  margin-top: 14px;
  max-height: 280px;
  overflow: auto;
  border-radius: 18px;
}
.osm-files-empty{
  margin-top: 12px;
}
