/* ================================================================
   SMS Gateway Server - Admin CSS
   ================================================================
   Design system moderno com cards, badges e responsividade.
   ================================================================ */

:root {
    --primary: #1565C0;
    --primary-dark: #0D47A1;
    --primary-light: #42A5F5;
    --secondary: #00897B;
    --danger: #F44336;
    --warning: #FF9800;
    --success: #4CAF50;
    --info: #2196F3;
    --bg: #F5F7FA;
    --surface: #FFFFFF;
    --text: #333333;
    --text-secondary: #757575;
    --border: #E0E0E0;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 12px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* ==================== Layout ==================== */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 40px;
    width: 100%;
    max-width: 400px;
}

.login-card h1 {
    text-align: center;
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 1.8rem;
}

.login-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

/* ==================== Sidebar ==================== */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 250px;
    background: var(--primary-dark);
    color: white;
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar-header .version {
    font-size: 0.75rem;
    opacity: 0.7;
}

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

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.sidebar-nav a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.sidebar-nav a.active {
    background: rgba(255,255,255,0.15);
    color: white;
    border-left: 3px solid white;
}

.sidebar-nav a .icon {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8rem;
}

.sidebar-footer a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
}

/* ==================== Main Content ==================== */
.main-content {
    margin-left: 250px;
    flex: 1;
    padding: 20px 30px;
    min-height: 100vh;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.page-header h1 {
    font-size: 1.5rem;
    color: var(--text);
}

/* ==================== Cards ==================== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.card-header h2, .card-header h3 {
    font-size: 1rem;
    color: var(--text);
}

/* ==================== Stats Grid ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    text-align: center;
    border-top: 3px solid var(--primary);
}

.stat-card.success { border-top-color: var(--success); }
.stat-card.warning { border-top-color: var(--warning); }
.stat-card.danger  { border-top-color: var(--danger); }
.stat-card.info    { border-top-color: var(--info); }

.stat-card .value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
}

.stat-card .label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* ==================== Table ==================== */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

table th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

table tr:hover {
    background: #F8F9FA;
}

table td.actions {
    white-space: nowrap;
}

/* ==================== Badges ==================== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success  { background: #E8F5E9; color: #2E7D32; }
.badge-warning  { background: #FFF3E0; color: #E65100; }
.badge-danger   { background: #FFEBEE; color: #C62828; }
.badge-info     { background: #E3F2FD; color: #1565C0; }
.badge-secondary{ background: #ECEFF1; color: #546E7A; }
.badge-online   { background: #E8F5E9; color: #2E7D32; }
.badge-offline  { background: #FFEBEE; color: #C62828; }

/* ==================== Forms ==================== */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="search"],
textarea,
select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: border-color 0.2s;
    background: var(--surface);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(21,101,192,0.1);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary   { background: var(--primary); color: white; }
.btn-success   { background: var(--success); color: white; }
.btn-danger    { background: var(--danger); color: white; }
.btn-warning   { background: var(--warning); color: white; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-outline   { background: transparent; border: 1px solid var(--border); color: var(--text); }

.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-sm    { padding: 5px 12px; font-size: 0.8rem; }

/* ==================== Alerts ==================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
    font-size: 0.85rem;
}

.alert-success { background: #E8F5E9; color: #2E7D32; border: 1px solid #C8E6C9; }
.alert-danger  { background: #FFEBEE; color: #C62828; border: 1px solid #FFCDD2; }
.alert-warning { background: #FFF3E0; color: #E65100; border: 1px solid #FFE0B2; }
.alert-info    { background: #E3F2FD; color: #1565C0; border: 1px solid #BBDEFB; }

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

.pagination a, .pagination span {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.85rem;
    border: 1px solid var(--border);
    color: var(--text);
}

.pagination a:hover { background: var(--bg); }
.pagination .active { background: var(--primary); color: white; border-color: var(--primary); }

/* ==================== Filter Bar ==================== */
.filter-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
}

.filter-bar input, .filter-bar select {
    width: auto;
    min-width: 150px;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .filter-bar { flex-direction: column; }
    .filter-bar input, .filter-bar select { width: 100%; }
}

/* ==================== Toast ==================== */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.85rem;
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

.toast-success { background: var(--success); }
.toast-error   { background: var(--danger); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==================== Chart ==================== */
.chart-container {
    position: relative;
    height: 250px;
    margin-top: 10px;
}

/* ==================== Modal ==================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal h3 {
    margin-bottom: 15px;
    color: var(--text);
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ==================== Empty State ==================== */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

/* ==================== Inline Form ==================== */
.inline-form {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}
