/* ========== WINDOWS CONTAINER ========== */
#windows-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(100vh - 50px);
    pointer-events: none;
    z-index: 100;
}

/* ========== WINDOW ========== */
.window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 1200px;
    height: 85%;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    display: none;
    flex-direction: column;
    opacity: 0;
    pointer-events: auto;
    z-index: 100;
    overflow: hidden;
}

/* Window Show Animation */
.window.show {
    display: flex;
    animation: windowOpen 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes windowOpen {
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Window Minimized */
.window.minimized {
    display: none;
}

/* Window Maximized */
.window.maximized {
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    width: 100% !important;
    height: calc(100vh - 50px) !important;
    max-width: none !important;
    border-radius: 0 !important;
}

/* ========== WINDOW TITLEBAR ========== */
.window-titlebar {
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    cursor: move;
    user-select: none;
    flex-shrink: 0;
}

.window-title {
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.window-title i {
    font-size: 16px;
}

/* Window Controls */
.window-controls {
    display: flex;
    gap: 8px;
}

.window-controls button {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.window-controls button:hover {
    background: rgba(255,255,255,0.2);
}

.window-controls button:active {
    transform: scale(0.95);
}

.window-controls button:last-child:hover {
    background: #e74c3c;
}

/* ========== WINDOW CONTENT ========== */
.window-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    background: #f8f9fa;
}

.window-content h2 {
    margin-bottom: 20px;
    color: #2c3e50;
    font-size: 24px;
}

.window-content h3 {
    margin: 20px 0 15px 0;
    color: #34495e;
    font-size: 18px;
}

.window-content h4 {
    margin: 15px 0 10px 0;
    color: #34495e;
    font-size: 16px;
}

/* Window Resize Handle */
.window-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: nwse-resize;
}

/* Window Focus State */
.window.focused {
    z-index: 200;
}

.window:not(.focused) {
    opacity: 0.95;
}

.window:not(.focused) .window-titlebar {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}
/* CSS CHO QUẢN LÝ USERS - Thêm vào file static/css/windows.css */

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 25px;
    border-radius: 15px;
    color: white;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.stat-card i {
    opacity: 0.8;
    margin-bottom: 10px;
}

.stat-card h3 {
    font-size: 36px;
    font-weight: 700;
    margin: 10px 0;
}

.stat-card p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    font-weight: 500;
}

/* Users Table */
#usersTable {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

#usersTable thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

#usersTable th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#usersTable td {
    padding: 15px 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

#usersTable tbody tr {
    transition: background-color 0.2s ease;
}

#usersTable tbody tr:hover {
    background-color: #f8f9fa;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: #27ae60;
    color: white;
}

.badge-warning {
    background: #f39c12;
    color: white;
}

.badge-danger {
    background: #e74c3c;
    color: white;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* Modal Overlay */
#userModal {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Form Inputs */
#userForm input,
#userForm select {
    transition: all 0.3s ease;
}

#userForm input:focus,
#userForm select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    #usersTable {
        font-size: 12px;
    }

    #usersTable th,
    #usersTable td {
        padding: 10px 8px;
    }
}

/* Loading Spinner */
.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Tooltip */
[title] {
    position: relative;
    cursor: pointer;
}

/* Table Actions */
#usersTable .btn-sm {
    margin-right: 5px;
}

#usersTable .btn-sm:last-child {
    margin-right: 0;
}

/* Empty State */
#usersTableBody td[colspan] {
    color: #999;
    font-style: italic;
}

