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

body {
    font-family: "Microsoft YaHei", "SimSun", Arial, sans-serif;
    background: #f0f2f5;
    color: #333;
    font-size: 14px;
}

/* ===== Header ===== */
.header {
    background: linear-gradient(135deg, #1a5276, #2980b9);
    color: #fff;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header .logo {
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 2px;
}

.header .user-info {
    font-size: 13px;
}

.header .user-info a {
    color: #fff;
    text-decoration: none;
    margin-left: 15px;
    padding: 4px 12px;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 3px;
}

.header .user-info a:hover {
    background: rgba(255,255,255,0.2);
}

/* ===== Layout ===== */
.main-container {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* ===== Sidebar ===== */
.sidebar {
    width: 200px;
    background: #1a252f;
    color: #ecf0f1;
    flex-shrink: 0;
}

.sidebar .menu-group {
    border-bottom: 1px solid #2c3e50;
}

.sidebar .menu-title {
    padding: 12px 15px;
    font-size: 13px;
    font-weight: bold;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: #162229;
    cursor: pointer;
    user-select: none;
}

.sidebar .menu-title:hover {
    background: #1c2d38;
}

.sidebar .menu-item {
    display: block;
    padding: 10px 15px 10px 30px;
    color: #bdc3c7;
    text-decoration: none;
    font-size: 13px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.sidebar .menu-item:hover {
    background: #2c3e50;
    color: #fff;
    border-left-color: #3498db;
}

.sidebar .menu-item.active {
    background: #2c3e50;
    color: #3498db;
    border-left-color: #3498db;
}

/* ===== Content ===== */
.content {
    flex: 1;
    padding: 20px;
    overflow-x: auto;
}

.content-title {
    font-size: 18px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

/* ===== Dashboard Cards ===== */
.dashboard-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
}

.dash-card {
    background: #fff;
    border-radius: 6px;
    padding: 20px;
    min-width: 200px;
    flex: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.2s;
}

.dash-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.dash-card .number {
    font-size: 32px;
    font-weight: bold;
    color: #2980b9;
    margin: 10px 0;
}

.dash-card .label {
    font-size: 13px;
    color: #7f8c8d;
}

.dash-card.success .number { color: #27ae60; }
.dash-card.warning .number { color: #f39c12; }
.dash-card.danger .number { color: #e74c3c; }

/* ===== Tables ===== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.data-table th {
    background: #2c3e50;
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-size: 13px;
    font-weight: bold;
}

.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #ecf0f1;
    font-size: 13px;
}

.data-table tr:hover {
    background: #f8f9fa;
}

.data-table tr:nth-child(even) {
    background: #fafbfc;
}

/* ===== Forms ===== */
.form-panel {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.form-group {
    display: inline-block;
    margin-right: 15px;
    margin-bottom: 10px;
}

.form-group label {
    display: inline-block;
    font-size: 13px;
    color: #555;
    margin-right: 5px;
    min-width: 80px;
    text-align: right;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    width: 180px;
}

.form-group input:focus,
.form-group select:focus {
    border-color: #3498db;
}

.form-group select {
    width: 186px;
}

/* ===== Buttons ===== */
.btn {
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    color: #fff;
    transition: background 0.2s;
}

.btn-primary {
    background: #3498db;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: #e74c3c;
}

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

.btn-warning {
    background: #f39c12;
}

.btn-warning:hover {
    background: #d68910;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* ===== Toolbar ===== */
.toolbar {
    background: #fff;
    padding: 12px 15px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* ===== Login Page ===== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a5276, #2980b9);
}

.login-box {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    width: 380px;
}

.login-box h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 22px;
}

.login-box .form-group {
    display: block;
    margin-right: 0;
    margin-bottom: 15px;
}

.login-box .form-group label {
    display: block;
    text-align: left;
    margin-bottom: 5px;
    min-width: auto;
}

.login-box .form-group input {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
}

.login-box .btn {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    margin-top: 10px;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 15px;
    justify-content: center;
}

.pagination a, .pagination span {
    padding: 5px 10px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    border-radius: 3px;
    font-size: 13px;
}

.pagination span.current {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.pagination a:hover {
    background: #ecf0f1;
}

/* ===== Tabs ===== */
.tab-nav {
    display: flex;
    border-bottom: 2px solid #ddd;
    margin-bottom: 15px;
}

.tab-nav a {
    padding: 10px 20px;
    text-decoration: none;
    color: #555;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-size: 14px;
}

.tab-nav a.active {
    color: #3498db;
    border-bottom-color: #3498db;
    font-weight: bold;
}

/* ===== Status Labels ===== */
.status-ok {
    color: #27ae60;
    font-weight: bold;
}

.status-warn {
    color: #f39c12;
    font-weight: bold;
}

.status-err {
    color: #e74c3c;
    font-weight: bold;
}

/* ===== POS ===== */
.pos-container {
    display: flex;
    gap: 15px;
}

.pos-left {
    flex: 2;
}

.pos-right {
    flex: 1;
    min-width: 300px;
}

.pos-cart {
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 15px;
}

.pos-cart .cart-total {
    font-size: 24px;
    font-weight: bold;
    color: #e74c3c;
    text-align: right;
    padding: 15px 0;
    border-top: 2px solid #e74c3c;
    margin-top: 10px;
}

/* ===== Print ===== */
@media print {
    .sidebar, .header, .toolbar { display: none; }
    .content { padding: 0; }
}
