/* RESET & BASE */
#amd-app-wrapper {
    display: flex;
    height: 750px;
    width: 100%;
    margin: 0 auto;
    font-family: 'Inter', sans-serif;
    background: #f7f9fc;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.05);
    overflow: hidden;
    color: #2d3748;
}

#amd-app-wrapper * {
    box-sizing: border-box;
}

button {
    cursor: pointer;
    border: none;
    background: transparent;
}

/* =========================================
   1. LEFT SIDEBAR
   ========================================= */
.amd-sidebar {
    width: 280px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    padding: 30px 20px;
    border-right: 1px solid #edf2f7;
    z-index: 10;
}

.amd-brand-title {
    font-size: 11px;
    font-weight: 700;
    color: #a0aec0;
    letter-spacing: 1px;
    margin-bottom: 40px;
    text-align: center;
}

.amd-profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
}
.amd-avatar-large {
    width: 70px;
    height: 70px;
    background: var(--amd-color-1);
    color: white;
    font-size: 24px;
    font-weight: 600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}
.amd-profile-name {
    font-size: 16px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 4px;
}
.amd-profile-email {
    font-size: 12px;
    color: #a0aec0;
    margin-bottom: 15px;
}
.amd-profile-actions {
    display: flex;
    gap: 15px;
}
.amd-profile-actions button {
    color: var(--amd-color-1);
    background: #ebf8ff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: 0.2s;
}
.amd-profile-actions button:hover {
    background: #bee3f8;
}
.amd-profile-actions button .dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #f56565;
    border-radius: 50%;
    border: 2px solid white;
}

.amd-stats-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #edf2f7;
}
.amd-progress-bar {
    width: 100%;
    height: 4px;
    background: #edf2f7;
    border-radius: 2px;
    margin-bottom: 15px;
    overflow: hidden;
}
.amd-progress-bar .fill {
    width: 12%; /* Example */
    height: 100%;
    background: var(--amd-color-1);
    border-radius: 2px;
}
.amd-stats-row {
    display: flex;
    justify-content: space-between;
}
.stat-col {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.stat-col strong {
    font-size: 16px;
    font-weight: 700;
    color: #1a202c;
}
.stat-col span {
    font-size: 10px;
    color: #a0aec0;
    margin-top: 4px;
}

.amd-nav-title {
    font-size: 11px;
    font-weight: 700;
    color: #a0aec0;
    letter-spacing: 1px;
    margin-bottom: 15px;
}
.amd-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}
.amd-nav-menu li {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    margin: 4px 0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    cursor: pointer;
    transition: 0.2s;
}
.amd-nav-menu li:hover { background: #f8fafc; color: #1a202c; }
.amd-nav-menu li.active { background: #f1f5f9; color: #1a202c; font-weight: 500; }
.amd-nav-menu li:hover .amd-delete-client-btn { display: block !important; }
.amd-nav-menu li .ring {
    display: inline-block;
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid;
    margin-right: 12px;
}
.ring-blue { border-color: var(--amd-color-1); }
.ring-pink { border-color: #ec4899; }
.ring-purple { border-color: #8b5cf6; }

.amd-team-avatars {
    display: flex;
    gap: 8px;
}
.team-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: white;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* =========================================
   2. MIDDLE LIST PANEL
   ========================================= */
.amd-list-panel {
    width: 400px;
    background: #f7f9fc; /* Very faint blue/grey */
    display: flex;
    flex-direction: column;
    border-right: 1px solid #edf2f7;
    position: relative;
}

.amd-list-header {
    padding: 25px 30px;
}
.amd-search-box {
    background: #ffffff;
    border-radius: 20px;
    display: flex;
    align-items: center;
    padding: 10px 15px;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.amd-search-box input {
    border: none;
    background: transparent;
    width: 100%;
    margin-left: 10px;
    font-size: 13px;
    outline: none;
    color: #2d3748;
}

.amd-list-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.amd-list-title {
    font-size: 11px;
    font-weight: 700;
    color: #2d3748;
    letter-spacing: 1px;
}

.amd-list-tools {
    display: flex;
    justify-content: space-between;
    padding: 0 30px 15px 30px;
    align-items: center;
}
.amd-sort-select {
    border: none;
    background: transparent;
    font-size: 12px;
    color: #718096;
    outline: none;
    cursor: pointer;
}
.amd-mark-read-dropdown {
    font-size: 11px;
    color: var(--amd-color-1);
    background: #ebf8ff;
    border-radius: 12px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    transition: 0.2s;
}
.amd-mark-read-dropdown:hover {
    background: #bee3f8;
}
.amd-pagination-controls {
    display: flex;
    align-items: center;
}
.amd-pagination-controls button {
    color: #a0aec0;
}
.amd-pagination-controls button:disabled {
    opacity: 0.5;
}
#amd-page-input {
    width: 35px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 11px;
    color: #a0aec0;
    text-align: center;
    outline: none;
    padding: 2px 0;
    margin: 0 4px;
    -moz-appearance: textfield;
}
#amd-page-input:hover, #amd-page-input:focus {
    border-color: #cbd5e0;
    background: #ffffff;
    color: #2d3748;
}
#amd-page-input::-webkit-outer-spin-button,
#amd-page-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#amd-page-total {
    font-size: 11px;
    color: #a0aec0;
    margin-right: 8px;
    white-space: nowrap;
}

.amd-email-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px; /* Padding for hover effect */
    padding-bottom: 80px; /* space for button */
}
.amd-email-list::-webkit-scrollbar {
    width: 4px;
}
.amd-email-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

/* Email Item */
.amd-email-item {
    display: flex;
    padding: 20px 10px;
    border-bottom: 1px solid #edf2f7;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: center;
}
.amd-email-item.active {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(47, 106, 239, 0.1);
    transform: scale(1.02);
    border-bottom: none;
    margin: 10px 0;
    padding: 20px;
}

.amd-item-left-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid #cbd5e0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
    color: #cbd5e0;
}
.amd-email-item.active .amd-item-left-icon {
    background: var(--amd-color-1);
    border-color: var(--amd-color-1);
    color: white;
}
.amd-email-item.unread .amd-item-left-icon {
    border-color: var(--amd-color-1);
    color: var(--amd-color-1);
}

