/**
 * StarStrap Application Styling System
 *
 * @package StarStrap
 */

:root {
    --emp-border: #d0d6d9;
    --emp-main-bg: #edf0f3;
    --emp-blue: #0072f0;
    --emp-blue-hover: #005bb5;
    --emp-grey: #646871;
    --emp-dark-grey: #1e2229;
    --emp-card-bg: #ffffff;
    --emp-accent-success: #10b981;
    --emp-accent-danger: #ef4444;
    --emp-radius: 16px;
    --emp-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --emp-font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --emp-font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body.starstrap-portal {
    background-color: var(--emp-main-bg);
    font-family: var(--emp-font-body);
    color: #334155;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* App Wrapper & Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.app-sidebar {
    width: 260px;
    background-color: var(--emp-dark-grey);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.08);
    z-index: 100;
}

.app-sidebar .sidebar-brand {
    padding: 24px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-sidebar .sidebar-brand img {
    max-width: 180px;
    max-height: 55px;
    height: auto;
}

.app-sidebar .sidebar-brand h2 {
    font-family: var(--emp-font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    letter-spacing: -0.02em;
}

.app-sidebar .sidebar-brand h2 span {
    color: var(--emp-blue);
}

.sidebar-menu {
    list-style: none;
    padding: 15px 10px;
    margin: 0;
    flex-grow: 1;
}

.sidebar-menu li {
    margin-bottom: 6px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.sidebar-menu li a i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-menu li a:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.sidebar-menu li.active a {
    color: #ffffff;
    background: var(--emp-blue);
    font-weight: 600;
}

.sidebar-footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
}

/* Header Topbar */
.app-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    background: #ffffff;
    height: 70px;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--emp-border);
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.app-topbar .page-title {
    font-family: var(--emp-font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--emp-dark-grey);
    margin: 0;
}

.app-topbar .user-badge {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-topbar .user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--emp-blue);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* Main Content Container */
.app-content {
    padding: 30px;
    flex-grow: 1;
}

/* SaaS Cards (`.sbox` / `.app-card`) */
.sbox, .app-card {
    background: var(--emp-card-bg);
    border: 1px solid var(--emp-border);
    border-radius: var(--emp-radius);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--emp-shadow);
}

.app-card-title {
    font-family: var(--emp-font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--emp-dark-grey);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Segmented Control (Email / SMS Toggle) */
.segmented-control {
    display: inline-flex;
    background: #e2e8f0;
    padding: 4px;
    border-radius: 12px;
    width: 100%;
    margin-bottom: 24px;
}

.segmented-control .segment-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    color: #64748b;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.segmented-control .segment-btn.active {
    background: #ffffff;
    color: var(--emp-blue);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Form Controls */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.88rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 8px;
}

.form-control, .form-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background-color: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--emp-blue);
    box-shadow: 0 0 0 3px rgba(0, 114, 240, 0.15);
    outline: none;
}

/* Primary Action Buttons */
.btn-primary-action {
    background-color: var(--emp-blue);
    color: #ffffff;
    border: none;
    padding: 14px 28px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 10px;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-primary-action:hover {
    background-color: var(--emp-blue-hover);
}

.btn-primary-action:active {
    transform: scale(0.99);
}

/* SMS Preview Bubble UI */
.sms-preview-card {
    background: #000000;
    border-radius: 24px;
    padding: 30px 20px;
    color: #ffffff;
    max-width: 380px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.sms-preview-header {
    text-align: center;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sms-bubble {
    background: #262626;
    color: #ffffff;
    padding: 14px 18px;
    border-radius: 18px 18px 18px 4px;
    font-size: 0.92rem;
    line-height: 1.45;
    margin-top: 10px;
    word-break: break-word;
}

.sms-bubble a {
    color: #38bdf8;
    text-decoration: underline;
}

/* Email Preview Layout */
.email-preview-card {
    border: 1px solid var(--emp-border);
    border-radius: 12px;
    background: #f8fafc;
    padding: 20px;
}

.email-preview-inner {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px;
}

/* Stats Metric Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid var(--emp-border);
    border-radius: var(--emp-radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.stat-card .stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: rgba(0, 114, 240, 0.1);
    color: var(--emp-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-value {
    font-family: var(--emp-font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--emp-dark-grey);
    line-height: 1;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 4px;
}

/* Table Styling */
.table-custom {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.table-custom th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 12px 16px;
    border-bottom: 1px solid var(--emp-border);
}

.table-custom td {
    padding: 14px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}

.table-custom tr:hover td {
    background: #f8fafc;
}

/* Status Badges */
.status-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pill.accepted, .status-pill.sent, .status-pill.delivered {
    background: #d1fae5;
    color: #065f46;
}

.status-pill.pending {
    background: #fef3c7;
    color: #92400e;
}

.status-pill.failed {
    background: #fee2e2;
    color: #991b1b;
}

/* Responsive UI Adjustments */
@media (max-width: 992px) {
    .app-wrapper {
        flex-direction: column;
    }
    .app-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .app-content {
        padding: 16px;
    }
}
