/* ============================================
   MASTER ADMIN PANEL STYLES
   ============================================ */

/* Admin Login */
.admin-login-body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
}

.admin-login-card {
    border-top: 4px solid #f59e0b;
}

.admin-logo {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.admin-btn-login {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.admin-btn-login:hover {
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3) !important;
}

/* Admin Sidebar */
.admin-sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    border-radius: 0;
}

.admin-sidebar .sidebar-header {
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.admin-sidebar .sidebar-header h2 {
    color: #f59e0b;
    font-size: 18px;
}

.admin-sidebar .sidebar-header small {
    color: rgba(255,255,255,0.5);
    font-size: 11px;
}

.admin-sidebar .nav-item {
    color: rgba(255, 255, 255, 0.7);
    border-left: 3px solid transparent;
}

.admin-sidebar .nav-item:hover {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.admin-sidebar .nav-item.active {
    background: rgba(245, 158, 11, 0.15);
    border-left-color: #f59e0b;
    color: #f59e0b;
}

/* Admin Top Bar */
.admin-topbar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-topbar h2 {
    color: #0f172a;
    font-size: 20px;
    margin: 0;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-active {
    background: #d1fae5;
    color: #065f46;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

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

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

.badge-personal {
    background: #dbeafe;
    color: #1e40af;
}

.badge-offer {
    background: #d1fae5;
    color: #065f46;
}

.badge-announcement {
    background: #e0e7ff;
    color: #3730a3;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

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

.badge-delivered {
    background: #dbeafe;
    color: #1e40af;
}

.badge-read {
    background: #d1fae5;
    color: #065f46;
}

/* Plan Badges */
.badge-basic {
    background: #f1f5f9;
    color: #475569;
}

.badge-standard {
    background: #dbeafe;
    color: #1e40af;
}

.badge-enterprise {
    background: #faf5ff;
    color: #7c3aed;
}

/* Admin Stats */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.admin-stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}

.admin-stat-card:hover {
    transform: translateY(-3px);
}

.admin-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.admin-stat-icon.amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.admin-stat-icon.green { background: linear-gradient(135deg, #10b981, #059669); }
.admin-stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.admin-stat-icon.purple { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.admin-stat-icon.red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.admin-stat-icon.cyan { background: linear-gradient(135deg, #06b6d4, #0891b2); }

.admin-stat-details h3 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 2px;
    color: #0f172a;
}

.admin-stat-details p {
    color: #64748b;
    font-size: 13px;
    margin: 0;
}

/* Client Cards Grid */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.client-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    border-left: 4px solid #e2e8f0;
    transition: all 0.3s;
}

.client-card:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.client-card.status-active { border-left-color: #10b981; }
.client-card.status-pending { border-left-color: #f59e0b; }
.client-card.status-suspended { border-left-color: #ef4444; }
.client-card.status-rejected { border-left-color: #94a3b8; }

.client-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.client-card-header h3 {
    font-size: 16px;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.client-card-header .owner {
    color: #64748b;
    font-size: 13px;
}

.client-card-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #475569;
}

.client-card-info .info-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.client-card-info .info-row svg {
    width: 14px;
    height: 14px;
    color: #94a3b8;
    flex-shrink: 0;
}

.client-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.client-card-stats .mini-stat {
    text-align: center;
}

.client-card-stats .mini-stat .value {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.client-card-stats .mini-stat .label {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
}

.client-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.client-card-actions .btn {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 6px;
}

/* Action Buttons */
.btn-approve {
    background: #10b981;
    color: white;
}

.btn-approve:hover {
    background: #059669;
}

.btn-suspend {
    background: #f59e0b;
    color: white;
}

.btn-suspend:hover {
    background: #d97706;
}

.btn-activate {
    background: #3b82f6;
    color: white;
}

.btn-activate:hover {
    background: #2563eb;
}

.btn-reject {
    background: #6b7280;
    color: white;
}

.btn-reject:hover {
    background: #4b5563;
}

.btn-message {
    background: #8b5cf6;
    color: white;
}

.btn-message:hover {
    background: #7c3aed;
}

.btn-details {
    background: #0ea5e9;
    color: white;
}

.btn-details:hover {
    background: #0284c7;
}

/* Message Card */
.message-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    margin-bottom: 15px;
    border-left: 4px solid #e2e8f0;
}

.message-card.type-personal { border-left-color: #3b82f6; }
.message-card.type-offer { border-left-color: #10b981; }
.message-card.type-announcement { border-left-color: #8b5cf6; }
.message-card.type-warning { border-left-color: #f59e0b; }

.message-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.message-card-header h4 {
    font-size: 15px;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.message-card-header .to {
    color: #64748b;
    font-size: 12px;
}

.message-card-header .date {
    color: #94a3b8;
    font-size: 12px;
    text-align: right;
}

.message-card-body {
    color: #475569;
    font-size: 14px;
    line-height: 1.6;
}

/* Modal / Dialog */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: white;
    border-radius: 16px;
    padding: 30px;
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-box h3 {
    margin: 0 0 20px 0;
    color: #0f172a;
    font-size: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Client Detail Page */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.detail-header-info h1 {
    font-size: 24px;
    color: #0f172a;
    margin: 0 0 5px 0;
}

.detail-header-info .meta {
    color: #64748b;
    font-size: 14px;
}

.detail-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.tab-btn {
    padding: 12px 24px;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
    font-family: 'Poppins', sans-serif;
}

.tab-btn:hover {
    color: #0f172a;
    background: #f8fafc;
}

.tab-btn.active {
    color: #f59e0b;
    border-bottom-color: #f59e0b;
    background: #fffbeb;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-bar select,
.filter-bar input {
    padding: 8px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Poppins', sans-serif;
    background: white;
}

.filter-bar input {
    flex: 1;
    min-width: 200px;
}

/* Summary Row */
.summary-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.summary-box {
    background: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.summary-box .value {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}

.summary-box .label {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    margin-top: 4px;
}

/* Compose Message Form */
.compose-form .form-group {
    margin-bottom: 15px;
}

.compose-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.compose-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    resize: vertical;
    min-height: 120px;
}

.compose-form textarea:focus,
.compose-form select:focus,
.compose-form input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

/* Responsive for Admin */
@media (max-width: 768px) {
    .sidebar {
        visibility: hidden;
        opacity: 0;
        left: -260px;
        transition: all 0.3s ease-in-out;
    }
    .sidebar.active {
        visibility: visible;
        opacity: 1;
        left: 0;
    }
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
    .clients-grid {
        grid-template-columns: 1fr;
    }
    .detail-header {
        flex-direction: column;
        gap: 15px;
    }
    .tabs {
        overflow-x: auto;
    }
    .admin-topbar {
        padding: 15px 60px 15px 20px;
    }
    .admin-topbar h2 {
        font-size: 18px;
    }
    .user-info {
        display: none;
    }
    
    /* Responsive Admin Table */
    .admin-table thead {
        display: none;
    }
    .admin-table, .admin-table tbody, .admin-table tr, .admin-table td {
        display: block;
        width: 100%;
    }
    .admin-table tr {
        margin-bottom: 15px;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        padding: 10px;
    }
    .admin-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid #f1f5f9;
    }
    .admin-table td:last-child {
        border-bottom: 0;
    }
    .admin-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%;
        text-align: left;
        font-weight: 600;
        color: #0f172a;
    }
}

/* Empty State */
.admin-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.admin-empty-state svg {
    margin-bottom: 15px;
    color: #cbd5e1;
}

.admin-empty-state h3 {
    color: #64748b;
    margin-bottom: 8px;
}

/* Scrollbar for admin sidebar */
.admin-sidebar::-webkit-scrollbar {
    width: 4px;
}

.admin-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: rgba(245, 158, 11, 0.3);
    border-radius: 2px;
}

/* Notification dot */
.nav-item .notification-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    margin-left: auto;
}

/* Table improvements for admin */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.admin-table thead {
    background: #f8fafc;
}

.admin-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    color: #0f172a;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

.admin-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #334155;
}

.admin-table tbody tr:hover {
    background: #f8fafc;
}

.admin-table .client-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.admin-table .client-link:hover {
    text-decoration: underline;
}


/* Responsive for Admin - Small Mobile (480px and below) */
@media (max-width: 480px) {
    .admin-stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .admin-stat-card {
        padding: 15px;
        gap: 12px;
    }
    
    .admin-stat-icon {
        width: 45px;
        height: 45px;
    }
    
    .admin-stat-details h3 {
        font-size: 20px;
    }
    
    .admin-stat-details p {
        font-size: 12px;
    }
    
    .clients-grid {
        grid-template-columns: 1fr;
    }
    
    .client-card {
        padding: 15px;
    }
    
    .client-card-header h3 {
        font-size: 14px;
    }
    
    .client-card-header .owner {
        font-size: 12px;
    }
    
    .client-card-info {
        font-size: 12px;
    }
    
    .client-card-stats {
        gap: 8px;
        padding: 10px;
    }
    
    .client-card-stats .mini-stat .value {
        font-size: 16px;
    }
    
    .client-card-stats .mini-stat .label {
        font-size: 10px;
    }
    
    .client-card-actions {
        flex-direction: column;
    }
    
    .client-card-actions .btn {
        width: 100%;
    }
    
    .detail-header {
        padding: 15px;
    }
    
    .detail-header-info h1 {
        font-size: 18px;
    }
    
    .detail-header-info .meta {
        font-size: 12px;
    }
    
    .detail-header-actions {
        flex-direction: column;
    }
    
    .detail-header-actions .btn {
        width: 100%;
    }
    
    .tabs {
        gap: 0;
        overflow-x: auto;
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    .filter-bar {
        flex-direction: column;
    }
    
    .filter-bar input {
        width: 100%;
        min-width: auto;
    }
    
    .summary-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .summary-box {
        padding: 12px;
    }
    
    .summary-box .value {
        font-size: 18px;
    }
    
    .summary-box .label {
        font-size: 11px;
    }
    
    .message-card {
        padding: 15px;
        margin-bottom: 12px;
    }
    
    .message-card-header {
        flex-direction: column;
        gap: 5px;
    }
    
    .message-card-header h4 {
        font-size: 13px;
    }
    
    .message-card-header .to,
    .message-card-header .date {
        font-size: 11px;
        text-align: left;
    }
    
    .message-card-body {
        font-size: 13px;
    }
    
    .modal-box {
        width: 95%;
        padding: 20px 15px;
    }
    
    .modal-box h3 {
        font-size: 18px;
    }
    
    .modal-actions {
        flex-direction: column-reverse;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
    
    .compose-form .form-group {
        margin-bottom: 12px;
    }
    
    .compose-form label {
        font-size: 13px;
    }
    
    .compose-form textarea {
        min-height: 100px;
        padding: 10px 12px;
        font-size: 13px;
    }
    
    .admin-table td {
        padding: 8px 6px;
        padding-left: 40%;
    }
    
    .admin-table td::before {
        left: 3px;
        width: 38%;
        font-size: 11px;
    }
}

/* Responsive for Admin - Extra Small Mobile (350px and below) */
@media (max-width: 350px) {
    body {
        font-size: 13px;
    }
    
    .admin-topbar {
        padding: 10px 45px 10px 12px;
    }
    
    .admin-topbar h2 {
        font-size: 14px;
    }
    
    .admin-stats-grid {
        gap: 10px;
    }
    
    .admin-stat-card {
        padding: 12px;
        gap: 10px;
        flex-direction: column;
        text-align: center;
    }
    
    .admin-stat-icon {
        width: 40px;
        height: 40px;
        margin: 0 auto;
    }
    
    .admin-stat-details h3 {
        font-size: 18px;
    }
    
    .admin-stat-details p {
        font-size: 11px;
    }
    
    .client-card {
        padding: 12px;
    }
    
    .client-card-header h3 {
        font-size: 13px;
    }
    
    .client-card-header .owner {
        font-size: 11px;
    }
    
    .client-card-info {
        font-size: 11px;
        gap: 6px;
    }
    
    .client-card-stats {
        gap: 6px;
        padding: 8px;
    }
    
    .client-card-stats .mini-stat .value {
        font-size: 14px;
    }
    
    .client-card-stats .mini-stat .label {
        font-size: 9px;
    }
    
    .client-card-actions {
        gap: 4px;
    }
    
    .client-card-actions .btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .detail-header {
        padding: 12px;
    }
    
    .detail-header-info h1 {
        font-size: 16px;
    }
    
    .detail-header-info .meta {
        font-size: 11px;
    }
    
    .tab-btn {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    .filter-bar {
        gap: 6px;
    }
    
    .filter-bar select,
    .filter-bar input {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .summary-box {
        padding: 10px;
    }
    
    .summary-box .value {
        font-size: 16px;
    }
    
    .summary-box .label {
        font-size: 10px;
    }
    
    .message-card {
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .message-card-header h4 {
        font-size: 12px;
    }
    
    .message-card-header .to,
    .message-card-header .date {
        font-size: 10px;
    }
    
    .message-card-body {
        font-size: 12px;
    }
    
    .modal-box {
        width: 95%;
        padding: 15px 12px;
    }
    
    .modal-box h3 {
        font-size: 16px;
    }
    
    .compose-form label {
        font-size: 12px;
    }
    
    .compose-form textarea {
        min-height: 80px;
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .admin-table td {
        padding: 6px 4px;
        padding-left: 35%;
        font-size: 11px;
    }
    
    .admin-table td::before {
        left: 2px;
        width: 33%;
        font-size: 10px;
    }
    
    .admin-empty-state {
        padding: 40px 15px;
    }
    
    .admin-empty-state h3 {
        font-size: 14px;
    }
}
