:root {
    --primary: #0f172a;
    --primary-light: #1e293b;
    --accent: #059669;
    --accent-hover: #047857;
    --success: #10b981;
    --error: #ef4444;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --text: #0f172a;
    --text-light: #64748b;
    --text-muted: #94a3b8;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #e2e8f0;
    --green-light: #d1fae5;
    --green-dark: #065f46;
    --sidebar-width: 220px;
}

* {
    box-sizing: border-box;
}

html, body {
    min-height: 100vh;
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

/* Sidebar Styles matching UnlockMail */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 50;
}

.sidebar-header {
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.brand-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.brand-title {
    font-weight: 800;
    color: #0f172a;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    line-height: 1;
}

.brand-badge {
    font-weight: 700;
    color: var(--accent);
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 2px;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.85rem;
    border-radius: 8px;
    color: #475569;
    font-weight: 600;
    font-size: 0.82rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.nav-item.active {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 700;
}

.nav-item svg {
    width: 17px;
    height: 17px;
    color: inherit;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    background: #f8fafc;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--bg);
}

.top-bar {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 40;
}

.wrap {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 1.75rem 2.25rem;
    flex: 1 0 auto;
}

/* Buttons matching UnlockMail */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.15rem;
    background: var(--accent);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.25);
}

.btn-primary {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: #ffffff;
    border: none;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

.btn-secondary {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: #f1f5f9;
}

.btn-danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}

.btn-danger:hover {
    background: #ef4444;
    color: #ffffff;
}

/* Cards & Widgets matching UnlockMail */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

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

.stat-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #ecfdf5;
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Tables matching UnlockMail */
.table-container {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
}

table th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    color: #1e293b;
}

table tr:last-child td {
    border-bottom: none;
}

table tr:hover td {
    background: #f8fafc;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: var(--green-light);
    color: var(--green-dark);
}

.badge-muted {
    background: #f1f5f9;
    color: #475569;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

/* Form Elements */
input, select, textarea {
    width: 100%;
    padding: 0.65rem 0.95rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    color: #0f172a;
    background: #ffffff;
    transition: border 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.12);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
