/* ============================================
   Nexen Mail - Design System
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;700&family=Poppins:wght@400;600;700;900&family=Inter:wght@400;500;600&display=swap');

:root {
    --primary: #007AFF;
    --primary-dark: #0051CC;
    --primary-light: #e6f2ff;
    --bg-body: #f4f7fa;
    --sidebar-width: 260px;
    --white: #ffffff;
    --text-main: #1e293b;
    --text-muted: #94a3b8;
    --border: #eef2f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --sidebar-gradient: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ============================================
   LOGIN PAGE (Ultra Premium Light)
   ============================================ */
.login-wrapper {
    display: flex;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    background-image:
        radial-gradient(at 0% 0%, rgba(0, 122, 255, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(0, 198, 255, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(0, 122, 255, 0.05) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(0, 198, 255, 0.05) 0px, transparent 50%);
    position: relative;
    padding: 20px;
    overflow: hidden;
}

/* Floating Decorative Elements */
.login-wrapper::before,
.login-wrapper::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
}

.login-wrapper::before {
    width: 400px;
    height: 400px;
    background: rgba(0, 122, 255, 0.07);
    top: -100px;
    left: -100px;
}

.login-wrapper::after {
    width: 300px;
    height: 300px;
    background: rgba(0, 198, 255, 0.07);
    bottom: -50px;
    right: -50px;
}

.login-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 32px;
    padding: 60px 45px;
    width: 100%;
    max-width: 460px;
    position: relative;
    z-index: 10;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.04),
        0 20px 80px rgba(0, 122, 255, 0.03);
    text-align: center;
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
}

.login-logo .logo-box {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), #00c6ff);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
    box-shadow: 0 12px 24px rgba(0, 122, 255, 0.2);
    transform: rotate(-5deg);
    transition: transform 0.3s ease;
}

.login-card:hover .logo-box {
    transform: rotate(0deg) scale(1.05);
}

.login-logo .logo-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 28px;
    color: #0f172a;
    letter-spacing: -1.5px;
}

.login-card h2 {
    color: #0f172a;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 26px;
    margin-bottom: 8px;
    font-weight: 700;
}

.login-card .subtitle {
    color: #64748b;
    font-size: 15px;
    margin-bottom: 40px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 24px;
    text-align: left;
}

.form-group label {
    display: block;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    padding-left: 4px;
}

.form-control {
    width: 100%;
    padding: 16px 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    color: #1e293b;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
    transform: translateY(-1px);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 30px;
    border-radius: 16px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #0062e6 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(0, 122, 255, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 122, 255, 0.3);
    color: white;
    text-decoration: none;
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #0ea572;
    color: white;
    text-decoration: none;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
    text-decoration: none;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--bg-body);
    color: var(--text-main);
    text-decoration: none;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
    border-radius: 10px;
}

.login-error {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #991b1b;
    padding: 16px;
    border-radius: 16px;
    font-size: 14px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 500;
}

/* ============================================
   ADMIN LAYOUTS (Super Admin & Company)
   ============================================ */
.admin-wrapper {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-gradient);
    padding: 30px 20px;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.admin-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.admin-topbar {
    height: 70px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.admin-topbar h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px;
    font-weight: 700;
}

.admin-body {
    padding: 30px;
}

/* Sidebar elements */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 30px;
}

.sidebar-logo .logo-box {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), #00c6ff);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.sidebar-logo .logo-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.5px;
}

.sidebar-label {
    font-family: 'Poppins', sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 20px 0 10px 10px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    margin-bottom: 3px;
    transition: all 0.3s;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}

.sidebar-link i {
    width: 22px;
    font-size: 15px;
    text-align: center;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    text-decoration: none;
}

