/* ======================
   RESET + GLOBAL
====================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

body {
    background: #eef7f1;
    padding: 40px;
    color: #2d2d2d;
    font-size: 14px;
}

/* ======================
    COMMON TITLES
====================== */
h2 {
    margin-bottom: 25px;
    font-size: 28px;
    font-weight: 700;
    text-align: left;
    color: #0aa04f;
}

.section-title {
    font-size: 20px;
    margin: 10px 0 15px;
    font-weight: 700;
    color: #007a38;
}

/* ======================
    BUTTON BASE
====================== */
button {
    font-family: inherit;
}

.btn {
    display: inline-block;
    padding: 10px 16px;
    background: #0aa04f;
    color: white;
    border-radius: 8px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

.btn:hover {
    background: #007a38;
    opacity: 0.94;
}

.btn-blue {
    background: #1976d2 !important;
}

.btn-blue:hover {
    background: #0d47a1 !important;
}

.btn-orange {
    background: #ff9800 !important;
}

.btn-orange:hover {
    background: #cc7a00 !important;
}

/* ======================
    LOGIN BOX
====================== */
.login-box {
    width: 360px;
    margin: 100px auto;
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.15);
    text-align: center;
}

.login-box h2 {
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 700;
    color: #0aa04f;
    text-align: center;
}

.login-box input {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: 1px solid #b8d6c3;
    border-radius: 8px;
    font-size: 15px;
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: #0aa04f;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    cursor: pointer;
    transition: 0.25s;
}

.login-box button:hover {
    background: #007a38;
}

/* ======================
    CREATE KEY FORM BOX
====================== */
.create-box {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

.create-box label {
    font-weight: 600;
    display: block;
    margin: 10px 0 5px;
    color: #0aa04f;
}

.create-box input,
.create-box select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #b8d6c3;
    margin-bottom: 10px;
    font-size: 14px;
}

/* Hàng ngang cho form tạo key */
.create-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.create-row > div {
    flex: 1;
}

/* ======================
    SEARCH + FILTER
====================== */
.filter-box {
    background: white;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.filter-box form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-box input,
.filter-box select {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #b8d6c3;
    font-size: 14px;
}

.filter-box button {
    background: #0aa04f;
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.filter-box button:hover {
    background: #007a38;
}

/* ======================
    TABLE WRAPPER
====================== */
.table-wrapper {
    overflow-x: auto;
    overflow-y: visible !important;
}

/* ======================
    TABLE STYLE
====================== */
table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    margin-top: 10px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
    table-layout: auto;
}

th {
    background: #0aa04f;
    color: white;
    padding: 12px;
    font-weight: 700;
    font-size: 15px;
    text-align: left;
    white-space: nowrap;
}

td {
    padding: 12px;
    border-bottom: 1px solid #e8f3ec;
    font-size: 14px;
    color: #333;
    position: relative;
    vertical-align: middle;
    white-space: nowrap;
}

tr:hover {
    background: #f1faef;
}

/* Cho phép cột khách hàng và key xuống dòng */
td:nth-child(2),   /* Khách hàng */
td:nth-child(5) {  /* KEY */
    white-space: normal !important;
}

th, td {
    min-width: 90px;
}

/* ======================
    STATUS TAGS
====================== */
.tag-active {
    background: #0aa04f;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
}

.tag-warning {
    background: #ffcc00;
    color: #4d3b00;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
}

.tag-expired {
    background: #ff4d4d;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
}

.tag-block {
    background: #b71d1d;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
}

/* ======================
    ACTION BUTTONS
====================== */
.block-btn {
    background: #e03131;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.block-btn:hover {
    background: #b71d1d;
}

.extend-btn {
    background: #007a38;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    font-size: 13px;
}

.extend-btn:hover {
    background: #005f2c;
}

.reset-btn {
    background: #ff9800;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    font-size: 13px;
}

.reset-btn:hover {
    background: #cc7a00;
}

.copy-btn {
    background: #1976d2;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    border-radius: 6px;
    font-size: 13px;
}

.copy-btn:hover {
    background: #0d47a1;
}

/* Nhóm nút trong ô Hành động */
.action-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.action-btns button,
.action-btns form button {
    margin: 0 !important;
}

/* ======================
    DROPDOWN (Gia hạn)
====================== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-btn {
    background: #007a38;
    color: white;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}

.dropdown-btn:hover {
    background: #005f2c;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 34px;
    left: 0;
    background: white;
    min-width: 130px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.15);
    border-radius: 6px;
    z-index: 9999 !important;
}

.dropdown-menu form button {
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
}

.dropdown-menu form button:hover {
    background: #eef7f1;
    color: #007a38;
}

.dropdown:hover .dropdown-menu {
    display: block;
}
td {
    overflow: visible !important;
    position: relative;
}

.dropdown-menu {
    z-index: 999999 !important;
    position: absolute;
}

.action-btns {
    overflow: visible !important;
}


/* ======================
    DASHBOARD & METRIC BOXES
====================== */
.dashboard-box {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.metric-item {
    background: #0aa04f;
    flex: 1;
    min-width: 180px;
    color: white;
    padding: 18px 20px;
    border-radius: 12px;
    text-align: center;
}

.metric-item h3 {
    font-size: 24px;
    margin-bottom: 6px;
}

.metric-item p {
    font-size: 13px;
    opacity: 0.9;
}

/* Bảng nhỏ cho dashboard (key sắp hết hạn) */
.exp-table {
    width: 100%;
    border-collapse: collapse;
}

.exp-table th,
.exp-table td {
    border-bottom: 1px solid #e8f3ec;
    padding: 10px;
    text-align: left;
}

.exp-table th {
    background: #0aa04f;
    color: white;
}

/* ======================
    TOP MENU (Admin)
====================== */
.top-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.top-menu .btn {
    margin-right: 10px;
}

/* ======================
    PRICING PAGE OVERRIDE
====================== */
/* body, .pricing-box styling chủ yếu nằm trong pricing.html
   nhưng vẫn dùng chung màu sắc & font từ global này */
