/* CAS-ia Call Accounting - Public Styles
   Desktop-first design for call accounting reports
*/

:root {
    --casia-primary: #E09431;
    --casia-secondary: #22c55e;
    --casia-text: #1f2937;
    --casia-text-light: #6b7280;
    --casia-border: #e5e7eb;
    --casia-bg: #f9fafb;
    --casia-primary-dark: #c97f1e;
    --portal-pad: 40px;
}

/* =====================================================
   THEME OVERRIDE RESET - Force plugin styles over theme
   ===================================================== */
.casia-portal,
.casia-portal *,
.casia-portal *::before,
.casia-portal *::after {
    box-sizing: border-box;
}

/* =============================================================================
   AGGRESSIVE THEME RESET - Maximum specificity to override any theme
   ============================================================================= */

/* Nuclear option: Reset ALL text elements within portal */
body .casia-portal,
body .casia-portal *,
html body .casia-portal,
html body .casia-portal * {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

/* All headings - force reasonable sizes */
body .casia-portal h1,
body .casia-portal h2,
body .casia-portal h3,
body .casia-portal h4,
body .casia-portal h5,
body .casia-portal h6,
html body .casia-portal h1,
html body .casia-portal h2,
html body .casia-portal h3,
html body .casia-portal h4,
html body .casia-portal h5,
html body .casia-portal h6 {
    line-height: 1.3 !important;
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
}

body .casia-portal h1 { font-size: 28px !important; font-weight: 700 !important; }
body .casia-portal h2 { font-size: 22px !important; font-weight: 600 !important; }
body .casia-portal h3 { font-size: 18px !important; font-weight: 600 !important; }
body .casia-portal h4 { font-size: 16px !important; font-weight: 600 !important; }
body .casia-portal h5 { font-size: 14px !important; font-weight: 600 !important; }
body .casia-portal h6 { font-size: 13px !important; font-weight: 600 !important; }

/* All text elements */
body .casia-portal p,
body .casia-portal span,
body .casia-portal div,
body .casia-portal li,
body .casia-portal td,
body .casia-portal th,
body .casia-portal label {
    font-size: 14px !important;
    line-height: 1.5 !important;
}

/* All links - critical for Log Out button */
body .casia-portal a,
html body .casia-portal a,
body .casia-portal a:link,
body .casia-portal a:visited,
body .casia-portal a:hover,
body .casia-portal a:active {
    font-size: inherit !important;
    text-decoration: none !important;
}

/* HEADER - Force all header elements to be small */
body .casia-portal .casia-portal-header,
body .casia-portal .casia-portal-header *,
body .casia-portal-header,
body .casia-portal-header * {
    font-size: 14px !important;
    line-height: 1.4 !important;
}

/* LOG OUT BUTTON - Maximum specificity */
body .casia-portal .casia-portal-header a,
body .casia-portal .casia-portal-header a.casia-btn,
body .casia-portal .casia-portal-header .casia-btn,
body .casia-portal-header a,
body .casia-portal-header a.casia-btn,
body .casia-portal-header .casia-btn,
html body .casia-portal-header a.casia-btn,
.casia-portal .casia-portal-header a.casia-btn-outline {
    font-size: 14px !important;
    padding: 8px 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    line-height: 1.4 !important;
    height: auto !important;
    max-height: 40px !important;
}

/* User info in header */
body .casia-portal-header .casia-user-name,
body .casia-portal .casia-portal-header .casia-user-name {
    font-size: 14px !important;
    font-weight: 600 !important;
}

body .casia-portal-header .casia-user-company,
body .casia-portal .casia-portal-header .casia-user-company {
    font-size: 13px !important;
    font-weight: 400 !important;
}

/* NAVIGATION - Force reasonable sizes */
body .casia-portal .casia-portal-nav,
body .casia-portal .casia-portal-nav *,
body .casia-portal-nav,
body .casia-portal-nav * {
    font-size: 14px !important;
    line-height: 1.4 !important;
}

body .casia-portal-nav li a,
body .casia-portal .casia-portal-nav li a {
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 14px 18px !important;
}

/* STAT CARDS */
body .casia-portal .lcca-stat-value,
body .lcca-stat-value {
    font-size: 26px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
}

body .casia-portal .lcca-stat-label,
body .lcca-stat-label {
    font-size: 14px !important;
    font-weight: 400 !important;
}

/* CHART CONTAINERS - Call Trend, Call Types titles */
body .casia-portal .lcca-chart-container h3,
body .casia-portal .lcca-top-list h3,
body .lcca-chart-container h3,
body .lcca-top-list h3,
html body .lcca-chart-container h3,
html body .lcca-top-list h3 {
    font-size: 18px !important;
    font-weight: 600 !important;
    margin: 0 0 12px 0 !important;
    line-height: 1.3 !important;
}

/* TABLES */
body .casia-portal table,
body .casia-portal table *,
body .casia-portal .lcca-table,
body .casia-portal .lcca-table * {
    font-size: 13px !important;
}

body .casia-portal table th,
body .casia-portal .lcca-table th {
    font-size: 12px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
}

/* FOOTER */
body .casia-portal .casia-portal-footer,
body .casia-portal .casia-portal-footer *,
body .casia-portal-footer,
body .casia-portal-footer * {
    font-size: 13px !important;
}

/* CARDS */
body .casia-portal .casia-card h3,
body .casia-card h3 {
    font-size: 16px !important;
    font-weight: 600 !important;
}

/* BUTTONS - All buttons in portal */
body .casia-portal .casia-btn,
body .casia-portal button,
body .casia-btn {
    font-size: 14px !important;
    line-height: 1.4 !important;
}

/* Force full-width for portal parent elements */
.entry-content:has(.casia-portal),
.page-content:has(.casia-portal),
.post-content:has(.casia-portal),
article:has(.casia-portal),
.content-area:has(.casia-portal),
.site-content:has(.casia-portal),
.container:has(.casia-portal),
.wp-block-post-content:has(.casia-portal) {
    max-width: none !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* =====================================================
   BASE STYLES
   ===================================================== */
.casia-portal {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: var(--casia-text);
    line-height: 1.5;
    background: var(--casia-bg);
    min-height: 100vh;
    
    /* Break out of WordPress theme container */
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    box-sizing: border-box;
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.casia-login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 40px 20px;
}

.casia-login-box {
    background: #fff;
    border: 1px solid var(--casia-border);
    border-radius: 8px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

.casia-login-logo {
    text-align: center;
    margin-bottom: 24px;
}

.casia-login-logo img {
    max-width: 200px;
    max-height: 80px;
}

.casia-login-box h2 {
    margin: 0 0 24px;
    text-align: center;
    font-size: 24px;
}

.casia-login-form .casia-form-group {
    margin-bottom: 16px;
}

.casia-login-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.casia-login-form input[type="text"],
.casia-login-form input[type="email"],
.casia-login-form input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--casia-border);
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.casia-login-form input:focus {
    outline: none;
    border-color: var(--casia-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.casia-login-form .casia-remember label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
}

.casia-login-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 13px;
}

.casia-login-footer a {
    color: var(--casia-primary);
    text-decoration: none;
}

.casia-logged-in {
    text-align: center;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.casia-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    gap: 6px;
}

.casia-btn-primary {
    background: var(--casia-primary);
    color: #fff;
}

.casia-btn-primary:hover {
    background: #c97f1e;
    color: #fff;
}

.casia-btn-secondary {
    background: var(--casia-text-light);
    color: #fff;
}

.casia-btn-outline {
    background: transparent;
    border: 1px solid var(--casia-border);
    color: var(--casia-text);
}

.casia-btn-outline:hover {
    background: var(--casia-bg);
}

.casia-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.casia-btn-block {
    width: 100%;
}

/* =====================================================
   PORTAL HEADER
   ===================================================== */
.casia-portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px var(--portal-pad);
    background: #fff;
    border-bottom: 1px solid var(--casia-border);
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
    gap: 10px;
}

.casia-portal-logo {
    max-height: 40px;
    max-width: 180px;
}

.casia-portal-title {
    font-size: 18px;
    font-weight: 700;
}

.casia-portal-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.casia-user-name {
    font-weight: 600;
}

.casia-user-company {
    color: var(--casia-text-light);
    font-size: 13px;
}

/* =====================================================
   PORTAL NAVIGATION
   ===================================================== */
.casia-portal-nav {
    background: #fff;
    border-bottom: 1px solid var(--casia-border);
    padding: 0 var(--portal-pad);
    width: 100%;
    box-sizing: border-box;
}

.casia-portal-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
}