.sidebar-link.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.sidebar-badge {
    margin-left: auto;
    background: var(--danger);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-user-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-user-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user-info {
    flex: 1;
    overflow: hidden;
}

.sidebar-user-name {
    font-size: 13.5px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Storage usage */
.sidebar-storage {
    width: 100%;
    margin-top: 5px;
}

.storage-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.storage-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.storage-progress {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 2px;
}

/* Admin topbar user */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #f8fafc;
    padding: 6px 6px 6px 15px;
    border-radius: 14px;
    border: 1px solid var(--border);
}

.topbar-user .user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.topbar-user .user-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.topbar-user .user-email {
    font-size: 11px;
    color: var(--text-muted);
}

.topbar-user .avatar,
.avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(0, 122, 255, 0.2);
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 16px;
}

.stat-card-icon.blue {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary);
}

.stat-card-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-card-icon.orange {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-card-icon.red {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-card-icon.purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.stat-card-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Data tables */
.card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    margin-bottom: 25px;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 700;
}

.card-body {
    padding: 24px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead tr {
    background: #f8fafc;
}

.data-table th {
    padding: 14px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.data-table tbody tr:hover {
    background: #fafbfc;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-success {
    background: #d1fae5;
    color: var(--success);
}

.badge-danger {
    background: #fee2e2;
    color: var(--danger);
}

.badge-warning {
    background: #fef3c7;
    color: var(--warning);
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

/* Flash messages */
.flash-message {
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.flash-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.flash-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.flash-warning {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

/* Form styles for admin pages */
.admin-body .form-group {
    margin-bottom: 20px;
}

.admin-body .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 6px;
}

.admin-body .form-control {
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 12px 14px;
}

.admin-body .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    background: white;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    width: 100%;
}

.modal-card .form-control {
    width: 100%;
    box-sizing: border-box;
    border-radius: 12px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

textarea.form-control {
    min-height: 80px;
    resize: vertical;
}

/* ============================================
   WEBMAIL LAYOUT
   ============================================ */
.webmail-wrapper {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.webmail-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-gradient);
    display: flex;
    flex-direction: column;
    padding: 25px 16px;
    color: white;
    z-index: 100;
    flex-shrink: 0;
}

.webmail-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.webmail-topbar {
    height: 65px;
    background: var(--white);
    display: flex;
    align-items: center;
    padding: 0 30px;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.webmail-topbar h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.webmail-toolbar {
    padding: 12px 30px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.btn-tool {
    padding: 9px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: white;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
}

.btn-tool:hover {
    background: var(--bg-body);
    border-color: var(--primary);
    text-decoration: none;
}

.btn-tool.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-tool.primary:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

.webmail-body {
    flex: 1;
    padding: 25px 30px;
    overflow-y: auto;
}

/* Mail list */
.mail-list {
    background: transparent;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mail-row-container {
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.01), 0 2px 4px -1px rgba(0, 0, 0, 0.01);
}

.mail-row-container::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
    transition: height 0.3s ease;
}

.mail-row-container.unread::before {
    height: 40%;
}

.mail-row-container:hover {
    background: white;
    transform: translateX(5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 122, 255, 0.2);
    z-index: 10;
}

.mail-row {
    display: grid;
    grid-template-columns: 48px 220px 1fr 120px;
    align-items: center;
    padding: 18px 24px;
    text-decoration: none !important;
    color: inherit;
    flex: 1;
}

.mail-row.unread .mail-from {
    color: var(--text-main);
    font-weight: 800;
}

.mail-row.unread .mail-subject {
    font-weight: 700;
}

.mail-options-dropdown {
    padding-right: 24px;
    opacity: 0.4;
    transform: scale(0.95);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mail-row-container:hover .mail-options-dropdown {
    opacity: 1;
    transform: scale(1);
}

.mail-options-dropdown .action-btn {
    width: 36px;
    height: 36px;
    background: #f1f5f9;
    border: none;
    border-radius: 10px;
}

.mail-options-dropdown .action-btn:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.mail-star {
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mail-star.starred {
    color: #f59e0b;
}

.mail-star:hover {
    transform: scale(1.2);
    color: #f59e0b;
}

.mail-row.unread {
    background: rgba(0, 122, 255, 0.02);
    border-left: 4px solid var(--primary);
}

.mail-row.unread .mail-from {
    color: var(--primary);
    font-weight: 700;
}

.mail-from {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

.mail-subject {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    padding-right: 20px;
}

.mail-subject .preview {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 13px;
}

.mail-date {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    text-align: right;
    text-transform: uppercase;
}

.mail-attachment {
    color: #94a3b8;
    margin-left: 8px;
    font-size: 12px;
}

.mail-empty {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 24px;
    border: 2px dashed var(--border);
}

.mail-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
    color: var(--border);
}

.mail-empty p {
    font-size: 15px;
}

/* Email viewer */
.email-viewer {
    background: var(--white);
    border-radius: 14px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.email-header {
    border-bottom: 2px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.email-subject {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
}

.email-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 13px;
    flex-wrap: wrap;
}

.email-meta .avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary), #00c6ff);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
}

.email-body {
    line-height: 1.8;
    color: var(--text-main);
    font-size: 14px;
    white-space: pre-line;
}

/* Compose form */
.compose-card {
    background: var(--white);
    border-radius: 14px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.compose-card .form-group {
    margin-bottom: 18px;
}

.compose-card .form-group label {
    color: var(--text-main);
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    display: block;
}

.compose-card .form-control {
    background: white;
    color: var(--text-main);
    border-color: var(--border);
}

.compose-card .form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.compose-card textarea.form-control {
    min-height: 250px;
}

/* Contacts grid */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.contact-card {
    background: var(--white);
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.3s;
}

.contact-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.contact-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.contact-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), #00c6ff);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.contact-name {
    font-weight: 700;
    font-size: 14px;
}

.contact-company {
    font-size: 12px;
    color: var(--text-muted);
}

.contact-info {
    font-size: 13px;
    color: var(--text-muted);
}

.contact-info div {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.contact-info i {
    width: 16px;
    color: var(--primary);
    font-size: 12px;
}

/* Calendar */
.calendar-card {
    background: var(--white);
    border-radius: 14px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.calendar-header h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 700;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.cal-head {
    text-align: center;
    font-weight: 700;
    padding: 10px;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
}

.cal-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 500;
}

.cal-cell:hover {
    background: var(--bg-body);
}

.cal-cell.today {
    background: var(--primary);
    color: white;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
}

.cal-cell.other-month {
    color: var(--text-muted);
    opacity: 0.4;
}

/* Settings */
.settings-card {
    background: var(--white);
    border-radius: 14px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
}

.settings-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.settings-card .form-group label {
    color: var(--text-main);
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 6px;
    display: block;
}

.settings-card .form-control {
    background: white;
    color: var(--text-main);
    border-color: var(--border);
}

/* Progress bars */
.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #00c6ff);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Action buttons group */
.actions-group {
    display: flex;
    gap: 6px;
}

/* Mobile hamburger */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1000;
    width: 42px;
    height: 42px;
    background: var(--primary);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    align-items: center;
    justify-content: center;
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.mobile-overlay.active {
    display: block;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .contacts-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .admin-sidebar,
    .webmail-sidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        transition: left 0.3s;
        z-index: 200;
    }

    .admin-sidebar.active,
    .webmail-sidebar.active {
        left: 0;
    }

    .admin-content {
        margin-left: 0;
    }

    .admin-topbar {
        padding-left: 65px;
    }

    .webmail-topbar {
        padding-left: 65px;
    }

    .admin-body {
        padding: 20px 15px;
    }

    .webmail-body {
        padding: 15px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .mail-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 10px;
    }

    .login-card {
        margin: 20px;
        padding: 35px 25px;
    }
}

@media (max-width: 480px) {
    .admin-topbar h1 {
        font-size: 18px;
    }

    .webmail-topbar h1 {
        font-size: 16px;
    }

    .stat-card-value {
        font-size: 26px;
    }

    .contacts-grid {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Utility classes */
.text-muted {
    color: var(--text-muted);
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}

.mt-3 {
    margin-top: 24px;
}

.mb-1 {
    margin-bottom: 8px;
}

.mb-2 {
    margin-bottom: 16px;
}

.mb-3 {
    margin-bottom: 24px;
}

.d-flex {
    display: flex;
}

.gap-2 {
    gap: 12px;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

/* ============================================
   WEBMAIL TOPBAR & NAVIGATION (Premium)
   ============================================ */
.webmail-topbar {
    height: 70px;
    background: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 20px;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.topbar-left h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

.menu-toggle-btn {
    display: none;
    background: #f1f5f9;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    color: var(--text-main);
    cursor: pointer;
}

.topbar-search {
    flex: 1;
    max-width: 600px;
    position: relative;
    display: flex;
    align-items: center;
}

.topbar-search i {
    position: absolute;
    left: 18px;
    color: var(--text-muted);
    font-size: 14px;
}

.topbar-search input {
    width: 100%;
    padding: 12px 20px 12px 48px;
    background: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 14px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: all 0.2s;
}

.topbar-search input:focus {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.08);
    outline: none;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 30px;
}

.topbar-tools {
    display: flex;
    align-items: center;
    gap: 5px;
}

.tool-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s;
}

.tool-btn:hover {
    background: #f1f5f9;
    color: var(--primary);
}

.tool-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border: 2px solid white;
    border-radius: 50%;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 20px;
    border-left: 1px solid #e2e8f0;
}

.topbar-user .user-info {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.topbar-user .user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

.topbar-user .user-email {
    font-size: 12px;
    color: var(--text-muted);
}

.topbar-user .avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #00c6ff);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 122, 255, 0.2);
}

/* ============================================
   NOTES UI
   ============================================ */
.add-note-btn {
    background: white;
    border: 2px dashed #cbd5e1;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 200px;
}

.add-note-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.add-note-btn i {
    font-size: 24px;
}

.add-note-btn span {
    font-weight: 600;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 25px;
}

.note-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.note-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.note-card .note-color-tag {
    position: absolute;
    top: 0;
    left: 25px;
    width: 40px;
    height: 6px;
    border-radius: 0 0 4px 4px;
}

.note-card h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--text-main);
}

.note-card p {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 15px;
}

.note-card .note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 15px;
    margin-top: auto;
}

.note-card .note-date {
    font-size: 12px;
    color: var(--text-muted);
}

/* ============================================
   CALENDAR UI ENHANCEMENTS
   ============================================ */
.webmail-body {
    display: flex;
    gap: 25px;
    padding: 25px;
    width: 100%;
}

.calendar-card {
    flex: 1;
    background: white;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
}

.calendar-header {
    margin-bottom: 25px;
}

.calendar-header h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 700;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.cal-head {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-bottom: 10px;
}

.cal-cell {
    aspect-ratio: 1/1;
    border-radius: 12px;
    padding: 10px;
    font-size: 14px;
    font-weight: 500;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: #f8fafc;
    border: 1px solid transparent;
}

.cal-cell:hover:not(.other-month) {
    background: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.cal-cell.today {
    background: var(--primary);
    color: white;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0, 122, 255, 0.3);
}

.cal-cell.other-month {
    opacity: 0.3;
}

.event-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-top: 4px;
}

.cal-cell.today .event-dot {
    border: 1px solid white;
}

.calendar-sidebar-events {
    width: 320px;
    background: white;
    border-radius: 24px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 700;
}

.event-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 16px;
    background: #f8fafc;
    margin-bottom: 12px;
    transition: transform 0.2s;
    border: 1px solid transparent;
}

.event-item:hover {
    transform: translateX(5px);
    background: white;
    border-color: var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.event-item .event-color {
    width: 5px;
    height: 35px;
    border-radius: 4px;
}

.event-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.event-time {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

.event-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
}

/* Global Action Button */
.action-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-btn:hover {
    background: #f1f5f9;
    color: var(--danger);
}

/* ============================================
   NEW UI COMPONENTS (Dropdowns, Notifs, etc)
   ============================================ */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 5px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
    margin-top: 15px;
    padding: 10px 0;
    display: none;
    z-index: 1000;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.dropdown.active .dropdown-menu {
    display: block;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    padding: 15px 20px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}

.dropdown-body {
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-footer {
    display: block;
    width: 100%;
    padding: 12px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    border-top: 1px solid var(--border);
    cursor: pointer;
}

.dropdown-footer:hover {
    background: var(--primary-light);
}

/* Notifications */
.notifications-dropdown {
    width: 380px !important;
}

.notification-item {
    display: flex;
    gap: 15px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    background: white;
}

.notification-item:hover {
    background: #f8fafc;
    transform: none;
}


.notification-item.unread {
    background: rgba(0, 122, 255, 0.04);
}

.notif-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.notif-icon.primary {
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary);
}

.notif-icon.warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.notif-icon.danger {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.notif-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.notif-icon.purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.notif-content {
    flex: 1;
}

.notif-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 3px;
    line-height: 1.4;
}

.notif-body {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 6px;
}

.notif-time {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}

.dropdown-menu-right {
    right: 0;
    left: auto;
}

.dropdown-divider {
    height: 1px;
    margin: 10px 0;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.04);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 24px;
    clear: both;
    font-weight: 500;
    color: #475569;
    text-align: inherit;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
    font-size: 13.5px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
    color: var(--primary);
    padding-left: 24px;
    text-decoration: none;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: #94a3b8;
    font-size: 15px;
    transition: color 0.2s;
}

.dropdown-item:hover i {
    color: var(--primary);
}

.dropdown-item.text-danger:hover {
    background-color: #fef2f2;
    color: var(--danger);
}

.dropdown-item.text-danger:hover i {
    color: var(--danger);
}

/* Apps Dropdown */
.apps-dropdown {
    width: 280px;
    padding: 20px 0;
}

/* ============================================
   RESPONSIVENESS (Mobile & Tablet)
   ============================================ */

/* Mobile Menu Button & Overlay */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
}

