* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0b0e14;
    background-image: radial-gradient(circle at 30% 20%, rgba(64, 128, 255, 0.05) 0%, transparent 30%),
                      radial-gradient(circle at 80% 80%, rgba(255, 75, 115, 0.05) 0%, transparent 30%);
    padding: 16px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f8fafc; /* Brilliant off-white for main text */
}

/* Added styling for standard text elements */
p, label, li {
    color: #f8fafc; /* Brilliant off-white for readability */
    line-height: 1.6;
}

.container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    background: #141a24;
    border-radius: 36px;
    padding: 28px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.06);
    border: 1px solid #2a3240;
}

h1, h2, h3 {
    font-weight: 600;
    color: #ffffff; /* Pure white for large headers */
    letter-spacing: -0.02em;
}

/* Account grid - Chrome-like squares */
.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.account-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.account-item:hover {
    transform: translateY(-6px);
}

.account-square {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: linear-gradient(145deg, #1f2837, #161e2a);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 0 #0a0e14, 0 15px 30px -8px rgba(0, 0, 0, 0.5);
    margin-bottom: 10px;
    border: 2px solid #303a4a;
    overflow: hidden;
    position: relative;
}

.account-avatar {
    width: 60%;
    height: 60%;
    border-radius: 50%;
    background: linear-gradient(145deg, #2f3e55, #1c2738);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    font-weight: 500;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    object-fit: cover;
}

.account-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.account-name {
    font-size: 14px;
    font-weight: 500;
    color: #b8c7dd;
    text-align: center;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.edit-icon {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    background: #2b3445;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b0c6e0;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    border: 1px solid #4a566c;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.account-item:hover .edit-icon {
    opacity: 1;
}

.edit-icon:hover {
    background: #3e4b62;
    color: white;
}

/* Buttons */
.btn, .btn-small {
    background: linear-gradient(145deg, #293241, #1f2735);
    color: #e3ecf5;
    border: none;
    padding: 14px 24px;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin: 8px 0;
    transition: all 0.2s ease;
    box-shadow: 0 6px 0 #0d121b, 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid #3d485c;
}

.btn:hover, .btn-small:hover {
    background: linear-gradient(145deg, #2f3b4e, #252f40);
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #0d121b, 0 8px 18px rgba(0, 0, 0, 0.4);
}

.btn-small {
    padding: 8px 18px;
    width: auto;
    font-size: 14px;
}

.add-account {
    background: #1f2633;
    color: #b8c9e0;
    border: 2px dashed #4e5b74;
    box-shadow: none;
}

.add-account:hover {
    background: #2a3343;
    border-color: #6f80a0;
    transform: translateY(-2px);
}



/* Status groups */
.status-group {
    margin: 12px 0;
    border: 1px solid #2b3343;
    border-radius: 24px;
    overflow: hidden;
    background: #131b26;
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}
.group-header {
    background: #1f2838;
    padding: 16px 20px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2f3b4e;
    color: #c9d9f0;
}
.group-header:hover {
    background: #252f42;
}
.group-header .count {
    background: #2e3c52;
    color: #e6f0ff;
    border-radius: 40px;
    padding: 4px 14px;
    font-size: 14px;
    font-weight: 500;
}
.group-content {
    display: none;
    padding: 8px 0;
    background: #131b26;
}
.group-content.expanded {
    display: block;
}
.student-row {
    padding: 16px 20px;
    border-bottom: 1px solid #1f2a38;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.student-row:last-child {
    border-bottom: none;
}
.student-row.hold, .student-row.rejected {
    background: #271f1f;
    border-left: 4px solid #e55b4e;
}
.student-info {
    flex: 1;
}
.student-name {
    font-weight: 600;
    color: #e7f0ff;
}
.student-passport {
    font-size: 13px;
    color: #8f9fb5;
    margin-top: 4px;
}
.edit-btn {
    background: #232d3d;
    color: #b8cde8;
    border: none;
    padding: 8px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 2px 0 #0d131e;
    border: 1px solid #3f506a;
}
.edit-btn:hover {
    background: #2f3d55;
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
}
.modal-content {
    background: #17202b;
    padding: 28px;
    border-radius: 36px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.7);
    border: 1px solid #364153;
}
.close {
    float: right;
    font-size: 28px;
    font-weight: 300;
    cursor: pointer;
    color: #7b8aa3;
    transition: color 0.2s;
}
.close:hover {
    color: #ffffff;
}
input[type="text"], input[type="password"], input[type="email"], input[type="tel"], select {
    width: 100%;
    padding: 14px 18px;
    margin: 8px 0;
    border: 1px solid #2b3649;
    border-radius: 20px;
    font-size: 16px;
    background: #1d2635;
    color: #eef4fc;
    transition: border 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus, input[type="tel"]:focus, select:focus {
    outline: none;
    border-color: #5a6e92;
    background: #242f42;
    box-shadow: 0 0 0 3px rgba(90, 110, 146, 0.25);
}
input::placeholder {
    color: #5d6d86;
}

/* Dashboard widgets */
#stats-charts ul {
    list-style: none;
    padding: 0;
    margin: 16px 0;
    background: #1c2533;
    border-radius: 20px;
    padding: 12px 20px;
}
#stats-charts li {
    padding: 8px 0;
    border-bottom: 1px solid #2a3240;
}
#stats-charts li:last-child {
    border-bottom: none;
}

.warning-box {
    background: #2a2419;
    border-left: 6px solid #f4b740;
    padding: 20px;
    border-radius: 24px;
    margin: 20px 0;
}
#action-list li, #recent-list li {
    list-style: none;
    padding: 12px 0;
    border-bottom: 1px solid #3e3e2c;
    color: #cbd7ed;
}
#recent-list {
    background: #1c2533;
    border-radius: 24px;
    padding: 0 20px;
}