.casia-portal-nav li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    color: var(--casia-text-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.casia-portal-nav li a:hover {
    color: var(--casia-primary);
}

.casia-portal-nav li.active a {
    color: var(--casia-primary);
    border-bottom-color: var(--casia-primary);
}

.casia-portal-nav .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Nav dropdown arrow */
body .casia-portal-nav .casia-nav-arrow,
body .casia-portal .casia-portal-nav .casia-nav-arrow {
    font-size: 12px !important;
    width: 12px !important;
    height: 12px !important;
    margin-left: 2px;
    opacity: 0.5;
    transition: transform 0.2s;
}

/* Dropdown parent */
.casia-portal-nav li.has-children {
    position: relative;
}

.casia-portal-nav li.has-children:hover .casia-nav-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

/* Dropdown menu */
.casia-portal-nav .casia-nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid var(--casia-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 180px;
    padding: 6px 0;
    z-index: 1000;
    flex-direction: column;
    gap: 0;
}

.casia-portal-nav li.has-children:hover > .casia-nav-dropdown {
    display: flex;
}

body .casia-portal-nav .casia-nav-dropdown li,
body .casia-portal .casia-portal-nav .casia-nav-dropdown li {
    margin: 0;
    padding: 0;
}

body .casia-portal-nav .casia-nav-dropdown li a,
body .casia-portal .casia-portal-nav .casia-nav-dropdown li a {
    display: block !important;
    padding: 9px 18px !important;
    font-size: 13px !important;
    font-weight: 400 !important;
    color: var(--casia-text) !important;
    border-bottom: none !important;
    white-space: nowrap;
    transition: background 0.15s;
}

body .casia-portal-nav .casia-nav-dropdown li a:hover {
    background: var(--casia-bg) !important;
    color: var(--casia-primary) !important;
}

body .casia-portal-nav .casia-nav-dropdown li.active a {
    color: var(--casia-primary) !important;
    font-weight: 600 !important;
    background: rgba(99, 102, 241, 0.06) !important;
}

/* =====================================================
   PORTAL CONTENT
   ===================================================== */
.casia-portal-content {
    padding: 24px var(--portal-pad);
    max-width: none;
    width: 100%;
    box-sizing: border-box;
}

/* =====================================================
   PORTAL FOOTER
   ===================================================== */
.casia-portal-footer {
    padding: 16px var(--portal-pad);
    text-align: center;
    color: var(--casia-text-light);
    font-size: 13px;
    border-top: 1px solid var(--casia-border);
    background: #fff;
    margin-top: 40px;
    width: 100%;
    box-sizing: border-box;
}

.casia-portal-footer p {
    margin: 4px 0;
}

.casia-powered-by a {
    color: var(--casia-primary);
    text-decoration: none;
}

/* =====================================================
   CARDS
   ===================================================== */
.casia-card {
    background: #fff;
    border: 1px solid var(--casia-border);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.casia-card h3 {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--casia-border);
}

.casia-card h4 {
    margin: 20px 0 10px;
    font-size: 13px;
    color: var(--casia-text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* =====================================================
   NOTICES
   ===================================================== */
.casia-notice {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}

.casia-notice-error {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.casia-notice-warning {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fcd34d;
}

.casia-notice-success {
    background: #dcfce7;
    color: #16a34a;
    border: 1px solid #86efac;
}

.casia-notice-info {
    background: #dbeafe;
    color: #2563eb;
    border: 1px solid #93c5fd;
}

/* =====================================================
   BADGES
   ===================================================== */
.casia-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.casia-badge-success,
.lcca-badge-incoming,
.lcca-badge-answered {
    background: #dcfce7;
    color: #16a34a;
}

.casia-badge-warning,
.lcca-badge-outgoing {
    background: #fef3c7;
    color: #d97706;
}

.casia-badge-error,
.lcca-badge-missed {
    background: #fee2e2;
    color: #dc2626;
}

.casia-badge-info {
    background: #fdf3e1;
    color: #c97f1e;
}

.lcca-badge-internal {
    background: #fdf3e1;
    color: #c97f1e;
}

.lcca-badge-emergency {
    background: #dc2626;
    color: #fff;
}

/* =====================================================
   FORMS
   ===================================================== */
.casia-form-group {
    margin-bottom: 16px;
}

.casia-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

.casia-form-group input[type="text"],
.casia-form-group input[type="email"],
.casia-form-group input[type="tel"],
.casia-form-group input[type="password"],
.casia-form-group textarea,
.casia-form-group select {
    width: 100%;
    max-width: 400px;
    padding: 8px 12px;
    border: 1px solid var(--casia-border);
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.casia-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.casia-form-group small {
    display: block;
    margin-top: 4px;
    color: var(--casia-text-light);
    font-size: 12px;
}

/* =====================================================
   INFO TABLES
   ===================================================== */
.casia-info-table {
    width: 100%;
    max-width: 500px;
    border-collapse: collapse;
}

.casia-info-table th,
.casia-info-table td {
    padding: 10px 0;
    border-bottom: 1px solid var(--casia-border);
    font-size: 14px;
}

.casia-info-table th {
    text-align: left;
    color: var(--casia-text-light);
    font-weight: normal;
    width: 35%;
}

.casia-info-table td {
    text-align: left;
    font-weight: 500;
}

.casia-help-text {
    color: var(--casia-text-light);
    font-size: 13px;
    margin-top: 16px;
}

/* =====================================================
   ACCOUNT PAGE
   ===================================================== */
.casia-account h2 {
    margin: 0 0 20px;
    font-size: 20px;
}

.casia-account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* =====================================================
   SETTINGS PAGE
   ===================================================== */
.casia-settings h2 {
    margin: 0 0 20px;
    font-size: 20px;
}

.casia-settings-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.casia-current-logo {
    margin-bottom: 12px;
    padding: 12px;
    background: var(--casia-bg);
    border-radius: 4px;
    display: inline-block;
}

/* =====================================================
   DATA TABLES (Full Width for Reports)
   ===================================================== */
.casia-table-wrapper {
    background: #fff;
    border: 1px solid var(--casia-border);
    border-radius: 6px;
    overflow: hidden;
}

.casia-table,
.lcca-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.casia-table th,
.casia-table td,
.lcca-table th,
.lcca-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--casia-border);
    white-space: nowrap;
}

.casia-table th,
.lcca-table th {
    background: #f9fafb;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--casia-text-light);
}

.casia-table tbody tr:hover,
.lcca-table tbody tr:hover {
    background: #f9fafb;
}

.casia-table tbody tr.emergency,
.lcca-table tbody tr.emergency {
    background: #fef2f2;
}

.casia-table tbody tr:last-child td,
.lcca-table tbody tr:last-child td {
    border-bottom: none;
}

/* Table container for scrolling if needed */
.lcca-table-container {
    background: #fff;
    border: 1px solid var(--casia-border);
    border-radius: 6px;
    overflow-x: auto;
}

/* =====================================================
   FILTERS
   ===================================================== */
.casia-filters,
.lcca-filters {
    background: #fff;
    padding: 16px 20px;
    border: 1px solid var(--casia-border);
    border-radius: 6px;
    margin-bottom: 20px;
}

.casia-filters-form,
.lcca-filters-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
}

.casia-filter-group,
.lcca-filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.casia-filter-group label,
.lcca-filter-group label {
    font-size: 12px;
    color: var(--casia-text-light);
    font-weight: 500;
}

.casia-filters select,
.casia-filters input[type="text"],
.casia-filters input[type="date"],
.lcca-filters select,
.lcca-filters input[type="text"],
.lcca-filters input[type="date"] {
    padding: 8px 10px;
    border: 1px solid var(--casia-border);
    border-radius: 4px;
    font-size: 13px;
    min-width: 140px;
}

.casia-filters button,
.lcca-filters button {
    padding: 8px 16px;
    background: var(--casia-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.casia-filters button:hover,
.lcca-filters button:hover {
    background: #c97f1e;
}

.casia-filters button.secondary,
.lcca-filters button.secondary {
    background: var(--casia-text-light);
}

/* =====================================================
   STATS GRID
   ===================================================== */
.lcca-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

.lcca-stat-card {
    background: #fff;
    border: 1px solid var(--casia-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: box-shadow 0.3s;
}

.lcca-stat-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.lcca-stat-card.emergency {
    border-color: #dc2626;
    background: #fef2f2;
}

.lcca-stat-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.lcca-stat-icon.total { background: #E09431; }
.lcca-stat-icon.incoming { background: #22c55e; }
.lcca-stat-icon.outgoing { background: #f59e0b; }
.lcca-stat-icon.internal { background: #8b5cf6; }
.lcca-stat-icon.duration { background: #3b82f6; }
.lcca-stat-icon.answer-rate { background: #10b981; }
.lcca-stat-icon.emergency { background: #dc2626; }

.lcca-stat-icon img {
    width: 24px;
    height: 24px;
    display: block;
}

.lcca-stat-content {
    flex: 1;
    min-width: 0;
}

.lcca-stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--casia-text);
    line-height: 1.2;
}

.lcca-stat-label {
    color: var(--casia-text-light);
    font-size: 14px;
    margin-top: 2px;
}

.lcca-stat-sub {
    color: #9ca3af;
    font-size: 12px;
    margin-top: 2px;
}

/* =====================================================
   CHARTS
   ===================================================== */
.lcca-charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
    width: 100%;
}

.lcca-chart-container {
    background: #fff;
    border: 1px solid var(--casia-border);
    border-radius: 6px;
    padding: 20px;
}

.lcca-chart-container h3 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
}

.lcca-chart-container canvas {
    max-height: 250px;
}

/* =====================================================
   TOP LISTS
   ===================================================== */
.lcca-top-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
}

.lcca-top-list {
    background: #fff;
    border: 1px solid var(--casia-border);
    border-radius: 6px;
    overflow-x: auto;
}

.lcca-top-list h3 {
    margin: 0;
    padding: 12px 16px;
    background: #f9fafb;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid var(--casia-border);
}

.lcca-top-list-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--casia-border);
    font-size: 13px;
}

.lcca-top-list-item:last-child {
    border-bottom: none;
}

.lcca-top-list-item .count {
    font-weight: 600;
    color: var(--casia-primary);
}

/* =====================================================
   PAGINATION
   ===================================================== */
.lcca-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: #f9fafb;
}

.lcca-pagination a {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid var(--casia-border);
    border-radius: 4px;
    color: var(--casia-text);
    text-decoration: none;
    font-size: 13px;
}

.lcca-pagination a:hover {
    background: var(--casia-primary);
    color: #fff;
    border-color: var(--casia-primary);
}

.lcca-pagination span {
    color: var(--casia-text-light);
    font-size: 13px;
}

/* =====================================================
   DATE RANGE
   ===================================================== */
.lcca-date-range {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* =====================================================
   LEGACY CONTAINER
   ===================================================== */
.lcca-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* =====================================================
   REPORT TABS
   ===================================================== */
.casia-report-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--casia-border);
    margin-bottom: 20px;
}

.casia-report-tab {
    padding: 12px 24px;
    text-decoration: none;
    color: var(--casia-text-light);
    font-weight: 500;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.casia-report-tab:hover {
    color: var(--casia-primary);
}

.casia-report-tab.active {
    color: var(--casia-primary);
    border-bottom-color: var(--casia-primary);
}

/* =====================================================
   ACD PORTAL STYLES
   ===================================================== */
.casia-acd-pill {
    display: inline-block;
    background: linear-gradient(135deg, #E09431, #f0b060);
    color: #fff !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 2px 10px;
    border-radius: 10px;
    vertical-align: middle;
}

.casia-acd-empty-state {
    background: #fff;
    border: 2px dashed var(--casia-border);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    margin-bottom: 20px;
}

.casia-acd-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.casia-acd-empty-state h3 {
    color: #6b7280 !important;
}

.casia-acd-empty-state p {
    color: #9ca3af !important;
    max-width: 500px;
    margin: 0 auto !important;
}

.casia-input-sm {
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
}

.casia-portal-table {
    width: 100%;
    border-collapse: collapse;
}

.casia-portal-table th {
    background: #f9fafb;
    padding: 10px 12px;
    font-weight: 600 !important;
    color: #374151 !important;
    border-bottom: 2px solid var(--casia-border);
    white-space: nowrap;
}

.casia-portal-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    white-space: nowrap;
}

.casia-portal-table tr:hover td {
    background: #f9fafb;
}

/* =====================================================
   HAMBURGER MENU BUTTON (hidden on desktop)
   ===================================================== */
.casia-nav-toggle {
    display: none !important;
    background: none;
    border: 2px solid #197F7D;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    color: #197F7D;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.casia-nav-toggle:hover {
    background: rgba(25, 127, 125, 0.08);
}

.casia-nav-toggle:active {
    background: rgba(25, 127, 125, 0.15);
}

/* Pure CSS hamburger — no font dependency */
.casia-hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 20px;
    height: 18px;
}

.casia-hamburger-icon span {
    display: block;
    height: 2px;
    width: 100%;
    background: #197F7D;
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

.casia-menu-label {
    letter-spacing: 0.03em;
}

/* =====================================================
   ACD UTILITY CLASSES (replacing inline styles)
   ===================================================== */
.casia-page-header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.casia-date-filter-form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.casia-chart-wrap {
    height: 280px;
}

.casia-text-right {
    text-align: right;
}

.casia-text-center {
    text-align: center;
}

.casia-sl-good {
    color: #22c55e;
    font-weight: 600;
}

.casia-sl-bad {
    color: #ef4444;
    font-weight: 600;
}

.casia-empty-cell {
    color: #9ca3af;
    padding: 30px 12px !important;
}

.casia-queue-summary {
    margin-top: 20px;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

/* --- Tablet landscape (1200px) --- */
@media (max-width: 1200px) {
    .lcca-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .lcca-top-lists {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .casia-settings-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Tablet portrait (768px) — hamburger nav kicks in --- */
@media (max-width: 768px) {
    :root {
        --portal-pad: 20px;
    }
    
    /* Show hamburger button */
    .casia-nav-toggle {
        display: inline-flex !important;
    }
    
    /* Mobile nav: hidden by default, shown when .open */
    .casia-portal-nav {
        display: none;
        padding: 0;
        border-bottom: 1px solid var(--casia-border);
    }
    
    .casia-portal-nav.open {
        display: block;
    }
    
    .casia-portal-nav ul {
        flex-direction: column;
        gap: 0;
    }
    
    body .casia-portal-nav li a,
    body .casia-portal .casia-portal-nav li a {
        padding: 12px 20px !important;
        border-bottom: 1px solid var(--casia-border) !important;
        border-left: 3px solid transparent;
    }
    
    .casia-portal-nav li.active a {
        border-bottom-color: var(--casia-border) !important;
        border-left-color: var(--casia-primary) !important;
        background: rgba(99, 102, 241, 0.04);
    }
    
    /* Hide dashicons in mobile nav to save space */
    .casia-portal-nav .dashicons:not(.casia-nav-arrow) {
        display: none;
    }
    
    /* Mobile dropdown: inline, not absolute */
    .casia-portal-nav .casia-nav-dropdown {
        position: static;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        background: var(--casia-bg);
    }
    
    /* Show dropdown when parent has .open class (JS toggle) */
    .casia-portal-nav li.has-children.open > .casia-nav-dropdown {
        display: flex;
    }
    
    /* Hide hover-based dropdown on mobile */
    .casia-portal-nav li.has-children:hover > .casia-nav-dropdown {
        display: none;
    }
    .casia-portal-nav li.has-children.open:hover > .casia-nav-dropdown {
        display: flex;
    }
    
    body .casia-portal-nav .casia-nav-dropdown li a,
    body .casia-portal .casia-portal-nav .casia-nav-dropdown li a {
        padding: 10px 20px 10px 36px !important;
        border-bottom: 1px solid var(--casia-border) !important;
    }
    
    /* Arrow rotation for open state */
    .casia-portal-nav li.has-children.open > a .casia-nav-arrow {
        transform: rotate(180deg);
        opacity: 1;
    }
    
    /* Grids */
    .lcca-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .lcca-charts-row {
        grid-template-columns: 1fr;
    }
    
    .lcca-top-lists {
        grid-template-columns: 1fr;
    }
    
    .casia-account-grid {
        grid-template-columns: 1fr;
    }
    
    .casia-settings-grid {
        grid-template-columns: 1fr;
    }
    
    /* Charts */
    .casia-chart-wrap {
        height: 220px;
    }
    
    /* Date filter form stacking */
    .casia-date-filter-form {
        width: 100%;
    }
    .casia-date-filter-form input[type="date"] {
        flex: 1;
        min-width: 0;
    }
    
    /* Page header stacking */
    .casia-page-header-flex {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* Login padding */
    .casia-login-box {
        padding: 30px 24px;
    }
}

/* --- Phone (640px) --- */
@media (max-width: 640px) {
    :root {
        --portal-pad: 16px;
    }
    
    /* Header: hide company name */
    .casia-portal-user .casia-user-company {
        display: none;
    }
    
    /* Stats: single column */
    .lcca-stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    /* Smaller stat cards */
    .lcca-stat-card {
        padding: 14px;
        gap: 12px;
    }
    
    .lcca-stat-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
    }
    
    .lcca-stat-icon img {
        width: 20px;
        height: 20px;
    }
    
    body .casia-portal .lcca-stat-value,
    body .lcca-stat-value {
        font-size: 22px !important;
    }
    
    /* Charts */
    .casia-chart-wrap {
        height: 200px;
    }
    
    /* Report tabs scroll */
    .casia-report-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Filters: full width */
    .casia-filters-form,
    .lcca-filters-form {
        flex-direction: column;
    }
    .casia-filter-group,
    .lcca-filter-group {
        width: 100%;
    }
    .casia-filters select,
    .casia-filters input[type="text"],
    .casia-filters input[type="date"],
    .lcca-filters select,
    .lcca-filters input[type="text"],
    .lcca-filters input[type="date"] {
        width: 100%;
        min-width: 0;
    }
    
    /* Date filter form: stack */
    .casia-date-filter-form {
        flex-direction: column;
    }
    .casia-date-filter-form input[type="date"],
    .casia-date-filter-form .casia-btn {
        width: 100%;
    }
    
    /* Touch-friendly tap targets */
    body .casia-portal-nav li a,
    body .casia-portal .casia-portal-nav li a {
        min-height: 44px;
    }
    
    /* Cards: less padding */
    .casia-card {
        padding: 16px;
    }
    
    /* Info tables: full width */
    .casia-info-table {
        max-width: none;
    }
    
    /* Login */
    .casia-login-wrapper {
        padding: 20px 16px;
    }
    .casia-login-box {
        padding: 24px 20px;
    }
    
    /* Headings */
    body .casia-portal h2 { font-size: 20px !important; }
    body .casia-portal h3 { font-size: 16px !important; }
    
    /* Modal: full width on phone */
    .casia-modal-content {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    /* ACD empty state */
    .casia-acd-empty-state {
        padding: 40px 20px;
    }
}

/* =====================================================
   MODALS
   ===================================================== */
.casia-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
    padding: 20px;
}

.casia-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.casia-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--casia-border);
}

.casia-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--casia-text);
}

.casia-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--casia-text-light);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.casia-modal-close:hover {
    color: var(--casia-text);
}

.casia-modal-body {
    padding: 24px;
}

.casia-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--casia-border);
    background: #f9fafb;
    border-radius: 0 0 12px 12px;
}