.mobile-overlay.active {
    display: block;
}

@media (max-width: 1200px) {
    .webmail-right-sidebar {
        display: none;
    }
}

@media (max-width: 1024px) {
    .webmail-topbar {
        padding: 0 15px;
    }

    .topbar-search {
        max-width: 200px;
    }
}

@media (max-width: 768px) {

    .webmail-sidebar,
    .admin-sidebar {
        position: fixed;
        left: -100% !important;
        top: 0;
        bottom: 0;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        width: 280px;
    }

    .webmail-sidebar.active,
    .admin-sidebar.active {
        left: 0 !important;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .webmail-topbar {
        padding-left: 70px;
    }

    .topbar-search {
        display: none;
    }

    .webmail-toolbar {
        padding: 10px 15px;
    }

    .webmail-body {
        padding: 15px;
    }

    /* Mail List Mobile */
    .mail-row {
        grid-template-columns: 40px 1fr 60px;
        gap: 10px;
    }

    .mail-from {
        grid-column: 2;
        font-size: 12px;
    }

    .mail-subject {
        grid-column: 2;
    }

    .mail-date {
        grid-column: 3 !important;
        grid-row: 1 / 3 !important;
        align-self: center;
        text-align: right;
    }

    /* Grids Mobile */
    .stats-grid,
    .contacts-grid,
    .form-grid {
        grid-template-columns: 1fr !important;
    }

    .stat-card-value {
        font-size: 24px;
    }

    /* Modals Mobile */
    .modal-content {
        width: 95% !important;
        margin: 10px auto !important;
        padding: 20px !important;
    }

    /* Settings Cards */
    .settings-card {
        padding: 20px !important;
    }

    /* Calendar Grid Mobile */
    .calendar-grid {
        gap: 4px !important;
    }

    .cal-cell {
        font-size: 12px !important;
        padding: 5px !important;
    }

    .webmail-body {
        gap: 15px !important;
    }

    .calendar-card {
        padding: 15px !important;
    }

    .webmail-wrapper {
        height: auto;
        min-height: 100vh;
    }
}

.apps-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none !important;
}

