.dashboard-container,
.header {
    display: flex
}

.list-item,
.user-list-item {
    transition: background-color .3s
}

body {
    font-family: sans-serif;
    margin: 0;
    background-color: #f1f5f9
}

.sidebar {
    width: 250px;
    background-color: #fff;
    padding: 20px;
    min-height: 100vh;
    box-shadow: 2px 0 5px rgba(0, 0, 0, .1)
}

.main-content {
    flex-grow: 1;
    padding: 20px
}

.header {
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 30px
}

.search-bar {
    flex-grow: 1;
    margin: 0;
    display: inline-block
}

.search-bar input {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ddd
}

.card,
.chart-box {
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .05);
    background-color: #fff
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 20px
}

.charts-container {
    display: flex;
    gap: 20px
}

.chart-box {
    flex: 1
}

.login-container {
    display: flex;
    justify-content: center;
    padding-top: 50px
}

.zonelogin {
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, .1);
    background-color: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .1);
    width: 100%;
    max-width: 450px;
    text-align: left
}

.list-container,
.user-list-container,
input#searchZone {
    /* max-width: 800px; */
}

.zonelogin form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem
}

.zonelogin div {
    display: flex;
    flex-direction: column
}

.zonelogin label {
    font-size: 1rem;
    color: #333;
    margin-bottom: .5rem;
    font-weight: 600
}

.zonelogin input[type=password],
.zonelogin input[type=text] {
    width: 100%;
    padding: .75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: .3s;
    box-sizing: border-box
}

.zonelogin input[type=password]:focus,
.zonelogin input[type=text]:focus {
    outline: 0;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, .25)
}

.zonelogin button {
    background-color: #007bff;
    color: #fff;
    border: none;
    padding: .75rem 1rem;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .3s, transform .2s;
    width: 100%;
    margin-top: 1rem
}

.zonelogin button:hover {
    background-color: #0056b3;
    transform: translateY(-2px)
}

.zonelogin button:active {
    transform: translateY(0)
}

.list-header,
.list-item {
    display: grid;
    grid-template-columns: 80px 1fr 180px;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0
}

.list-header {
    background-color: #fff;
    font-weight: 700;
    color: #555;
    border-bottom: 2px solid #e0e0e0
}

.list-item {
    background-color: #fff
}

.list-item:nth-child(odd),
.user-list-item:nth-child(2n) {
    background-color: #fafafa
}

.list-item:hover,
.user-list-item:hover {
    background-color: #f1f1f1
}

.list-col-actions {
    text-align: right
}

.btn,
.list-item .btn {
    font-size: .85rem;
    padding: .4rem .8rem;
    border-radius: 5px;
    font-weight: 500;
    border: none;
    cursor: pointer
}

.btn-success,
.list-item .btn-success {
    background-color: #28a745;
    color: #fff;
    margin-right: 5px
}

.btn-danger,
.delete-btn,
.list-item .btn-danger {
    background-color: #dc3545;
    color: #fff
}

.record-group,
.user-list-container {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden
}

.list-empty {
    text-align: center;
    padding: 2rem;
    color: #777
}

.record-group {
    box-shadow: 0 4px 10px rgba(0, 0, 0, .05);
    margin-bottom: 2rem
}

.record-group-title {
    font-size: 1.25rem;
    font-weight: 700;
    padding: 1rem 1.5rem;
    margin: 0;
    border-bottom: 2px solid #e0e0e0
}

.main-content {
    flex-basis: calc(100% - 270px)
}

.add-record-row {
    text-align: left;
    padding: 1.5rem;
    border-top: 2px solid #e0e0e0
}

.sidebar {
    box-shadow: 2px 0 10px rgba(0, 0, 0, .05)
}

nav.menu {
    position: sticky;
    top: 10px;
}

.user-add-form,
.user-list-container {
    box-shadow: 0 4px 10px rgba(0, 0, 0, .05)
}

.sidebar .logo {
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
    text-align: center
}

.sidebar .logo img {
    max-width: 100%;
    height: auto
}