/* =====================================================
   FORM ELEMENTS
   ===================================================== */
.casia-form-group {
    margin-bottom: 20px;
}

.casia-form-group:last-child {
    margin-bottom: 0;
}

.casia-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--casia-text);
    font-size: 14px;
}

.casia-form-group label .required {
    color: #dc2626;
}

.casia-input,
.casia-select,
.casia-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--casia-border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--casia-text);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.casia-input:focus,
.casia-select:focus,
.casia-textarea:focus {
    outline: none;
    border-color: var(--casia-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.casia-input:disabled {
    background: #f3f4f6;
    color: var(--casia-text-light);
}

.casia-textarea {
    resize: vertical;
    min-height: 80px;
}

.casia-help-text {
    margin-top: 4px;
    font-size: 12px;
    color: var(--casia-text-light);
}

/* =====================================================
   BUTTONS
   ===================================================== */
.casia-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    text-decoration: none;
    gap: 8px;
}

.casia-btn-primary {
    background: var(--casia-primary);
    color: #fff;
    border-color: var(--casia-primary);
}

.casia-btn-primary:hover {
    background: var(--casia-primary-dark);
    border-color: var(--casia-primary-dark);
}

.casia-btn-secondary {
    background: #e5e7eb;
    color: var(--casia-text);
    border-color: #e5e7eb;
}

.casia-btn-secondary:hover {
    background: #d1d5db;
    border-color: #d1d5db;
}

.casia-btn-outline {
    background: transparent;
    color: var(--casia-text);
    border-color: var(--casia-border);
}

.casia-btn-outline:hover {
    background: #f3f4f6;
}

.casia-btn-danger {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.casia-btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.casia-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* =====================================================
   PAGE ELEMENTS
   ===================================================== */
.casia-page-header {
    margin-bottom: 24px;
}

.casia-page-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: var(--casia-text);
}

.casia-subtitle {
    margin: 0;
    color: var(--casia-text-light);
    font-size: 14px;
}

.casia-filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.casia-filters-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.casia-filter-group {
    min-width: 150px;
}

.casia-text-muted {
    color: var(--casia-text-light);
}

.casia-info-text {
    margin-top: 20px;
    padding: 15px;
    background: #f0f9ff;
    border-radius: 8px;
    color: #0369a1;
    font-size: 14px;
}

/* =====================================================
   NOTICES
   ===================================================== */
.casia-notice {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.casia-notice-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.casia-notice-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.casia-notice-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* =====================================================
   CHECKBOX LABELS & FIELD HINTS
   ===================================================== */

.casia-checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
}

.casia-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
}

.casia-field-hint {
    margin: 4px 0 0 0;
    color: var(--casia-text-light, #6b7280);
    font-size: 12px;
    line-height: 1.4;
}
