/* Modern rectangular design - CSS reset and variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --background: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --text-secondary: #475569;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
}

/* Buttons - Rectangular, no rounded corners */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 0;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    font-size: 14px;
    font-family: inherit;
    border-radius: 0;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}

.table th {
    background: var(--background);
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}

.table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.table tr:hover {
    background: var(--background);
}

/* Cards */
.card {
    background: var(--surface);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border-radius: 0;
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.card-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--surface);
    padding: 24px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    margin-bottom: 20px;
    border-left: 4px solid;
    border-radius: 0;
}

.alert-success {
    background: #d1fae5;
    border-color: var(--success);
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    border-color: var(--danger);
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    border-color: var(--warning);
    color: #92400e;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 0;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-sent {
    background: #d1fae5;
    color: #065f46;
}

.badge-failed {
    background: #fee2e2;
    color: #991b1b;
}

.badge-cancelled {
    background: #f1f5f9;
    color: #475569;
}

/* Utility classes */
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.flex { display: flex; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--text-secondary); }
.truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile overlay for sidebar */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-overlay.active {
    display: block;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    /* Buttons */
    .btn {
        padding: 12px 16px;
        font-size: 14px;
        width: 100%;
        text-align: center;
    }
    
    .btn-sm {
        padding: 8px 12px;
        font-size: 13px;
        width: auto;
    }
    
    /* Forms */
    .form-group {
        margin-bottom: 16px;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="datetime-local"],
    select,
    textarea {
        padding: 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    label {
        font-size: 14px;
    }
    
    /* Cards */
    .card {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    .card-header {
        margin-bottom: 16px;
    }
    
    .card-title {
        font-size: 18px;
    }
    
    /* Stats grid - single column on mobile */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .stat-label {
        font-size: 13px;
    }
    
    /* Alerts */
    .alert {
        padding: 10px 12px;
        font-size: 14px;
        margin-bottom: 16px;
    }
    
    /* Flex utilities - responsive */
    .flex {
        flex-direction: column;
    }
    
    .flex.gap-2 {
        gap: 8px;
    }
    
    .justify-between {
        align-items: stretch;
    }
    
    /* Badge */
    .badge {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    /* Keep inline elements inline on mobile */
    .flex.inline-mobile {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    /* Action buttons in tables */
    .table-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .table-actions .btn,
    .table-actions form {
        width: 100%;
    }
}

/* Tablet responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .content-wrapper {
        padding: 20px;
    }
}