.sidebar .menu,
.sidebar .menu ul {
    list-style: none;
    padding: 0;
    margin: 0
}

.sidebar .menu li {
    margin-bottom: 8px
}

.sidebar .menu a {
    display: block;
    color: #555;
    text-decoration: none;
    font-size: 1rem;
    padding: 12px 15px;
    border-radius: 8px;
    transition: .3s;
    font-weight: 500
}

.sidebar .menu a:hover {
    background-color: #f0f2f5;
    color: #007bff;
    transform: translateX(5px)
}

.sidebar .menu a.active {
    background-color: #007bff;
    color: #fff;
    box-shadow: 0 4px 8px rgba(0, 123, 255, .2)
}

.hidden {
    display: none !important
}

.user-list-header,
.user-list-item {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 300px;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e0e0e0;
    gap: 1rem
}

.user-list-header {
    font-weight: 700;
    color: #555;
    background-color: #f8f9fa;
    border-bottom: 2px solid #e0e0e0
}

.list-cell.actions {
    text-align: right;
    white-space: nowrap;
    max-width: unset !important;
}

.edit-user-btn,
.delete-btn {
    font-size: .8rem;
    padding: .5rem .8rem;
    border-radius: 5px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background-color .3s
}

.edit-user-btn {
    background-color: #28a745;
    color: #fff
}

.user-add-form {
    background-color: #fff;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center
}

.user-add-form input,
.user-add-form select {
    flex-grow: 1;
    padding: .75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 8px
}

.user-add-form button {
    flex-shrink: 0;
    background-color: #007bff;
    color: #fff;
    padding: .75rem 1.5rem;
    border: none;
    border-radius: 8px
}
.add-record-btn {
    display: inline-flex !important;
    align-items: center;
}
.record-item,
.records-header {
    display: flex;
    width: 100%;
    justify-content: space-between;
    margin-bottom: 5px;
    padding: 10px 20px 5px;
    border-top: 1px solid #e8e8e8;
    align-items: center;
}
.record-cell.actions button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
i.material-icons {
    font-size: 1rem;
}
.header-item.actions {
    text-align: right;
}

.record-cell:first-child,
.records-header .header-item:first-child {
    flex-basis: 35%;
    max-width: 35%
}

.record-item .ttl,
.records-header .ttl {
    flex-basis: 5%;
    max-width: 5%
}

.record-item .maindata,
.records-header .maindata {
    flex-basis: 40%;
    max-width: 40%;
    word-break: break-word
}

.record-item .actions,
.records-header .actions {
    flex-basis: 20%;
    text-align: right;
    max-width: 20%
}

.records-header {
    border-top: none;
    font-weight: 600
}
span.home {
    margin-left: 10px;
}
button#btnAddRecord {
    display: block;
    width: 100%;
    height: calc(1.5em + .75rem + 2px);
    padding: .375rem .75rem;
    font-size: 1rem;
	background: #1b5abe; color: white;
    font-weight: 400;
    line-height: 1.5;
    background-clip: padding-box;
    border-radius: .25rem;
    transition: border-color .15s 
