/* ============================================================
   WEBLINK ADMIN
   Shared styles for login, register and backoffice
   ============================================================ */


/* ============================================================
   RESET
   ============================================================ */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    background: #f5f6f8;
    color: #222;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}


/* ============================================================
   AUTH
   Login / Register
   ============================================================ */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
}

.auth-box {
    width: 100%;
    max-width: 450px;
    background: #fff;
    padding: 35px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo h1 {
    margin: 0;
    font-size: 28px;
}

.auth-title {
    margin: 0 0 25px;
    font-size: 22px;
}


/* ============================================================
   FORMS
   ============================================================ */

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

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.form-control,
/* ============================================================
   FORM SELECT
   ============================================================ */

.form-select {
    width: 100%;
    height: 44px;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #d5d9df;
    border-radius: 6px;
    background: #fff;
    color: #222;
    outline: none;
    line-height: 22px;
}

.form-select:focus {
    border-color: #777;
}

.form-control:focus,
.form-select:focus {
    border-color: #777;
}

.form-help {
    margin-top: 5px;
    font-size: 13px;
    color: #777;
}


/* ============================================================
   ALERTS
   ============================================================ */

.alert {
    padding: 12px 14px;
    margin-bottom: 20px;
    border-radius: 6px;
}

.alert-error {
    background: #fbeaea;
    color: #a00000;
}

.alert-success {
    background: #eaf7ed;
    color: #176b2c;
}


/* ============================================================
   ADMIN LAYOUT
   ============================================================ */

.admin-layout {
    min-height: 100vh;
    display: flex;
    background: #f5f6f8;
}


/* ============================================================
   ADMIN SIDEBAR
   ============================================================ */

.admin-sidebar {
    width: 240px;
    min-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;

    display: flex;
    flex-direction: column;

    background: #222;
    color: #fff;
}


/* ============================================================
   SIDEBAR LOGO
   ============================================================ */

.sidebar-logo {
    height: 70px;

    display: flex;
    align-items: center;

    padding: 0 24px;

    font-size: 22px;
    font-weight: 700;
    
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}


/* ============================================================
   SIDEBAR NAVIGATION
   ============================================================ */

.sidebar-nav {
    padding: 15px 10px;
}

.sidebar-link {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 11px 13px;
    margin-bottom: 4px;

    border-radius: 6px;

    color: rgba(255, 255, 255, 0.75);

    font-size: 14px;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}

.sidebar-link i {
    width: 20px;
    text-align: center;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-weight: 600;
}


/* ============================================================
   SIDEBAR BOTTOM
   ============================================================ */

.sidebar-bottom {
    margin-top: auto;

    padding: 12px 10px;

    border-top: 1px solid rgba(255, 255, 255, 0.1);
}


/* ============================================================
   ADMIN MAIN
   ============================================================ */

.admin-main {
    margin-left: 240px;

    width: calc(100% - 240px);

    min-height: 100vh;
}


/* ============================================================
   ADMIN HEADER
   ============================================================ */

.admin-header {
    height: 70px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 30px;

    background: #fff;

    border-bottom: 1px solid #e5e7eb;
}


/* ============================================================
   COMPANY NAME
   ============================================================ */

.admin-company-name {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}


/* ============================================================
   CURRENT USER
   ============================================================ */

.admin-user {
    text-align: right;
}

.admin-user-name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.admin-user-phone {
    margin-top: 2px;

    font-size: 12px;
    color: #6b7280;
}


/* ============================================================
   ADMIN CONTENT
   ============================================================ */

.admin-content {
    width: 100%;
    max-width: 1400px;

    padding: 32px;
}

.admin-content h1 {
    margin: 0;

    font-size: 28px;
    font-weight: 700;

    color: #111827;
}

.page-description {
    margin: 8px 0 28px;

    font-size: 14px;
    color: #6b7280;
}


/* ============================================================
   GENERIC CARD
   ============================================================ */

.card {
    padding: 20px;

    background: #fff;

    border: 1px solid #e5e7eb;

    border-radius: 8px;
}

.card-title {
    margin: 0 0 15px;

    font-size: 18px;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 900px) {

    .admin-sidebar {
        width: 210px;
    }

    .admin-main {
        margin-left: 210px;

        width: calc(100% - 210px);
    }

}


@media (max-width: 700px) {

    .admin-sidebar {
        width: 64px;
    }

    .sidebar-logo {
        justify-content: center;

        padding: 0;

        font-size: 0;
    }

    .sidebar-logo::after {
        content: "W";

        font-size: 22px;
    }

    .sidebar-link {
        justify-content: center;

        padding: 12px 0;
    }

    .sidebar-link span {
        display: none;
    }

    .admin-main {
        margin-left: 64px;

        width: calc(100% - 64px);
    }

    .admin-header {
        padding: 0 18px;
    }

    .admin-content {
        padding: 22px 18px;
    }

    .admin-user-phone {
        display: none;
    }

}


@media (max-width: 480px) {

    .auth-box {
        padding: 25px 20px;
    }

    .admin-content {
        padding: 18px 14px;
    }

    .admin-header {
        padding: 0 14px;
    }

    .admin-content h1 {
        font-size: 24px;
    }

}


/* ============================================================
   PAGE HEADER
   ============================================================ */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}