.amd-item-content {
    flex: 1;
    min-width: 0;
}
.amd-item-subject {
    font-size: 13px;
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.amd-email-item.active .amd-item-subject,
.amd-email-item.unread .amd-item-subject {
    font-weight: 700;
    color: #1a202c;
}
.amd-item-meta {
    display: flex;
    align-items: center;
    font-size: 11px;
    color: #a0aec0;
}
.amd-item-meta svg {
    margin-right: 4px;
}
.amd-item-avatar-right {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #cbd5e0;
    color: white;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    flex-shrink: 0;
}

.amd-add-task-wrapper {
    position: absolute;
    bottom: 25px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: none;
}
.amd-add-task-btn {
    pointer-events: auto;
    background: var(--amd-color-1);
    color: white;
    font-size: 13px;
    font-weight: 600;
    padding: 12px 30px;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(47, 106, 239, 0.3);
    transition: 0.2s;
}
.amd-add-task-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(47, 106, 239, 0.4);
}


/* =========================================
   3. RIGHT READING PANE
   ========================================= */
.amd-reading-pane {
    flex: 1;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 0;
}

.amd-read-top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 40px;
    border-bottom: 1px solid #edf2f7;
}
.center-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    margin: 0 auto;
}
.right-dots {
    color: #a0aec0;
    cursor: pointer;
}

.amd-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}

#amd-read-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.amd-read-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    padding-bottom: 100px;
}
.amd-read-scrollable::-webkit-scrollbar {
    width: 4px;
}
.amd-read-scrollable::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.amd-read-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}
.sender-info {
    display: flex;
    align-items: center;
}
.amd-read-avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--amd-color-1);
    color: white;
    font-weight: 600;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}
.amd-read-sender-name {
    font-size: 14px;
    font-weight: 600;
    color: #1a202c;
}

.action-icons {
    display: flex;
    gap: 8px;
}
.action-icons button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f7fafc;
    color: #a0aec0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.action-icons button:hover {
    background: #ebf8ff;
    color: var(--amd-color-1);
}

.amd-read-title-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
}
.blue-check-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--amd-color-1);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
    margin-top: 3px;
}
.amd-read-subject-text {
    font-size: 24px;
    font-weight: 800;
    color: #1a202c;
    margin: 0;
    line-height: 1.3;
}
.amd-read-date-sub {
    font-size: 13px;
    color: #a0aec0;
    margin-left: 45px;
    margin-bottom: 30px;
}

.amd-read-body-text {
    font-size: 14px;
    line-height: 1.7;
    color: #718096;
    margin-left: 45px;
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 40px;
}
.amd-read-body-text p {
    margin-bottom: 15px;
}

.amd-attachments-area {
    margin-left: 45px;
    margin-top: 30px;
}
.amd-attachment-card {
    display: inline-flex;
    align-items: center;
    background: #f7fafc;
    border-radius: 8px;
    padding: 10px 15px;
    border: 1px solid #edf2f7;
    margin-right: 10px;
    margin-bottom: 10px;
}
.amd-attachment-icon {
    width: 32px;
    height: 32px;
    background: #ebf8ff;
    color: var(--amd-color-1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}
.amd-attachment-info {
    display: flex;
    flex-direction: column;
}
.amd-attachment-name {
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
}
.amd-attachment-size {
    font-size: 11px;
    color: #a0aec0;
}

/* Bottom Bar */
.amd-reply-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px 40px;
    background: #ffffff;
    border-top: 1px solid #edf2f7;
}
.amd-reply-bar {
    display: flex;
    align-items: center;
}
.amd-reply-bar input {
    flex: 1;
    border: none;
    font-size: 14px;
    color: #4a5568;
    outline: none;
}
.amd-reply-bar input::placeholder {
    color: #cbd5e0;
}
.attach-btn {
    color: #a0aec0;
    margin-right: 15px;
    transition: 0.2s;
}
.attach-btn:hover { color: #4a5568; }
.send-btn {
    width: 45px;
    height: 45px;
    background: var(--amd-color-1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}
.send-btn:hover {
    background: var(--amd-color-2);
}