ease-in-out, box-shadow .15s 
ease-in-out;
}
.new-row-highlight{ animation: highlightFade 2.5s ease-in-out; }
@keyframes highlightFade{ 0%{background:#e8f0fe;} 100%{background:transparent;} }
.action-btn{ background:none;border:0;color:#007bff;cursor:pointer;padding:0 6px; }
.action-btn:hover{ color:#0056b3; }
.disabled-input{ background:#eceeef; }
.nowrap{ white-space:nowrap; }
.quote-loading{ display:none; position:fixed; top:50%; left:50%; transform:translate(-50%,-50%); z-index:9999;}
.input-domain-suffix { background:#f1f1f1; border-left:0; color: #666; font-size: 0.9rem;}
.add-record-box { background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 4px; padding: 15px; margin-bottom: 20px; }
.add-record-box label { font-weight: 600; font-size: 0.85rem; margin-bottom: 4px; text-transform: uppercase; color: #555; }
.srv-group input { font-size: 0.9rem; }
@media screen and (max-width: 900px) {
	.dns-table-zone{
	  width: 100%;
	  overflow-x: auto;
	  -webkit-overflow-scrolling: touch; /* Giúp scroll mượt trên iOS */
	}
	/* Nếu muốn, có thể tùy chỉnh thêm cho table */
	#dnsTable {
	  min-width: 600px; /* đặt tối thiểu để bảng không bị co quá nhỏ */
	  border-collapse: collapse;
	}
	#dnsTable th:nth-child(1), /* STT */
	#dnsTable td:nth-child(1) {
	  min-width: 60px;
	}

	#dnsTable th:nth-child(2), /* Host */
	#dnsTable td:nth-child(2) {
	  min-width: 200px;
	}

	#dnsTable th:nth-child(3), /* Loại */
	#dnsTable td:nth-child(3) {
	  min-width: 120px;
	}

	#dnsTable th:nth-child(4), /* Giá trị */
	#dnsTable td:nth-child(4) {
	  min-width: 150px;
	}

	#dnsTable th, #dnsTable td {
	  padding: 8px 12px;
	  min-width: 120px;
	  white-space: nowrap;
	  text-align: left;
	}
    .dashboard-container {
        display: flex;
        flex-direction: column;
        flex-wrap: nowrap;
        justify-content: flex-start
    }

    .sidebar {
        min-height: 0;
        width: 100%;
    }
    .sidebar .menu ul {
        gap: 5px !important;
        display: flex;
        justify-content: flex-start;
        flex-direction: row;
		flex-wrap: wrap;
    }
    .sidebar .menu ul a {
        border: 1px solid #e8e8e8;
        padding: 10px
    }
    .record-item .maindata,
    .records-header .maindata {
        flex-basis: 30%;
        max-width: 30%;
        word-break: break-word;
    }

    .record-cell:first-child,
    .records-header .header-item:first-child {
        flex-basis: 30%;
        max-width: 30%;
    }

    .record-item .actions,
    .records-header .actions {
        flex-basis: 35%;
        text-align: right;
        max-width: 35%;
    }

    .sidebar .menu li {
        margin-bottom: 0;
    }
    .user-list-header, .user-list-item {
        display: flex;
        flex-wrap: nowrap;
        flex-direction: row;
        justify-content: space-between;
    }
    .hidetab {
        display: none;
    }
    .list-cell:first-child {
        flex-basis: 50%;
    }

    .list-cell.enable {
        flex-basis: 10%;
    }

    .list-cell.actions {
        flex-basis: 40%;
    }
}


@media screen and (max-width:540px) {
    .zonelogin {
        padding: 20px;
    }
	span.home {
		display: none;
	}
    .zonelogin h2 {
        font-size: 23px;
        font-weight: bold;
    }
    i.material-icons {
        font-size: 15px;
    }
    .hidemb,
    .list-cell.role,
    .list-col-stt,
    .list-header,
    .records-header {
        display: none
    }

    .list-item {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        padding: 5px;
        flex-wrap: wrap;
        font-size: 13px
    }

    .list-col-domain {
        margin-bottom: 5px
    }

    .list-item button {
        font-size: 13px !important
    }

    .user-list-item, .user-list-header {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        padding: 10px;
        font-size: 14px
    }

    .user-list-item button i {
        font-size: 14px !important
    }

    .user-list-item button {
        padding: 7px 10px
    }

    h2 {
        font-size: 20px
    }

    .add-record-btn {
        margin: 10px 0
    }

    .record-item {
        display: flex;
        flex-wrap: wrap;
        flex-direction: row;
        gap: 5px
    }

    .record-cell:first-child {
        flex-basis: 80%;
        max-width: 80%
    }

    .record-item .actions {
        flex-basis: 100%;
        max-width: 100%;
        text-align: left
    }

    .record-item .ttl {
        flex-basis: 17%;
        max-width: 17%
    }

    .record-item .maindata {
        flex-basis: 100%;
        max-width: 100%
    }

    .list-cell.actions,.header-item.actions {
        flex-basis: 30%
    }
	.sidebar .menu ul a {
		font-size: 14px;
	}
}