/* Network Management System - CSS Styles (Modern Design, No Gradients) */

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #22223b;
    background: #eef0f4;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.15s;
    font-size: 15px;
    box-shadow: 0 1px 4px rgba(34,34,59,0.04);
}

.btn-primary {
    background: #4361ee;
    color: #fff;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.07);
}

.btn-primary:hover, 
.btn-primary:focus {
    background: #354abd;
    box-shadow: 0 4px 16px rgba(67, 97, 238, 0.20);
    transform: translateY(-2px) scale(1.02);
}

.btn-secondary {
    background: #adb5bd;
    color: #22223b;
}

.btn-secondary:hover,
.btn-secondary:focus {
    background: #868e96;
    color: #fff;
    transform: translateY(-2px) scale(1.01);
}

.btn-danger {
    background: #e63946;
    color: #fff;
}

.btn-danger:hover,
.btn-danger:focus {
    background: #b62231;
    transform: translateY(-2px) scale(1.01);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 12px;
}

/* Cards */
.card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 16px rgba(34, 34, 59, 0.06);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 8px 32px rgba(34, 34, 59, 0.12);
}

.card-header {
    background: #f7f7fa;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e5e5;
}

.card-header h3 {
    margin: 0;
    color: #22223b;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: #f1f3f7;
    padding: 1rem 1.5rem;
    border-top: 1px solid #e5e5e5;
}

