@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: 'IBM Plex Sans', sans-serif; background: var(--light); color: var(--text); }

/* Layout */
.layout  { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: var(--red); color: var(--white); flex-shrink: 0;
           display: flex; flex-direction: column; }
.main    { flex: 1; padding: 24px; overflow-y: auto; }

/* Sidebar nav */
.sidebar-brand { padding: 20px 16px; font-weight: 700; font-size: 15px;
                 border-bottom: 1px solid var(--red-dark); }
.sidebar nav   { display: flex; flex-direction: column; flex: 1; }
.sidebar a     { display: flex; align-items: center; gap: 10px; padding: 12px 16px;
                 color: var(--white); text-decoration: none; font-size: 14px; }
.sidebar a:hover,
.sidebar a.active { background: var(--red-dark); }
.sidebar i { width: 18px; text-align: center; }
.sidebar a[href="/logout"] { margin-top: auto; border-top: 1px solid var(--red-dark); }

/* Stat cards */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card  { background: var(--white); border: 1px solid var(--border);
              border-top: 3px solid var(--red); padding: 20px; position: relative; }
.stat-card .num   { font-size: 36px; font-weight: 700; color: var(--red); line-height: 1; }
.stat-card .label { font-size: 12px; color: var(--muted); margin-top: 6px;
                    text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .icon  { color: var(--red); font-size: 22px; position: absolute;
                    top: 20px; right: 20px; opacity: 0.4; }

/* Tables */
.table    { width: 100%; border-collapse: collapse; background: var(--white); }
.table th { background: var(--red); color: var(--white); padding: 10px 12px;
            text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table tr:hover td { background: var(--light); }

/* Buttons */
.btn-primary   { background: var(--red); color: var(--white); border: 2px solid var(--red-dark);
                 padding: 8px 18px; font-weight: 600; font-size: 14px; cursor: pointer;
                 font-family: inherit; }
.btn-primary:hover   { background: var(--red-dark); }
.btn-secondary { background: var(--white); color: var(--red); border: 2px solid var(--red);
                 padding: 8px 18px; font-weight: 600; font-size: 14px; cursor: pointer;
                 font-family: inherit; }
.btn-secondary:hover   { background: var(--light); }
.btn-secondary:disabled { opacity: 0.5; cursor: not-allowed; }

/* Status badges */
.badge          { display: inline-block; padding: 2px 8px; font-size: 11px;
                  font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-active   { background: var(--red);  color: var(--white); }
.badge-resolved { background: #1A7A1A;     color: var(--white); }
.badge-pending  { background: #CC6600;     color: var(--white); }
.badge-agent    { background: #1A4A8A;     color: var(--white); }
.badge-high     { background: var(--red);  color: var(--white); }
.badge-medium   { background: #CC6600;     color: var(--white); }
.badge-low      { background: #1A7A1A;     color: var(--white); }

/* Web widget */
#web-callbot-widget { border: 2px solid var(--red); background: var(--white); width: 100%; }
#widget-header      { background: var(--red); color: var(--white); padding: 12px 16px;
                      display: flex; align-items: center; gap: 10px;
                      font-weight: 600; font-size: 14px; }
#widget-messages    { height: 280px; overflow-y: auto; padding: 12px; background: var(--light); }
.msg-bot            { background: var(--red); color: var(--white); padding: 8px 12px;
                      margin: 6px 0; max-width: 85%; font-size: 14px; }
.msg-user           { background: var(--white); border: 1px solid var(--border);
                      padding: 8px 12px; margin: 6px 0 6px auto; max-width: 85%;
                      font-size: 14px; }
#widget-controls    { padding: 12px; display: flex; gap: 8px;
                      border-top: 1px solid var(--border); flex-wrap: wrap; }

/* Section header */
.section-header { display: flex; align-items: center; justify-content: space-between;
                  margin-bottom: 16px; border-bottom: 2px solid var(--red);
                  padding-bottom: 10px; }
.section-title  { font-size: 16px; font-weight: 700; color: var(--red); }
