* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f6f9;
    color: #1f2937;
}

body {
    min-height: 100vh;
}

a {
    text-decoration: none;
}

.main {
    padding: 30px 15px 50px;
}

.navbar {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.3px;
}

.login-container {
    max-width: 460px;
    margin: 40px auto;
    background: #ffffff;
    border-radius: 18px;
    padding: 35px 30px;
    box-shadow: 0 15px 35px rgba(15, 23, 42, 0.10);
    border: 1px solid #e5e7eb;
}

.lock-icon {
    display: block;
    width: 72px;
    height: 72px;
    line-height: 72px;
    margin: 0 auto 18px;
    text-align: center;
    font-size: 28px;
    color: #ffffff;
    background: linear-gradient(135deg, #111827, #374151);
    border-radius: 50%;
    box-shadow: 0 10px 20px rgba(17, 24, 39, 0.20);
}

.login-container h2 {
    font-weight: 700;
    color: #111827;
}

.login-form,
.registration-form {
    margin-top: 10px;
}

.login-form h5,
.registration-form h5 {
    color: #4b5563;
    font-weight: 600;
    margin-bottom: 20px;
}

.form-group label {
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.form-control {
    border-radius: 12px;
    border: 1px solid #d1d5db;
    min-height: 46px;
    padding: 10px 14px;
    box-shadow: none !important;
    transition: all 0.2s ease;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.form-control:focus {
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08) !important;
}

.btn {
    border-radius: 12px;
    font-weight: 600;
    min-height: 44px;
    transition: all 0.2s ease;
}

.btn-dark,
.bg-dark {
    background: #1f2937 !important;
    border-color: #1f2937 !important;
}

.btn-dark:hover,
.btn-primary:hover,
.btn-outline-primary:hover,
.btn-outline-danger:hover,
.btn-outline-secondary:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: #2563eb;
    border-color: #2563eb;
}

.btn-secondary {
    background: #6b7280;
    border-color: #6b7280;
}

.link-show {
    color: #2563eb;
    font-weight: 600;
    transition: color 0.2s ease;
}

.link-show:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

.accounts-container {
    max-width: 1220px;
    margin: 0 auto;
}

.alert {
    border-radius: 14px;
    border: none;
    padding: 14px 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.card {
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
    background: #ffffff;
}

.card-header {
    border-bottom: none;
    font-weight: 700;
    padding: 16px 20px;
    font-size: 18px;
}

.card-body {
    padding: 24px;
}

.table-responsive {
    background: #ffffff;
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
    border: 1px solid #e5e7eb;
}

.table {
    margin-bottom: 0;
    background: #ffffff;
}

.table thead th {
    background: #f9fafb;
    color: #111827;
    font-weight: 700;
    border-top: none;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: middle;
    white-space: nowrap;
}

.table td {
    vertical-align: middle;
    border-color: #eef2f7;
}

.table-hover tbody tr:hover {
    background: #f8fafc;
}

.table input.form-control-sm {
    min-height: 38px;
    border-radius: 10px;
    font-size: 14px;
}

.btn-sm {
    min-height: 36px;
    border-radius: 10px;
    padding: 6px 12px;
}

.dropdown-menu {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
    padding: 8px;
}

.dropdown-item,
.dropdown-item-text {
    border-radius: 10px;
}

.dropdown-item:hover {
    background: #f3f4f6;
}

/* --- TABLE LAYOUT --- */
.custom-table-wrap {
    overflow-x: auto;
}

.account-table {
    min-width: 1100px;
    border-collapse: separate;
    border-spacing: 0;
}

.account-table thead th {
    background: #f8fafc;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
    font-size: 14px;
}

.account-table tbody td,
.account-table td,
.account-table th {
    vertical-align: middle;
    padding: 14px 10px;
}

/* --- COPY / SHOW BUTTONS FIX --- */
.copy-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.copy-row input.form-control,
.copy-row input.form-control-sm {
    min-width: 160px;
    max-width: 220px;
    flex: 1 1 auto;
}

.copy-row .btn,
.copy-row .btn-sm,
.copy-row button {
    white-space: nowrap !important;
    word-break: keep-all !important;
    writing-mode: horizontal-tb !important;
    min-width: 70px;
    height: 38px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    line-height: 1;
    flex-shrink: 0;
}

/* --- ACTION BUTTONS --- */
.action-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.action-row .btn,
.action-row .btn-sm,
.action-row a,
.action-row button {
    white-space: nowrap !important;
    min-width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
}

.action-row form {
    margin: 0;
}

/* --- DATATABLES (if still used elsewhere) --- */
.dataTables_wrapper {
    padding: 10px 6px 0;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #d1d5db;
    border-radius: 10px;
    padding: 6px 10px;
    background: #fff;
    margin-left: 8px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 10px !important;
    border: none !important;
    margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #1f2937 !important;
    color: #fff !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: #374151 !important;
    color: #fff !important;
    border: none !important;
}

@media (max-width: 991px) {
    .main {
        padding: 20px 10px 35px;
    }

    .login-container {
        margin: 20px auto;
        padding: 25px 20px;
    }

    .card-body {
        padding: 18px;
    }

    .table-responsive {
        padding: 8px;
    }
}

@media (max-width: 576px) {
    .login-container {
        border-radius: 16px;
    }

    .accounts-container h4 {
        font-size: 22px;
    }

    .card-header {
        font-size: 16px;
    }

    .btn,
    .form-control {
        font-size: 14px;
    }

    .copy-row {
        gap: 6px;
    }

    .copy-row .btn,
    .copy-row .btn-sm {
        min-width: 64px;
        padding: 6px 10px;
    }
}