/* ================================
   Base
================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #eaf6f9;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.container {
    display: flex;
    height: 100vh;
    position: relative;
    z-index: 1;
}

.main-content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

/* ================================
   Header
================================ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.header h1 {
    font-size: 42px;
    color: #4197cb;
    font-weight: 700;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.icon-btn {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.pfp-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #4197cb;
    border: 3px solid rgba(255, 255, 255, 0.5);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pfp-btn:hover {
    box-shadow: 0 6px 20px rgba(65, 151, 203, 0.4);
}

/* ================================
   Modal
================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

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

.modal {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.modal-title {
    font-size: 28px;
    font-weight: 700;
    background: #4197cb;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(65, 151, 203, 0.1);
    border-radius: 12px;
    cursor: pointer;
    font-size: 24px;
    color: #4197cb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.modal-close:hover {
    background: rgba(65, 151, 203, 0.2);
}

/* ================================
   Account Modal
================================ */
.modal-account {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    width: 90%;
    max-width: 360px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(65, 151, 203, 0.15);
    border: 3px solid rgba(65, 151, 203, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 600;
    color: #4197cb;
    letter-spacing: 1px;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(65, 151, 203, 0.2);
}

.modal-identity {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 20px;
    text-align: center;
}

.modal-fullname {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a2e3b;
}

.modal-username {
    margin: 0;
    font-size: 13px;
    color: #7a9eb0;
}

.modal-role-badge {
    margin-top: 6px;
    background: rgba(65, 151, 203, 0.12);
    color: #4197cb;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 999px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border: 1px solid rgba(65, 151, 203, 0.25);
}

.modal-fields {
    width: 100%;
    border-top: 1px solid rgba(65, 151, 203, 0.15);
    padding-top: 20px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(65, 151, 203, 0.06);
    border-radius: 12px;
    border: 1px solid rgba(65, 151, 203, 0.1);
}

.field-label {
    font-size: 12px;
    color: #7a9eb0;
    font-weight: 500;
}

.field-value {
    font-size: 13px;
    font-weight: 600;
    color: #1a2e3b;
}

.field-value.mono {
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: #4197cb;
}

.btn-submit-account {
    width: 100%;
    padding: 12px 28px;
    border: none;
    background: #4197cb;
    color: white;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(65, 151, 203, 0.4);
}

/* ================================
   Building card
================================ */
.building-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.building-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.building-title {
    font-size: 28px;
    font-weight: 700;
    background: #4197cb;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ================================
   Search bar
================================ */
.search-and-buttons-container {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
    flex-shrink: 0;
}

.search-and-buttons-container .search-input {
    flex: 1;
    min-width: 200px;
    padding: 13px 18px 13px 36px;
    font-size: 16px;
    border-radius: 16px;
    border: 2px solid #4197cb;
    background: rgba(255, 255, 255, 0.85);
    color: #2883be;
    outline: none;
}

/* ================================
   Table wrapper
================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: 16px;
    margin-bottom: 20px;
}

/* ================================
   Form
================================ */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 10px;
    letter-spacing: 0.3px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid rgba(65, 151, 203, 0.2);
    border-radius: 12px;
    font-size: 15px;
    color: #2d3748;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #4197cb;
}

.form-input::placeholder {
    color: #a0aec0;
}

.form-input.error {
    border-color: #c91111;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 32px;
    flex-wrap: wrap;
}

/* ================================
   Buttons
================================ */
.btn {
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.btn-submit {
    padding: 12px 28px;
    border: none;
    background: #4197cb;
    color: white;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(65, 151, 203, 0.4);
}

.btn-submit:hover {
    box-shadow: 0 8px 28px rgba(65, 151, 203, 0.5);
}

.btn-submit:hover:not(:disabled) {
    box-shadow: 0 8px 28px rgba(65, 151, 203, 0.5);
}

.btn-submit:disabled {
    background: #dadce0;
    color: #9aa0a6;
    cursor: not-allowed;
    box-shadow: 0 8px 28px rgba(65, 151, 203, 0.5);
}

.btn-cancel {
    padding: 12px 28px;
    border: none;
    background: white;
    color: #4197cb;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(65, 151, 203, 0.4);
}

.btn-cancel:hover {
    box-shadow: 0 8px 28px rgba(65, 151, 203, 0.5);
}

.btn-edit {
    background: #4197cb;
    color: white;
    box-shadow: 0 4px 12px rgba(65, 151, 203, 0.3);
}

.btn-edit:hover {
    box-shadow: 0 6px 20px rgba(65, 151, 203, 0.4);
}

.btn-info {
    background: #f6d365;
    color: white;
    box-shadow: 0 4px 12px rgba(253, 160, 133, 0.3);
}

.btn-info:hover {
    box-shadow: 0 4px 12px rgba(253, 160, 133, 0.4);
}

.btn-danger {
    background: #c91111;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #a00e0e;
}

.btn-delete {
    background: #fa5f5f;
    color: white;
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.3);
}

.btn-delete:hover {
    box-shadow: 0 4px 12px rgba(245, 87, 108, 0.4);
}

.btn-primary {
    background: #4197cb;
    color: white;
}

.btn-secondary {
    background: white;
    color: #4197cb;
    border: 2px solid rgba(65, 151, 203, 0.3);
    text-decoration: none;
    display: inline-block;
}

.btn-secondary:hover {
    background: rgba(65, 151, 203, 0.1);
}

.action-btns {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.action-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
}

.action-btn:hover::before {
    width: 100px;
    height: 100px;
}

.btn-add {
    width: 56px;
    height: 56px;
    background: #4197cb;
    border: none;
    border-radius: 16px;
    color: white;
    font-size: 28px;
    cursor: pointer;
    margin-top: 20px;
    box-shadow: 0 8px 24px rgba(65, 151, 203, 0.4);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-add::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
}

.btn-add:hover::before {
    width: 200px;
    height: 200px;
}

.btn-add:hover {
    box-shadow: 0 12px 32px rgba(65, 151, 203, 0.5);
}

/* ================================
   Confirmation text
================================ */
.confirm-text {
    color: #4a5568;
    font-size: 16px;
    margin-bottom: 24px;
    line-height: 1.6;
}

/* ================================
   Status badge
================================ */
.status-badge {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-available {
    background: #34a853;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(52, 168, 83, 0.35);
}

.status-unavailable {
    background: #ea4335;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(234, 67, 53, 0.35);
}

/* ================================
    Responsiveness
================================ */
@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
    }

    .main-content {
        padding: 20px;
        padding-top: 80px;
    }

    .header {
        margin-bottom: 20px;
        margin-top: 20px;
    }

    .header h1 {
        font-size: 50px;
        width: 100%;
        text-align: left;
    }

    .building-card {
        padding: 20px;
        border-radius: 16px;
    }

    .building-title {
        font-size: 20px;
    }

    .modal {
        padding: 24px;
        width: 95%;
        max-width: 100%;
        border-radius: 20px;
    }

    .modal-title {
        font-size: 22px;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .btn-submit,
    .btn-cancel {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 16px;
        padding-top: 70px;
    }

    .header h1 {
        font-size: 50px;
        width: 100%;
        text-align: center;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 16px;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .icon-btn,
    .pfp-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .building-card {
        padding: 16px;
        border-radius: 14px;
    }

    .building-header {
        margin-bottom: 16px;
    }

    .building-title {
        font-size: 18px;
    }

    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 16px;
        border-radius: 12px;
    }

    .action-btns {
        gap: 4px;
    }

    .action-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .modal {
        padding: 20px;
        width: 100%;
        border-radius: 16px;
    }

    .modal-header {
        margin-bottom: 20px;
    }

    .modal-title {
        font-size: 18px;
    }

    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .form-group {
        margin-bottom: 16px;
    }

    .form-label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .form-input {
        padding: 12px 14px;
        font-size: 14px;
        border-radius: 10px;
    }

    .form-actions {
        flex-direction: column;
        gap: 8px;
        margin-top: 20px;
    }

    .btn-submit,
    .btn-cancel {
        width: 100%;
        padding: 10px 16px;
        font-size: 14px;
        border-radius: 10px;
    }

    .confirm-text {
        font-size: 14px;
        margin-bottom: 16px;
    }

    .logo-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .logo {
        margin-bottom: 24px;
    }

    .menu-item {
        padding: 12px 16px;
        font-size: 13px;
    }

    .menu-item:hover,
    .menu-item.active {
        padding-left: 20px;
    }
}

@media (max-width: 320px) {

    .header-actions {
        gap: 8px;
    }

    .icon-btn,
    .pfp-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .modal {
        padding: 16px;
    }

    .modal-title {
        font-size: 16px;
    }

    .form-input {
        font-size: 13px;
    }

    .btn-submit,
    .btn-cancel {
        font-size: 12px;
        padding: 8px 12px;
    }
}