/* Authentication Pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.auth-form {
    background: #fff;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(34, 34, 59, 0.10);
    width: 100%;
    max-width: 400px;
}

.auth-form h2 {
    text-align: center;
    color: #22223b;
    margin-bottom: 0.5rem;
}

.auth-form h3 {
    text-align: center;
    color: #868e96;
    margin-bottom: 2rem;
    font-weight: 400;
    letter-spacing: 0.1px;
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-links a {
    color: #4361ee;
    text-decoration: none;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #22223b;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    background: #f7f7fa;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.07);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.form-text {
    font-size: 12px;
    color: #868e96;
    margin-top: 0.25rem;
}

/* Messages */
.error-message,
.success-message {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.error-message {
    background: #fbeaea;
    color: #b62231;
    border: 1px solid #e63946;
}

.success-message {
    background: #e6f7ee;
    color: #155b36;
    border: 1px solid #37b37e;
}

/* Dashboard */
.dashboard {
    background: #fff;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(34, 34, 59, 0.07);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f3f7;
}

.header h1 {
    color: #22223b;
    margin: 0;
}

.user-actions {
    display: flex;
    gap: 1rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Status Indicators */
.status-active {
    color: #1fab89;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-expired {
    color: #e63946;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-inactive {
    color: #adb5bd;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.status-active {
    background: #e6f7ee;
    color: #1fab89;
}

.status-badge.status-expired {
    background: #fbeaea;
    color: #e63946;
}

.status-badge.status-inactive {
    background: #f0f1f3;
    color: #868e96;
}

/* Device Management */
.device-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat {
    text-align: center;
    padding: 1rem;
    background: #f1f3f7;
    border-radius: 10px;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    color: #4361ee;
}

.stat-label {
    font-size: 12px;
    color: #868e96;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.device-list {
    display: grid;
    gap: 1rem;
}

.device-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: #f7f7fa;
    border-radius: 8px;
    border-left: 4px solid #4361ee;
}

.device-info h4 {
    margin-bottom: 0.5rem;
    color: #22223b;
}

.device-info p {
    margin-bottom: 0.25rem;
    font-size: 14px;
    color: #868e96;
}

.device-card {
    background: #fff;
    border: 1.5px solid #e9ecef;
    border-radius: 10px;
    padding: 1.5rem;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.device-card:hover {
    border-color: #4361ee;
    box-shadow: 0 4px 16px rgba(67, 97, 238, 0.10);
}

.device-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.device-header h4 {
    color: #22223b;
    margin: 0;
}

.device-type {
    background: #f0f1f3;
    color: #868e96;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.device-details p {
    margin-bottom: 0.5rem;
    font-size: 14px;
    color: #868e96;
}

.device-actions {
    margin-top: 1rem;
    text-align: right;
}

.devices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Payment Page */
.payment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.status-icon {
    font-size: 2rem;
    margin-right: 1rem;
}

.status-info h4 {
    margin-bottom: 0.5rem;
    color: #22223b;
}

.expiry-date {
    font-weight: bold;
    color: #1fab89;
}

.amount {
    font-weight: bold;
    color: #4361ee;
}

.payment-info {
    background: #e9f5fe;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #38bdf8;
}

.payment-info p {
    margin-bottom: 0.5rem;
    font-size: 14px;
    color: #2563eb;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    font-size: 15px;
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e5e5e5;
}

.table th {
    background: #f7f7fa;
    font-weight: 700;
    color: #22223b;
}

.table tr:hover {
    background: #f1f3f7;
}

.table-success {
    background: #e6f7ee !important;
}

.table-secondary {
    background: #f0f1f3 !important;
}

/* Admin Panel */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    padding: 2rem;
    border-radius: 14px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(34, 34, 59, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 8px 24px rgba(34, 34, 59, 0.16);
}

.stat-card .stat-number {
    font-size: 3rem;
    font-weight: 900;
    color: #4361ee;
    display: block;
    margin-bottom: 0.5rem;
}

.stat-card .stat-label {
    color: #868e96;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.device-count {
    background: #4361ee;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 0.1px;
}

/* Page Layouts */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f3f7;
}

.page-header h1 {
    color: #22223b;
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 1rem;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #adb5bd;
}

.empty-state h3 {
    color: #22223b;
    margin-bottom: 1rem;
}

/* Device Limit Info */
.device-limit-info {
    background: #fff7e6;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #fbbf24;
}

.device-limit-info p {
    margin-bottom: 0.5rem;
    color: #8d6c00;
}

.text-warning {
    color: #8d6c00;
}

.text-muted {
    color: #adb5bd;
}

.text-center {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .user-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .dashboard-grid,
    .payment-grid,
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .device-stats {
        grid-template-columns: 1fr;
    }
    
    .devices-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .auth-form {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .stat-card .stat-number {
        font-size: 2rem;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.auth-form {
    animation: fadeIn 0.6s cubic-bezier(0.39, 0.575, 0.565, 1);
}

/* Loading States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Focus States */
.btn:focus {
    outline: 2px solid #4361ee;
    outline-offset: 2px;
}

/* Voucher Styles */
.btn-success {
    background: #1fab89;
    color: #fff;
    box-shadow: 0 3px 10px rgba(31, 171, 137, 0.12);
}

.btn-success:hover,
.btn-success:focus {
    background: #19735a;
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 25px rgba(31, 171, 137, 0.2);
}

.voucher-code {
    font-family: 'Courier New', monospace;
    background: #f7f7fa;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1.5px solid #e9ecef;
    font-weight: bold;
    letter-spacing: 1px;
    color: #22223b;
}

.voucher-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.voucher-amount {
    font-weight: bold;
    color: #1fab89;
    font-size: 1.1rem;
}

/* Enhanced Table Styles for Vouchers */
.table code {
    background: #f7f7fa;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    border: 1px solid #e9ecef;
}

.table-success {
    background: #e6f7ee !important;
}

.table-secondary {
    background: #f0f1f3 !important;
}

/* Voucher Generation Form */
.voucher-form {
    background: #f7f7fa;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #1fab89;
}

.voucher-form .form-group {
    margin-bottom: 1rem;
}

.voucher-form label {
    font-weight: 700;
    color: #22223b;
}

/* Success Messages for Vouchers */
.voucher-success {
    background: #e6f7ee;
    color: #155b36;
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid #1fab89;
    margin-bottom: 1rem;
}

.voucher-success h4 {
    color: #155b36;
    margin-bottom: 0.5rem;
}

/* Voucher Statistics */
.voucher-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.voucher-stat-card {
    background: #fff;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(34, 34, 59, 0.08);
    border-top: 3px solid #1fab89;
}

.voucher-stat-number {
    font-size: 2rem;
    font-weight: 900;
    color: #1fab89;
    display: block;
    margin-bottom: 0.5rem;
}

.voucher-stat-label {
    color: #868e96;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Print Styles */
@media print {
    body {
        background: #fff;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn {
        display: none;
    }
    
    .voucher-code {
        background: #f0f0f0;
        border: 1px solid #ccc;
    }
}
