/* style.css - Complete Integrated Stylesheet */

/* 1. Variables & Global Reset */
:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-main: #f8fafc;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-accent: #38bdf8;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --white: #ffffff;
    
    /* Status Colors */
    --status-pending-bg: #fef9c3;
    --status-pending-text: #854d0e;
    --status-sent-bg: #dcfce7;
    --status-sent-text: #166534;
    --status-failed-bg: #fee2e2;
    --status-failed-text: #991b1b;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
}

/* 2. Layout Structure */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    color: var(--white);
    padding: 2.5rem 1.5rem;
    position: fixed; /* Keep sidebar locked */
    height: 100vh;
    z-index: 100;
}

.main-content {
    margin-left: 260px; /* Must match sidebar width */
    padding: 3rem;
    width: calc(100% - 260px);
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.header-bar h1 {
    font-size: 1.875rem;
    font-weight: 700;
}

/* 3. Navigation & Sidebar Items */
.sidebar h2 {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: var(--sidebar-accent);
    letter-spacing: -0.025em;
}

.sidebar nav a {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.sidebar nav a:hover, 
.sidebar nav a.active {
    background: var(--sidebar-hover);
    color: var(--white);
}

/* 4. Filter Buttons */
.filter-group {
    margin-bottom: 2rem;
    display: flex;
    gap: 0.75rem;
}

.btn-filter {
    padding: 0.5rem 1.25rem;
    background: var(--white);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-filter:hover {
    background: #f1f5f9;
    color: var(--text-main);
}

.btn-filter.active {
    background: var(--sidebar-bg);
    color: var(--white);
    border-color: var(--sidebar-bg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* 5. Components & Tables */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

th {
    text-align: left;
    background: #f8fafc;
    padding: 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
}

.badge {
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
}

.status-badge {
    padding: 0.35rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-pending { background: var(--status-pending-bg); color: var(--status-pending-text); }
.status-sent { background: var(--status-sent-bg); color: var(--status-sent-text); }
.status-failed { background: var(--status-failed-bg); color: var(--status-failed-text); }

.delete-link {
    color: #ef4444;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.delete-link:hover {
    background: #fff1f2;
}

/* 6. Buttons & Forms */
.btn {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: var(--primary-hover);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}