/* ============================================================
   TABLE
   ============================================================ */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    min-width: 700px;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.admin-table th {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    background: #f9fafb;
}

.admin-table td {
    font-size: 14px;
    color: #374151;
}

.admin-table tbody tr:last-child td {
    border-bottom: 0;
}

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

.table-empty {
    padding: 40px 16px !important;
    text-align: center !important;
    color: #6b7280 !important;
}


/* ============================================================
   MOBILE TABLE
   ============================================================ */

@media (max-width: 700px) {

    .table-wrapper {
        overflow: visible;
    }

    .admin-table {
        min-width: 0;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0 12px;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block;
        width: 100%;
    }

    .admin-table tbody tr {
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        padding: 16px;
    }

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

    .admin-table td {
        padding: 0;
        border: 0;
        white-space: normal;
    }

    .admin-table td + td {
        margin-top: 8px;
    }

}


/* ============================================================
   STATUS
   ============================================================ */

.status {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
}


/* Active / Success */

.status-active,
.status-success {
    background: #eaf7ed;
    color: #176b2c;
}


/* Inactive */

.status-inactive {
    background: #f3f4f6;
    color: #6b7280;
}


/* Pending / Waiting */

.status-pending {
    background: #fff7e6;
    color: #9a6700;
}


/* Warning */

.status-warning {
    background: #fff7e6;
    color: #9a6700;
}


/* Error / Failed */

.status-error,
.status-failed {
    background: #fbeaea;
    color: #a00000;
}


/* Suspended / Blocked */

.status-suspended,
.status-blocked {
    background: #fbeaea;
    color: #a00000;
}


/* Draft */

.status-draft {
    background: #f3f4f6;
    color: #6b7280;
}


/* Published */

.status-published {
    background: #eaf7ed;
    color: #176b2c;
}


/* ============================================================
   TABLE ACTIONS
   ============================================================ */

.table-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    white-space: nowrap;
}


.table-action {
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}


/* Edit */

.table-action-edit {
    color: #2563eb;
}

.table-action-edit:hover {
    color: #1d4ed8;
}


/* Delete */

.table-action-delete {
    color: #dc2626;
}

.table-action-delete:hover {
    color: #b91c1c;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 9px 18px;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    gap: 8px;
}

.btn-primary {
    background: #222;
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d5d9df;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* ============================================================
   FORM ACTIONS
   ============================================================ */

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}


.form-actions-right {
    justify-content: flex-end;
}

.form-actions .btn {
    width: auto;
    min-width: 100px;
}

/* ============================================================
   AUTH BUTTON
   ============================================================ */

.auth-box .btn-primary {
    width: 100%;
}

/* ============================================================
   PAGE HEADER ACTION
   ============================================================ */

.page-header .btn {
    width: auto;
    flex-shrink: 0;
    white-space: nowrap;
}

.sidebar-section-title {
    padding: 0 13px 9px;
    margin-left: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}
/* ============================================================
   PAGINATION
   ============================================================ */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.15s ease;
}

.pagination-link:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.pagination-link.active {
    background: #333;
    border-color: #333;
    color: #fff;
}

.pagination-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Table Actions */

.admin-table th.table-actions,
.admin-table td.table-actions {
    text-align: right;
}
@media (max-width: 768px) {

    .admin-table th,
    .admin-table td {
        text-align: left;
    }

    .admin-table th.table-actions,
    .admin-table td.table-actions {
        text-align: right;
    }

}

/* ============================================================
   TABLE SEARCH
   ============================================================ */

.table-search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.table-search .form-control {
    flex: 1;
    min-width: 0;
}

.table-search .btn {
    flex-shrink: 0;
}

@media (max-width: 600px) {

    .table-search {
        flex-direction: column;
        align-items: stretch;
    }

    .table-search .btn {
        width: 100%;
    }

}


.alert-message {
    display: none;
    width: 100%;
    margin: 0 0 20px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    box-sizing: border-box;
}

.alert-message.success {
    display: block;
    background: #ecfdf3;
    border-color: #a7f3d0;
    color: #047857;
}

.alert-message.error {
    display: block;
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.form-section-label {
    margin: 12px 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}

.card-title + .form-section-label {
    margin-top: 8px;
}

.admin-content > .card + .card {
    margin-top: 20px;
}



.status-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.status-switch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.switch-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: #d1d5db;
    border-radius: 999px;
    transition: background 0.2s ease;
}

.switch-slider::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.status-switch input:checked + .switch-slider {
    background: #22c55e;
}

.status-switch input:checked + .switch-slider::after {
    transform: translateX(20px);
}

.status-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