.app-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    transition: transform 0.2s;
}

.app-item:hover .app-icon {
    transform: translateY(-3px) scale(1.05);
}

.app-item span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
}

/* ============================================
   WEBMAIL THREE-COLUMN LAYOUT
   ============================================ */
.webmail-body-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.webmail-body {
    flex: 1;
    overflow-y: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    /* FORCED COLUMN FOR STACKING */
    gap: 25px;
    padding: 25px;
}

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    width: 100%;
}

.contact-card {
    background: white;
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border);
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.contact-card-header {
    display: flex;
    gap: 15px;
    align-items: center;
}

.contact-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.contact-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-main);
}

.contact-company {
    font-size: 12px;
    color: var(--text-muted);
}

.contact-info {
    font-size: 13px;
    color: #475569;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.contact-info i {
    width: 20px;
    color: var(--primary);
}

.contact-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

.compose-card,
.calendar-card {
    width: 100%;
}

.settings-card {
    width: 100%;
    background: var(--white);
    border-radius: 24px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border);
}

.settings-card h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}

/* ========================
   MODALS (GLOBAL)
   ======================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-card {
    background: white;
    padding: 35px;
    border-radius: 28px;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    animation: modalAppear 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

/* ========================
   NOTES GRID & CARDS
   ======================== */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