/* PIN modal specific */
.pin-input {
    text-align: center;
    font-size: 28px;
    letter-spacing: 10px;
    font-weight: 500;
}

/* --- Modern Navigation Buttons --- */
.nav-buttons {
    display: flex;
    gap: 16px;
    margin: 20px 0 24px;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background: #1b222e;
    border: 1px solid #2c3545;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 600;
    color: #8f9fb5;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn .icon {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.nav-btn:hover {
    background: #232d3d;
    transform: translateY(-3px);
}

.nav-btn:hover .icon {
    transform: scale(1.1);
}

.nav-btn.active {
    background: linear-gradient(145deg, #2e3a4e, #1f2838);
    color: #ffffff;
    border-color: #4a5a75;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

/* Tab Content Smooth Fade */
.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeSlideIn 0.4s ease forwards;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Expanding Action Row (Search & Add) --- */
.action-row {
    display: flex;
    gap: 12px;
    margin: 16px 0 24px;
    width: 100%;
    height: 52px;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(145deg, #293241, #1f2735);
    color: #e3ecf5;
    border: 1px solid #3d485c;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    white-space: nowrap;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.action-btn:hover {
    background: linear-gradient(145deg, #2f3b4e, #252f40);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.add-btn {
    flex: 1;
}

.search-container {
    flex: 1;
    position: relative;
    display: flex;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-btn {
    width: 100%;
}

.search-input-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s ease;
    transform: scaleX(0.8);
    transform-origin: right center;
}

.search-input-wrapper input {
    margin: 0;
    height: 100%;
    border-radius: 40px;
    padding: 0 48px 0 20px;
    width: 100%;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.6);
}

.close-btn {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #8f9fb5;
    font-size: 18px;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.close-btn:hover {
    color: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

/* Active Search State Transformations */
.action-row.search-active .add-btn {
    flex: 0;
    width: 0;
    padding: 0;
    border: none;
    opacity: 0;
    overflow: hidden;
}

.action-row.search-active .search-container {
    flex: 2; /* Takes over the entire row gracefully */
}

.action-row.search-active .search-btn {
    opacity: 0;
    pointer-events: none;
}

.action-row.search-active .search-input-wrapper {
    opacity: 1;
    pointer-events: auto;
    transform: scaleX(1);
}

/* --- Row Actions & EMGS Button --- */
.row-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.emgs-btn {
    background: linear-gradient(145deg, #1e3a8a, #172554);
    color: #eff6ff;
    border: 1px solid #2563eb;
    padding: 8px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px rgba(29, 78, 216, 0.3);
}

.emgs-btn:hover {
    background: linear-gradient(145deg, #2563eb, #1e40af);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.5);
}

/* Animation class for successful copy */
.emgs-btn.success-state {
    background: linear-gradient(145deg, #059669, #047857);
    border-color: #10b981;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
}