.add-note-btn {
    height: 100%;
    min-height: 200px;
    background: white;
    border: 2px dashed var(--border);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.add-note-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 122, 255, 0.02);
}

.add-note-btn i {
    font-size: 24px;
}

.note-card {
    background: white;
    border-radius: 24px;
    padding: 25px;
    border: 1px solid var(--border);
    transition: all 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-height: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.note-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
    border-color: var(--primary);
}

.note-color-tag {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.note-card h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 17px;
    margin: 0;
    padding-right: 20px;
}

.note-card p {
    font-size: 14px;
    line-height: 1.6;
    color: #475569;
    flex: 1;
    margin: 0;
}

.note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

.note-date {
    font-size: 12px;
    color: var(--text-muted);
}

.webmail-right-sidebar {
    width: 300px;
    background: var(--white);
    border-left: 1px solid var(--border);
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-card {
    background: #f8fafc;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.sidebar-card .card-header {
    padding: 15px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-card h4 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 700;
    margin: 0;
}

.sidebar-card .card-body {
    padding: 15px;
}

.btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
}

.note-mini-card {
    padding: 12px;
    background: white;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.note-mini-card strong {
    display: block;
    font-size: 12px;
    margin-bottom: 4px;
}

.note-mini-card p {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0;
}

.event-mini-card {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.event-date {
    width: 38px;
    height: 42px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}

.event-info strong {
    display: block;
    font-size: 12px;
}

.event-info span {
    font-size: 11px;
    color: var(--text-muted);
}

.empty-text {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    padding: 20px 0;
}

/* ============================================
   RESPONSIVENESS (Mobile & Tablet)
   ============================================ */

/* Mobile Menu Button & Overlay */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
}

.mobile-overlay.active {
    display: block;
}

@media (max-width: 1200px) {
    .webmail-right-sidebar {
        display: none;
    }
}

@media (max-width: 1024px) {
    .webmail-topbar {
        padding: 0 15px;
    }

    .topbar-search {
        max-width: 200px;
    }
}

@media (max-width: 768px) {

    .webmail-sidebar,
    .admin-sidebar {
        position: fixed;
        left: -100% !important;
        top: 0;
        bottom: 0;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        width: 280px;
    }

    .webmail-sidebar.active,
    .admin-sidebar.active {
        left: 0 !important;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .webmail-topbar,
    .admin-topbar {
        padding-left: 70px !important;
    }

    .topbar-search {
        display: none;
    }

    .webmail-toolbar {
        padding: 10px 15px;
        flex-wrap: wrap;
    }

    .webmail-body,
    .admin-body {
        padding: 15px !important;
    }

    /* Admin Sidebar Fixes */
    .admin-sidebar {
        padding: 30px 20px !important;
    }

    .admin-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    /* Mail List Mobile */
    .mail-row {
        grid-template-columns: 40px 1fr 60px !important;
        gap: 10px !important;
    }

    .mail-from {
        grid-column: 2;
        font-size: 13px;
    }

    .mail-subject {
        grid-column: 2;
        font-size: 14px;
        white-space: normal !important;
        word-break: break-all;
    }

    .mail-date {
        grid-column: 3 !important;
        grid-row: 1 / 3 !important;
        align-self: center;
        text-align: right;
        font-size: 10px;
    }

    /* Grids Mobile */
    .stats-grid,
    .contacts-grid,
    .form-grid {
        grid-template-columns: 1fr !important;
    }

    .stat-card-value {
        font-size: 24px;
    }

    /* Modals Mobile */
    .modal-content {
        width: 95% !important;
        margin: 10px auto !important;
        padding: 20px !important;
    }

    /* Settings Cards */
    .settings-card {
        padding: 20px !important;
    }

    /* Calendar Grid Mobile */
    .calendar-grid {
        gap: 4px !important;
    }

    .cal-cell {
        font-size: 12px !important;
        padding: 5px !important;
    }

    .webmail-body {
        gap: 15px !important;
        padding: 15px !important;
    }

    .calendar-card {
        padding: 15px !important;
    }

    .webmail-wrapper {
        height: auto;
        min-height: 100vh;
    }
}/ *   S t a t s   G r i d s   * / 
 . s t a t s - g r i d   { 
         d i s p l a y :   g r i d ; 
         g r i d - t e m p l a t e - c o l u m n s :   r e p e a t ( a u t o - f i t ,   m i n m a x ( 2 4 0 p x ,   1 f r ) ) ; 
         g a p :   2 5 p x ; 
         m a r g i n - b o t t o m :   3 0 p x ; 
 } 
 
 . s t a t - c a r d   { 
         b a c k g r o u n d :   w h i t e ; 
         p a d d i n g :   3 0 p x ; 
         b o r d e r - r a d i u s :   2 4 p x ; 
         d i s p l a y :   f l e x ; 
         f l e x - d i r e c t i o n :   c o l u m n ; 
         g a p :   1 5 p x ; 
         b o r d e r :   1 p x   s o l i d   v a r ( - - b o r d e r ) ; 
         t r a n s i t i o n :   a l l   0 . 3 s   c u b i c - b e z i e r ( 0 . 4 ,   0 ,   0 . 2 ,   1 ) ; 
 } 
 
 . s t a t - c a r d : h o v e r   { 
         t r a n s f o r m :   t r a n s l a t e Y ( - 5 p x ) ; 
         b o x - s h a d o w :   0   1 5 p x   3 5 p x   r g b a ( 0 ,   0 ,   0 ,   0 . 0 5 ) ; 
         b o r d e r - c o l o r :   v a r ( - - p r i m a r y ) ; 
 } 
 
 . s t a t - c a r d - i c o n   { 
         w i d t h :   5 4 p x ; 
         h e i g h t :   5 4 p x ; 
         b o r d e r - r a d i u s :   1 6 p x ; 
         d i s p l a y :   f l e x ; 
         a l i g n - i t e m s :   c e n t e r ; 
         j u s t i f y - c o n t e n t :   c e n t e r ; 
         f o n t - s i z e :   2 2 p x ; 
 } 
 
 . s t a t - c a r d - i c o n . b l u e       {   b a c k g r o u n d :   # e 6 f 2 f f ;   c o l o r :   # 0 0 7 A F F ;   } 
 . s t a t - c a r d - i c o n . g r e e n     {   b a c k g r o u n d :   # e 0 f 8 e d ;   c o l o r :   # 1 0 b 9 8 1 ;   } 
 . s t a t - c a r d - i c o n . o r a n g e   {   b a c k g r o u n d :   # f f f 4 e 5 ;   c o l o r :   # f 5 9 e 0 b ;   } 
 . s t a t - c a r d - i c o n . p u r p l e   {   b a c k g r o u n d :   # f 3 e 8 f f ;   c o l o r :   # 8 b 5 c f 6 ;   } 
 
 . s t a t - c a r d - v a l u e   { 
         f o n t - s i z e :   3 2 p x ; 
         f o n t - w e i g h t :   8 0 0 ; 
         f o n t - f a m i l y :   ' S p a c e   G r o t e s k ' ,   s a n s - s e r i f ; 
         c o l o r :   v a r ( - - t e x t - m a i n ) ; 
         l i n e - h e i g h t :   1 ; 
 } 
 
 . s t a t - c a r d - l a b e l   { 
         f o n t - s i z e :   1 3 p x ; 
         f o n t - w e i g h t :   6 0 0 ; 
         c o l o r :   v a r ( - - t e x t - m u t e d ) ; 
         t e x t - t r a n s f o r m :   u p p e r c a s e ; 
         l e t t e r - s p a c i n g :   0 . 5 p x ; 
 } 
 
 . d a s h b o a r d - s e c o n d a r y - g r i d   { 
         d i s p l a y :   g r i d ; 
         g r i d - t e m p l a t e - c o l u m n s :   1 f r   1 f r ; 
         g a p :   2 5 p x ; 
         m a r g i n - b o t t o m :   2 5 p x ; 
 } 
 
 . c a r d   { 
         b a c k g r o u n d :   w h i t e ; 
         b o r d e r - r a d i u s :   2 4 p x ; 
         b o r d e r :   1 p x   s o l i d   v a r ( - - b o r d e r ) ; 
         o v e r f l o w :   h i d d e n ; 
         b o x - s h a d o w :   0   4 p x   1 2 p x   r g b a ( 0 ,   0 ,   0 ,   0 . 0 2 ) ; 
 } 
 
 . c a r d - h e a d e r   { 
         p a d d i n g :   2 0 p x   2 5 p x ; 
         b o r d e r - b o t t o m :   1 p x   s o l i d   v a r ( - - b o r d e r ) ; 
         d i s p l a y :   f l e x ; 
         j u s t i f y - c o n t e n t :   s p a c e - b e t w e e n ; 
         a l i g n - i t e m s :   c e n t e r ; 
 } 
 
 . c a r d - h e a d e r   h 3   { 
         m a r g i n :   0 ; 
         f o n t - s i z e :   1 6 p x ; 
         f o n t - w e i g h t :   7 0 0 ; 
         f o n t - f a m i l y :   ' S p a c e   G r o t e s k ' ,   s a n s - s e r i f ; 
 } 
 
 . c a r d - b o d y   { 
         p a d d i n g :   2 5 p x ; 
 } 
  
 
/* Premium User Components Override */
.sidebar-user { display: flex; flex-direction: column; gap: 15px; padding: 16px !important; background: rgba(255, 255, 255, 0.04) !important; backdrop-filter: blur(10px); border-radius: 18px !important; border: 1px solid rgba(255, 255, 255, 0.08) !important; transition: all 0.3s ease; }
.sidebar-user:hover { background: rgba(255, 255, 255, 0.06) !important; border-color: rgba(255, 255, 255, 0.12) !important; }
.sidebar-user-avatar { width: 44px; height: 44px; background: linear-gradient(135deg, var(--primary) 0%, #00c6ff 100%) !important; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; color: white; box-shadow: 0 4px 15px rgba(0, 122, 255, 0.4) !important; border: 2px solid rgba(255, 255, 255, 0.1); position: relative; overflow: hidden; }
.sidebar-user-avatar::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(rgba(255,255,255,0.2), transparent); }
.topbar-user { display: flex; align-items: center; gap: 12px; background: rgba(248, 250, 252, 0.8) !important; backdrop-filter: blur(8px); padding: 6px 6px 6px 14px !important; border-radius: 18px !important; border: 1px solid rgba(226, 232, 240, 0.8) !important; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); cursor: pointer; }
.topbar-user:hover { background: white !important; border-color: var(--primary) !important; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); transform: translateY(-1px); }
.topbar-user .avatar, .avatar { width: 36px; height: 36px; background: linear-gradient(135deg, var(--primary) 0%, #00c6ff 100%) !important; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; font-weight: 800; font-size: 14px; box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3) !important; position: relative; overflow: hidden; }
.avatar::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(rgba(255,255,255,0.2), transparent); }

